From 324ac982d8e7c2693035342de2d24baff3042911 Mon Sep 17 00:00:00 2001 From: Bryan Cain Date: Sat, 10 Sep 2011 12:31:54 -0500 Subject: gallium: add TGSI opcodes UARL and UCMP They are needed by glsl_to_tgsi for an efficient implementation using native integers. Reviewed-by: Brian Paul --- src/gallium/auxiliary/tgsi/tgsi_exec.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 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 d9de41bf826..ce6399c56b8 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_exec.c +++ b/src/gallium/auxiliary/tgsi/tgsi_exec.c @@ -3366,6 +3366,28 @@ micro_usne(union tgsi_exec_channel *dst, dst->u[3] = src0->u[3] != src1->u[3] ? ~0 : 0; } +static void +micro_uarl(union tgsi_exec_channel *dst, + const union tgsi_exec_channel *src) +{ + dst->i[0] = src->u[0]; + dst->i[1] = src->u[1]; + dst->i[2] = src->u[2]; + dst->i[3] = src->u[3]; +} + +static void +micro_ucmp(union tgsi_exec_channel *dst, + const union tgsi_exec_channel *src0, + const union tgsi_exec_channel *src1, + const union tgsi_exec_channel *src2) +{ + dst->u[0] = src0->u[0] ? src1->u[0] : src2->u[0]; + dst->u[1] = src0->u[1] ? src1->u[1] : src2->u[1]; + dst->u[2] = src0->u[2] ? src1->u[2] : src2->u[2]; + dst->u[3] = src0->u[3] ? src1->u[3] : src2->u[3]; +} + static void exec_instruction( struct tgsi_exec_machine *mach, @@ -4126,6 +4148,14 @@ exec_instruction( assert(0); break; + case TGSI_OPCODE_UARL: + exec_vector_unary(mach, inst, micro_uarl, TGSI_EXEC_DATA_INT, TGSI_EXEC_DATA_UINT); + break; + + case TGSI_OPCODE_UCMP: + exec_vector_trinary(mach, inst, micro_ucmp, TGSI_EXEC_DATA_FLOAT, TGSI_EXEC_DATA_UINT); + break; + default: assert( 0 ); } -- cgit v1.2.3