diff options
author | Jonathan Marek <[email protected]> | 2019-08-01 14:43:12 -0400 |
---|---|---|
committer | Jonathan Marek <[email protected]> | 2019-08-02 15:58:22 +0000 |
commit | 257957b026ca96685d51f0954aba687c6effa104 (patch) | |
tree | 0d0f2b7fcca755064287ee5a2a837aa94c4ed76c /src/gallium | |
parent | 43dbd7d603a6b2cc91e62d3ecbffe57bebdda2d4 (diff) |
freedreno: a2xx: fix fneg/fabs/fsat opcodes
Previously we would get a fmov with modifiers, but now that mov has no type
these opcodes need to be supported.
Signed-off-by: Jonathan Marek <[email protected]>
Reviewed-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/freedreno/a2xx/ir2_nir.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gallium/drivers/freedreno/a2xx/ir2_nir.c b/src/gallium/drivers/freedreno/a2xx/ir2_nir.c index 6121627c080..980ab7b1013 100644 --- a/src/gallium/drivers/freedreno/a2xx/ir2_nir.c +++ b/src/gallium/drivers/freedreno/a2xx/ir2_nir.c @@ -286,6 +286,9 @@ instr_create_alu(struct ir2_context *ctx, nir_op opcode, unsigned ncomp) [0 ... nir_num_opcodes - 1] = {-1, -1}, [nir_op_mov] = {MAXs, MAXv}, + [nir_op_fneg] = {MAXs, MAXv}, + [nir_op_fabs] = {MAXs, MAXv}, + [nir_op_fsat] = {MAXs, MAXv}, [nir_op_fsign] = {-1, CNDGTEv}, [nir_op_fadd] = {ADDs, ADDv}, [nir_op_fsub] = {ADDs, ADDv}, @@ -428,6 +431,15 @@ emit_alu(struct ir2_context *ctx, nir_alu_instr * alu) /* workarounds for NIR ops that don't map directly to a2xx ops */ switch (alu->op) { + case nir_op_fneg: + instr->src[0].negate = 1; + break; + case nir_op_fabs: + instr->src[0].abs = 1; + break; + case nir_op_fsat: + instr->alu.saturate = 1; + break; case nir_op_slt: tmp = instr->src[0]; instr->src[0] = instr->src[1]; |