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 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/gallium/auxiliary/tgsi/tgsi_exec.c') 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; -- cgit v1.2.3