summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r600/r600_asm.c
diff options
context:
space:
mode:
authorXavier Bouchoux <[email protected]>2015-01-28 02:20:51 +0100
committerMarek Olšák <[email protected]>2015-02-06 20:03:06 +0100
commitacef65503e79ce61a16bdba92462f0ed8a7b52c2 (patch)
tree48227e0910ab48a75bc368d3651d7ea5f53d9847 /src/gallium/drivers/r600/r600_asm.c
parentbae23a1756c361dd74b97be6c9d4762bca4ca81a (diff)
r600g: fix abs() support on ALU 3 source operands instructions
Since alu does not support abs() modifier on source operands, spill and apply the modifiers to a temp register when needed. Signed-off-by: Xavier Bouchoux <[email protected]> Reviewed-by: Glenn Kennard <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600/r600_asm.c')
-rw-r--r--src/gallium/drivers/r600/r600_asm.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/drivers/r600/r600_asm.c b/src/gallium/drivers/r600/r600_asm.c
index ce3c2d125a0..79e7f748cdf 100644
--- a/src/gallium/drivers/r600/r600_asm.c
+++ b/src/gallium/drivers/r600/r600_asm.c
@@ -1133,6 +1133,11 @@ int r600_bytecode_add_alu_type(struct r600_bytecode *bc,
return -ENOMEM;
memcpy(nalu, alu, sizeof(struct r600_bytecode_alu));
+ if (alu->is_op3) {
+ /* will fail later since alu does not support it. */
+ assert(!alu->src[0].abs && !alu->src[1].abs && !alu->src[2].abs);
+ }
+
if (bc->cf_last != NULL && bc->cf_last->op != type) {
/* check if we could add it anyway */
if (bc->cf_last->op == CF_OP_ALU &&
@@ -1491,6 +1496,7 @@ static int r600_bytecode_alu_build(struct r600_bytecode *bc, struct r600_bytecod
S_SQ_ALU_WORD0_LAST(alu->last);
if (alu->is_op3) {
+ assert(!alu->src[0].abs && !alu->src[1].abs && !alu->src[2].abs);
bc->bytecode[id++] = S_SQ_ALU_WORD1_DST_GPR(alu->dst.sel) |
S_SQ_ALU_WORD1_DST_CHAN(alu->dst.chan) |
S_SQ_ALU_WORD1_DST_REL(alu->dst.rel) |