summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc4/vc4_qir.h
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2016-08-25 12:31:49 -0700
committerEric Anholt <eric@anholt.net>2016-08-25 17:24:11 -0700
commit8ce65261789f085e657e6a487db93d38ee6bea63 (patch)
tree960a22a83a2a764907e8c89a7f725b75b7827c97 /src/gallium/drivers/vc4/vc4_qir.h
parent074f1f3c0c2cd15213a62eb7f589423ece6391c8 (diff)
downloadexternal_mesa3d-8ce65261789f085e657e6a487db93d38ee6bea63.zip
external_mesa3d-8ce65261789f085e657e6a487db93d38ee6bea63.tar.gz
external_mesa3d-8ce65261789f085e657e6a487db93d38ee6bea63.tar.bz2
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.h12
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 90cc138..a82c47c 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)