summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2014-07-02 10:43:50 -0700
committerEric Anholt <[email protected]>2014-08-08 18:59:46 -0700
commit23b2bad9915c1f0aad46ee96e59edb167f4ffea0 (patch)
treee5d5b6b13e2e2ecd3bfa2b3afdabb1ed17d232da
parentcf2d777fbe7fd87f9076d4bc0ad639b33e7ffb70 (diff)
vc4: Fix emit of ABS
v2: Rebase on qir helpers.
-rw-r--r--src/gallium/drivers/vc4/vc4_program.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/gallium/drivers/vc4/vc4_program.c b/src/gallium/drivers/vc4/vc4_program.c
index bc66ecc3446..0b3cfb400af 100644
--- a/src/gallium/drivers/vc4/vc4_program.c
+++ b/src/gallium/drivers/vc4/vc4_program.c
@@ -255,6 +255,16 @@ tgsi_to_qir_dp4(struct tgsi_to_qir *trans,
return tgsi_to_qir_dp(trans, tgsi_inst, 4, src, i);
}
+static struct qreg
+tgsi_to_qir_abs(struct tgsi_to_qir *trans,
+ struct tgsi_full_instruction *tgsi_inst,
+ enum qop op, struct qreg *src, int i)
+{
+ struct qcompile *c = trans->c;
+ struct qreg arg = src[0 * 4 + i];
+ return qir_FMAXABS(c, arg, arg);
+}
+
static void
emit_tgsi_instruction(struct tgsi_to_qir *trans,
struct tgsi_full_instruction *tgsi_inst)
@@ -268,7 +278,7 @@ emit_tgsi_instruction(struct tgsi_to_qir *trans,
struct qreg *src, int i);
} op_trans[] = {
[TGSI_OPCODE_MOV] = { QOP_MOV, tgsi_to_qir_alu },
- [TGSI_OPCODE_ABS] = { QOP_FMAXABS, tgsi_to_qir_alu },
+ [TGSI_OPCODE_ABS] = { 0, tgsi_to_qir_abs },
[TGSI_OPCODE_MUL] = { QOP_FMUL, tgsi_to_qir_alu },
[TGSI_OPCODE_ADD] = { QOP_FADD, tgsi_to_qir_alu },
[TGSI_OPCODE_SUB] = { QOP_FSUB, tgsi_to_qir_alu },