diff options
author | Eric Anholt <[email protected]> | 2014-08-21 13:17:58 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2014-08-22 10:16:58 -0700 |
commit | 0f894b2795b7a1a33e0d8233eeb2e8eba9c8dcc0 (patch) | |
tree | 7be7975c29fd117ee2117f78d1a61a35a13a4a14 /src/gallium/drivers/vc4/vc4_qpu.c | |
parent | cc68be262003f371d2320f98e57931fcef1c7c8c (diff) |
vc4: Make some helpers for setting condition codes in instructions.
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_qpu.c')
-rw-r--r-- | src/gallium/drivers/vc4/vc4_qpu.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gallium/drivers/vc4/vc4_qpu.c b/src/gallium/drivers/vc4/vc4_qpu.c index de07f72bdd6..d74dee5689e 100644 --- a/src/gallium/drivers/vc4/vc4_qpu.c +++ b/src/gallium/drivers/vc4/vc4_qpu.c @@ -216,3 +216,17 @@ qpu_set_sig(uint64_t inst, uint32_t sig) return (inst & ~QPU_SIG_MASK) | QPU_SET_FIELD(sig, QPU_SIG); } +uint64_t +qpu_set_cond_add(uint64_t inst, uint32_t sig) +{ + assert(QPU_GET_FIELD(inst, QPU_COND_ADD) == QPU_COND_ALWAYS); + return (inst & ~QPU_COND_ADD_MASK) | QPU_SET_FIELD(sig, QPU_COND_ADD); +} + +uint64_t +qpu_set_cond_mul(uint64_t inst, uint32_t sig) +{ + assert(QPU_GET_FIELD(inst, QPU_COND_MUL) == QPU_COND_ALWAYS); + return (inst & ~QPU_COND_MUL_MASK) | QPU_SET_FIELD(sig, QPU_COND_MUL); +} + |