diff options
author | Igor Oliveira <igor.oliveira@openbossa.org> | 2010-01-18 14:41:53 -0400 |
---|---|---|
committer | Michal Krol <michal@vmware.com> | 2010-01-19 13:33:59 +0100 |
commit | 391a1551623109f0c0ae8c56a14ed6aeb83a1a1e (patch) | |
tree | 261862ad4090d09ca4846dcba77e7ae1d61113e8 | |
parent | aec0b017fdc3e8773e0716e9fbc1f443edd0790f (diff) |
tgsi: add support to trinary opcodes
-rw-r--r-- | src/gallium/auxiliary/tgsi/tgsi_exec.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c b/src/gallium/auxiliary/tgsi/tgsi_exec.c index 2842089b65..90061cc73d 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_exec.c +++ b/src/gallium/auxiliary/tgsi/tgsi_exec.c @@ -2351,6 +2351,30 @@ exec_double_binary(struct tgsi_exec_machine *mach, } static void +exec_double_trinary(struct tgsi_exec_machine *mach, + const struct tgsi_full_instruction *inst, + micro_dop op) +{ + union tgsi_double_channel src[3]; + union tgsi_double_channel dst; + + if ((inst->Dst[0].Register.WriteMask & TGSI_WRITEMASK_XY) == TGSI_WRITEMASK_XY) { + fetch_double_channel(mach, &src[0], &inst->Src[0], CHAN_X, CHAN_Y); + fetch_double_channel(mach, &src[1], &inst->Src[1], CHAN_X, CHAN_Y); + fetch_double_channel(mach, &src[2], &inst->Src[2], CHAN_X, CHAN_Y); + op(&dst, src); + store_double_channel(mach, &dst, &inst->Dst[0], inst, CHAN_X, CHAN_Y); + } + if ((inst->Dst[0].Register.WriteMask & TGSI_WRITEMASK_ZW) == TGSI_WRITEMASK_ZW) { + fetch_double_channel(mach, &src[0], &inst->Src[0], CHAN_Z, CHAN_W); + fetch_double_channel(mach, &src[1], &inst->Src[1], CHAN_Z, CHAN_W); + fetch_double_channel(mach, &src[2], &inst->Src[2], CHAN_Z, CHAN_W); + op(&dst, src); + store_double_channel(mach, &dst, &inst->Dst[0], inst, CHAN_Z, CHAN_W); + } +} + +static void exec_f2d(struct tgsi_exec_machine *mach, const struct tgsi_full_instruction *inst) { |