From c34f6faf35c16ff81a1c4420290be4ed7f542121 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Sat, 2 Jan 2010 11:00:40 +0100 Subject: gallium: Add UMOD TGSI opcode. Either that or have UDIV have two destination operands. --- src/gallium/auxiliary/tgsi/tgsi_exec.c | 14 ++++++++++++++ src/gallium/auxiliary/tgsi/tgsi_info.c | 1 + src/gallium/auxiliary/tgsi/tgsi_opcode_tmp.h | 1 + 3 files changed, 16 insertions(+) (limited to 'src/gallium/auxiliary') diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c b/src/gallium/auxiliary/tgsi/tgsi_exec.c index 0a276483c4..4d56cac64d 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_exec.c +++ b/src/gallium/auxiliary/tgsi/tgsi_exec.c @@ -2089,6 +2089,16 @@ micro_umin(union tgsi_exec_channel *dst, dst->u[3] = src[0].u[3] < src[1].u[3] ? src[0].u[3] : src[1].u[3]; } +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 8e0635677a..de0e09cdba 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 a35186c223..e4af15c156 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) -- cgit v1.2.3