summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/tgsi
diff options
context:
space:
mode:
authorMichal Krol <[email protected]>2010-01-02 11:00:40 +0100
committerMichal Krol <[email protected]>2010-01-05 09:28:27 +0100
commitc34f6faf35c16ff81a1c4420290be4ed7f542121 (patch)
treef92475688435b37da4271d468a9cfd0f7c6f19b0 /src/gallium/auxiliary/tgsi
parent062aab96e015021f3b83067848495a8ce2d92456 (diff)
gallium: Add UMOD TGSI opcode.
Either that or have UDIV have two destination operands.
Diffstat (limited to 'src/gallium/auxiliary/tgsi')
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_exec.c14
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_info.c1
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_opcode_tmp.h1
3 files changed, 16 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c b/src/gallium/auxiliary/tgsi/tgsi_exec.c
index 0a276483c4b..4d56cac64df 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_exec.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_exec.c
@@ -2090,6 +2090,16 @@ micro_umin(union tgsi_exec_channel *dst,
}
static void
+micro_umod(union tgsi_exec_channel *dst,
+ const union tgsi_exec_channel *src)
+{
+ dst->u[0] = src[0].u[0] % src[1].u[0];
+ dst->u[1] = src[0].u[1] % src[1].u[1];
+ dst->u[2] = src[0].u[2] % src[1].u[2];
+ dst->u[3] = src[0].u[3] % src[1].u[3];
+}
+
+static void
micro_umul(union tgsi_exec_channel *dst,
const union tgsi_exec_channel *src)
{
@@ -3491,6 +3501,10 @@ exec_instruction(
exec_vector_binary(mach, inst, micro_umin);
break;
+ case TGSI_OPCODE_UMOD:
+ exec_vector_binary(mach, inst, micro_umod);
+ break;
+
case TGSI_OPCODE_UMUL:
exec_vector_binary(mach, inst, micro_umul);
break;
diff --git a/src/gallium/auxiliary/tgsi/tgsi_info.c b/src/gallium/auxiliary/tgsi/tgsi_info.c
index 8e0635677a8..de0e09cdbae 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_info.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_info.c
@@ -165,6 +165,7 @@ static const struct tgsi_opcode_info opcode_info[TGSI_OPCODE_LAST] =
{ 1, 3, 0, 0, 0, 0, "UMAD", TGSI_OPCODE_UMAD },
{ 1, 2, 0, 0, 0, 0, "UMAX", TGSI_OPCODE_UMAX },
{ 1, 2, 0, 0, 0, 0, "UMIN", TGSI_OPCODE_UMIN },
+ { 1, 2, 0, 0, 0, 0, "UMOD", TGSI_OPCODE_UMOD },
{ 1, 2, 0, 0, 0, 0, "UMUL", TGSI_OPCODE_UMUL },
{ 1, 2, 0, 0, 0, 0, "USEQ", TGSI_OPCODE_USEQ },
{ 1, 2, 0, 0, 0, 0, "USGE", TGSI_OPCODE_USGE },
diff --git a/src/gallium/auxiliary/tgsi/tgsi_opcode_tmp.h b/src/gallium/auxiliary/tgsi/tgsi_opcode_tmp.h
index a35186c2238..e4af15c156f 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_opcode_tmp.h
+++ b/src/gallium/auxiliary/tgsi/tgsi_opcode_tmp.h
@@ -160,6 +160,7 @@ OP12(UDIV)
OP13(UMAD)
OP12(UMAX)
OP12(UMIN)
+OP12(UMOD)
OP12(UMUL)
OP12(USEQ)
OP12(USGE)