summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2016-01-19 04:19:29 +0000
committerDave Airlie <airlied@redhat.com>2016-02-19 11:19:05 +1000
commita21e2c3c9819688b20ed8eeb29000cb3ca9d854d (patch)
tree097b8b36391cf0ed2edaf388ccd0673978d23ae4
parentb210d8d7d32b84c00b312fd3c3b3c8673b0d9a2d (diff)
hack some more double opcodes
-rw-r--r--src/vrend_shader.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/vrend_shader.c b/src/vrend_shader.c
index 1f23ca3..9a0e29b 100644
--- a/src/vrend_shader.c
+++ b/src/vrend_shader.c
@@ -2060,6 +2060,7 @@ iter_instruction(struct tgsi_iterate_context *iter,
EMIT_BUF_WITH_RET(ctx, buf);
break;
case TGSI_OPCODE_FRC:
+ case TGSI_OPCODE_DFRAC:
emit_op1("fract");
EMIT_BUF_WITH_RET(ctx, buf);
break;
@@ -2128,11 +2129,11 @@ iter_instruction(struct tgsi_iterate_context *iter,
EMIT_BUF_WITH_RET(ctx, buf);
break;
case TGSI_OPCODE_MAD:
- case TGSI_OPCODE_DMAD:
snprintf(buf, 255, "%s = %s((%s * %s + %s)%s);\n", dsts[0], dstconv, srcs[0], srcs[1], srcs[2], writemask);
EMIT_BUF_WITH_RET(ctx, buf);
break;
case TGSI_OPCODE_UMAD:
+ case TGSI_OPCODE_DMAD:
snprintf(buf, 255, "%s = %s(%s((%s * %s + %s)%s));\n", dsts[0], dstconv, dtypeprefix, srcs[0], srcs[1], srcs[2], writemask);
EMIT_BUF_WITH_RET(ctx, buf);
break;
@@ -2172,6 +2173,10 @@ iter_instruction(struct tgsi_iterate_context *iter,
snprintf(buf, 255, "%s = %s(ivec4(%s));\n", dsts[0], dstconv, srcs[0]);
EMIT_BUF_WITH_RET(ctx, buf);
break;
+ case TGSI_OPCODE_I2D:
+ snprintf(buf, 255, "%s = %s(ivec4(%s));\n", dsts[0], dstconv, srcs[0]);
+ EMIT_BUF_WITH_RET(ctx, buf);
+ break;
case TGSI_OPCODE_D2F:
snprintf(buf, 255, "%s = %s(%s);\n", dsts[0], dstconv, srcs[0]);
EMIT_BUF_WITH_RET(ctx, buf);
@@ -2180,14 +2185,30 @@ iter_instruction(struct tgsi_iterate_context *iter,
snprintf(buf, 255, "%s = %s(uvec4(%s));\n", dsts[0], dstconv, srcs[0]);
EMIT_BUF_WITH_RET(ctx, buf);
break;
+ case TGSI_OPCODE_U2D:
+ snprintf(buf, 255, "%s = %s(uvec4(%s));\n", dsts[0], dstconv, srcs[0]);
+ EMIT_BUF_WITH_RET(ctx, buf);
+ break;
case TGSI_OPCODE_F2I:
snprintf(buf, 255, "%s = %s(%s(ivec4(%s)));\n", dsts[0], dstconv, dtypeprefix, srcs[0]);
EMIT_BUF_WITH_RET(ctx, buf);
break;
+ case TGSI_OPCODE_D2I:
+ snprintf(buf, 255, "%s = %s(%s(ivec4(%s)));\n", dsts[0], dstconv, dtypeprefix, srcs[0]);
+ EMIT_BUF_WITH_RET(ctx, buf);
+ break;
case TGSI_OPCODE_F2U:
snprintf(buf, 255, "%s = %s(%s(uvec4(%s)));\n", dsts[0], dstconv, dtypeprefix, srcs[0]);
EMIT_BUF_WITH_RET(ctx, buf);
break;
+ case TGSI_OPCODE_D2U:
+ snprintf(buf, 255, "%s = %s(%s(uvec4(%s)));\n", dsts[0], dstconv, dtypeprefix, srcs[0]);
+ EMIT_BUF_WITH_RET(ctx, buf);
+ break;
+ case TGSI_OPCODE_F2D:
+ snprintf(buf, 255, "%s = %s(%s(uvec4(%s)));\n", dsts[0], dstconv, dtypeprefix, srcs[0]);
+ EMIT_BUF_WITH_RET(ctx, buf);
+ break;
case TGSI_OPCODE_NOT:
snprintf(buf, 255, "%s = %s(uintBitsToFloat(~(uvec4(%s))));\n", dsts[0], dstconv, srcs[0]);
EMIT_BUF_WITH_RET(ctx, buf);
@@ -2206,6 +2227,7 @@ iter_instruction(struct tgsi_iterate_context *iter,
break;
case TGSI_OPCODE_USEQ:
case TGSI_OPCODE_FSEQ:
+ case TGSI_OPCODE_DSEQ:
emit_ucompare("equal");
EMIT_BUF_WITH_RET(ctx, buf);
break;