Mesa (gallium-double-opcodes): tgsi: add support to trinary opcodes
MichaŠKról
michal at kemper.freedesktop.org
Tue Jan 19 12:35:13 UTC 2010
Module: Mesa
Branch: gallium-double-opcodes
Commit: 391a1551623109f0c0ae8c56a14ed6aeb83a1a1e
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=391a1551623109f0c0ae8c56a14ed6aeb83a1a1e
Author: Igor Oliveira <igor.oliveira at openbossa.org>
Date: Mon Jan 18 14:41:53 2010 -0400
tgsi: add support to trinary opcodes
---
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 2842089..90061cc 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)
{
More information about the mesa-commit
mailing list