diff options
author | Igor Oliveira <igor.oliveira@openbossa.org> | 2010-01-18 14:41:53 -0400 |
---|---|---|
committer | Igor Oliveira <igor.oliveira@openbossa.org> | 2010-09-29 23:07:25 -0400 |
commit | e44f3126f0e229a4fbf278d85ab0cd91eb7c669e (patch) | |
tree | 1ec67d3a0d557f477cbe40bb4078824ce7d08ae8 | |
parent | f969cec3d1b0efbeb6928afc889beb2a8d502210 (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 55e0a90266..d075b841bb 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_exec.c +++ b/src/gallium/auxiliary/tgsi/tgsi_exec.c @@ -2632,6 +2632,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) { |