diff options
author | Eric Anholt <[email protected]> | 2016-08-25 12:31:49 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2016-08-25 17:24:11 -0700 |
commit | 8ce65261789f085e657e6a487db93d38ee6bea63 (patch) | |
tree | 960a22a83a2a764907e8c89a7f725b75b7827c97 /src/gallium/drivers/vc4/vc4_qir.h | |
parent | 074f1f3c0c2cd15213a62eb7f589423ece6391c8 (diff) |
vc4: Add support for MUL output rotation.
Extracted from a patch by jonasarrow on github.
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_qir.h')
-rw-r--r-- | src/gallium/drivers/vc4/vc4_qir.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gallium/drivers/vc4/vc4_qir.h b/src/gallium/drivers/vc4/vc4_qir.h index 90cc1385043..a82c47c0341 100644 --- a/src/gallium/drivers/vc4/vc4_qir.h +++ b/src/gallium/drivers/vc4/vc4_qir.h @@ -168,6 +168,8 @@ enum qop { */ QOP_LOAD_IMM_I2, + QOP_ROT_MUL, + /* Jumps to block->successor[0] if the qinst->cond (as a * QPU_COND_BRANCH_*) passes, or block->successor[1] if not. Note * that block->successor[1] may be unset if the condition is ALWAYS. @@ -822,6 +824,16 @@ qir_LOAD_IMM_I2(struct vc4_compile *c, uint32_t val) c->undef)); } +/** Shifts the multiply output to the right by rot channels */ +static inline struct qreg +qir_ROT_MUL(struct vc4_compile *c, struct qreg val, uint32_t rot) +{ + return qir_emit_def(c, qir_inst(QOP_ROT_MUL, c->undef, + val, + qir_reg(QFILE_LOAD_IMM, + QPU_SMALL_IMM_MUL_ROT + rot))); +} + static inline void qir_MOV_cond(struct vc4_compile *c, uint8_t cond, struct qreg dest, struct qreg src) |