diff options
author | Rhys Perry <[email protected]> | 2019-11-22 20:58:59 +0000 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-01-14 12:56:28 +0000 |
commit | edc888ccb1177401a0592b37d822fea98a9905ce (patch) | |
tree | ca9b10b6a3532d8c2931c54de522b4801d0723c8 /src/amd | |
parent | f664cb01ecef34c6bc92d316b1bb4954ee362e84 (diff) |
aco: fix clamp optimization
We can't do the optimization if there are neg/abs in-between.
No pipeline-db changes.
Signed-off-by: Rhys Perry <[email protected]>
Reviewed-by: Daniel Schürmann <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2883>
Diffstat (limited to 'src/amd')
-rw-r--r-- | src/amd/compiler/aco_optimizer.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/amd/compiler/aco_optimizer.cpp b/src/amd/compiler/aco_optimizer.cpp index 7a16fc176c9..44ce5289ff5 100644 --- a/src/amd/compiler/aco_optimizer.cpp +++ b/src/amd/compiler/aco_optimizer.cpp @@ -1807,11 +1807,11 @@ bool combine_clamp(opt_ctx& ctx, aco_ptr<Instruction>& instr, for (unsigned swap = 0; swap < 2; swap++) { Operand operands[3]; - bool neg[3], abs[3], clamp, inbetween_neg, inbetween_abs; + bool neg[3], abs[3], clamp; uint8_t opsel = 0, omod = 0; if (match_op3_for_vop3(ctx, instr->opcode, other_op, instr.get(), swap, "012", operands, neg, abs, &opsel, - &clamp, &omod, &inbetween_neg, &inbetween_abs, NULL)) { + &clamp, &omod, NULL, NULL, NULL)) { int const0_idx = -1, const1_idx = -1; uint32_t const0 = 0, const1 = 0; for (int i = 0; i < 3; i++) { @@ -1892,11 +1892,6 @@ bool combine_clamp(opt_ctx& ctx, aco_ptr<Instruction>& instr, return false; } - neg[1] ^= inbetween_neg; - neg[2] ^= inbetween_neg; - abs[1] |= inbetween_abs; - abs[2] |= inbetween_abs; - ctx.uses[instr->operands[swap].tempId()]--; create_vop3_for_op3(ctx, med, instr, operands, neg, abs, opsel, clamp, omod); if (omod_clamp & label_omod_success) |