From bf542cd37286decbd9fc0c939007b82176e16a81 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 5 Aug 2014 13:33:50 -0700 Subject: vc4: Add support for the TGSI TRUNC opcode. v2: Rebase on helpers. --- src/gallium/drivers/vc4/vc4_program.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/gallium/drivers/vc4/vc4_program.c') diff --git a/src/gallium/drivers/vc4/vc4_program.c b/src/gallium/drivers/vc4/vc4_program.c index 3f52588ada8..307eda02cbe 100644 --- a/src/gallium/drivers/vc4/vc4_program.c +++ b/src/gallium/drivers/vc4/vc4_program.c @@ -292,6 +292,16 @@ tgsi_to_qir_pow(struct tgsi_to_qir *trans, qir_LOG2(c, src[0 * 4 + 0]))); } +static struct qreg +tgsi_to_qir_trunc(struct tgsi_to_qir *trans, + struct tgsi_full_instruction *tgsi_inst, + enum qop op, struct qreg *src, int i) +{ + struct qcompile *c = trans->c; + return qir_ITOF(c, qir_FTOI(c, src[0 * 4 + i])); +} + + static struct qreg tgsi_to_qir_dp(struct tgsi_to_qir *trans, struct tgsi_full_instruction *tgsi_inst, @@ -413,6 +423,7 @@ emit_tgsi_instruction(struct tgsi_to_qir *trans, [TGSI_OPCODE_LIT] = { 0, tgsi_to_qir_lit }, [TGSI_OPCODE_LRP] = { 0, tgsi_to_qir_lrp }, [TGSI_OPCODE_POW] = { 0, tgsi_to_qir_pow }, + [TGSI_OPCODE_TRUNC] = { 0, tgsi_to_qir_trunc }, }; static int asdf = 0; uint32_t tgsi_op = tgsi_inst->Instruction.Opcode; -- cgit v1.2.3