summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLuca Barbieri <[email protected]>2010-08-21 20:14:16 +0200
committerLuca Barbieri <[email protected]>2010-08-21 20:42:15 +0200
commit8983621c6b39d74e0f30fa97fb8b4b362eddc87c (patch)
treef4781d490766021c838f21b7d0aaa43a6dddddc2 /src
parent923f5c97b14c107ba647c1c3eb81d81000c301f3 (diff)
nvfx: implement CMP in vp
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/nvfx/nvfx_vertprog.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gallium/drivers/nvfx/nvfx_vertprog.c b/src/gallium/drivers/nvfx/nvfx_vertprog.c
index 6b19d86a180..8ca7cfef742 100644
--- a/src/gallium/drivers/nvfx/nvfx_vertprog.c
+++ b/src/gallium/drivers/nvfx/nvfx_vertprog.c
@@ -511,6 +511,19 @@ nvfx_vertprog_parse_instruction(struct nvfx_context* nvfx, struct nvfx_vpc *vpc,
case TGSI_OPCODE_ARL:
nvfx_vp_emit(vpc, arith(VEC, ARL, dst, mask, src[0], none, none));
break;
+ case TGSI_OPCODE_CMP:
+ insn = arith(VEC, MOV, none.reg, mask, src[0], none, none);
+ insn.cc_update = 1;
+ nvfx_vp_emit(vpc, insn);
+
+ insn = arith(VEC, MOV, dst, mask, src[2], none, none);
+ insn.cc_test = NVFX_COND_GE;
+ nvfx_vp_emit(vpc, insn);
+
+ insn = arith(VEC, MOV, dst, mask, src[1], none, none);
+ insn.cc_test = NVFX_COND_LT;
+ nvfx_vp_emit(vpc, insn);
+ break;
case TGSI_OPCODE_COS:
nvfx_vp_emit(vpc, arith(SCA, COS, dst, mask, none, none, src[0]));
break;