diff options
author | Eric Anholt <[email protected]> | 2014-07-16 08:44:50 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2014-08-08 18:59:47 -0700 |
commit | 63e49da0a58d6579162f12b4c8e68696eeb6c833 (patch) | |
tree | 780051ba7de0abcb408d049441029b6e18292372 /src/gallium/drivers/vc4/vc4_program.c | |
parent | 0e182e7d8f6de9eef7e9b2fe5288072b7d9a6093 (diff) |
vc4: Add support for the POW opcode
v2: Rebase on helpers.
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_program.c')
-rw-r--r-- | src/gallium/drivers/vc4/vc4_program.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gallium/drivers/vc4/vc4_program.c b/src/gallium/drivers/vc4/vc4_program.c index c82e0cc17c2..005b986829a 100644 --- a/src/gallium/drivers/vc4/vc4_program.c +++ b/src/gallium/drivers/vc4/vc4_program.c @@ -244,6 +244,20 @@ tgsi_to_qir_lrp(struct tgsi_to_qir *trans, } static struct qreg +tgsi_to_qir_pow(struct tgsi_to_qir *trans, + struct tgsi_full_instruction *tgsi_inst, + enum qop op, struct qreg *src, int i) +{ + struct qcompile *c = trans->c; + + /* Note that this instruction replicates its result from the x channel + */ + return qir_EXP2(c, qir_FMUL(c, + src[1 * 4 + 0], + qir_LOG2(c, src[0 * 4 + 0]))); +} + +static struct qreg tgsi_to_qir_dp(struct tgsi_to_qir *trans, struct tgsi_full_instruction *tgsi_inst, int num, struct qreg *src, int i) @@ -360,6 +374,7 @@ emit_tgsi_instruction(struct tgsi_to_qir *trans, [TGSI_OPCODE_LG2] = { QOP_LOG2, tgsi_to_qir_alu }, [TGSI_OPCODE_LIT] = { QOP_MOV, tgsi_to_qir_alu }, /* XXX */ [TGSI_OPCODE_LRP] = { 0, tgsi_to_qir_lrp }, + [TGSI_OPCODE_POW] = { 0, tgsi_to_qir_pow }, }; static int asdf = 0; uint32_t tgsi_op = tgsi_inst->Instruction.Opcode; |