diff options
author | Daniel Schürmann <[email protected]> | 2019-10-17 15:06:48 +0200 |
---|---|---|
committer | Rhys Perry <[email protected]> | 2019-10-17 16:21:19 +0000 |
commit | 4b458b3e8f5fb01c23677a905554c070a8809fba (patch) | |
tree | faebde64da374c3afb8b8cfc441051cc4d7a4f31 /src/amd/compiler/aco_optimizer.cpp | |
parent | 045f05a2f68c301c850a38a511c8e254080fce9a (diff) |
aco: don't combine minmax3 if there is a neg or abs modifier in between
This fixes a graphical corruption in HotS.
No pipelinedb changes other than that.
Reviewed-by: Rhys Perry <[email protected]>
Diffstat (limited to 'src/amd/compiler/aco_optimizer.cpp')
-rw-r--r-- | src/amd/compiler/aco_optimizer.cpp | 30 |
1 files changed, 1 insertions, 29 deletions
diff --git a/src/amd/compiler/aco_optimizer.cpp b/src/amd/compiler/aco_optimizer.cpp index 6d600d55254..501e48162be 100644 --- a/src/amd/compiler/aco_optimizer.cpp +++ b/src/amd/compiler/aco_optimizer.cpp @@ -1483,34 +1483,6 @@ void create_vop3_for_op3(opt_ctx& ctx, aco_opcode opcode, aco_ptr<Instruction>& instr.reset(new_instr); } -bool combine_minmax3(opt_ctx& ctx, aco_ptr<Instruction>& instr, aco_opcode new_op) -{ - uint32_t omod_clamp = ctx.info[instr->definitions[0].tempId()].label & - (label_omod_success | label_clamp_success); - - for (unsigned swap = 0; swap < 2; swap++) { - Operand operands[3]; - bool neg[3], abs[3], opsel[3], clamp, inbetween_neg, inbetween_abs; - unsigned omod; - if (match_op3_for_vop3(ctx, instr->opcode, instr->opcode, instr.get(), swap, - "012", operands, neg, abs, opsel, - &clamp, &omod, &inbetween_neg, &inbetween_abs, NULL)) { - ctx.uses[instr->operands[swap].tempId()]--; - neg[1] ^= inbetween_neg; - neg[2] ^= inbetween_neg; - abs[1] |= inbetween_abs; - abs[2] |= inbetween_abs; - create_vop3_for_op3(ctx, new_op, instr, operands, neg, abs, opsel, clamp, omod); - if (omod_clamp & label_omod_success) - ctx.info[instr->definitions[0].tempId()].set_omod_success(instr.get()); - if (omod_clamp & label_clamp_success) - ctx.info[instr->definitions[0].tempId()].set_clamp_success(instr.get()); - return true; - } - } - return false; -} - bool combine_three_valu_op(opt_ctx& ctx, aco_ptr<Instruction>& instr, aco_opcode op2, aco_opcode new_op, const char *shuffle, uint8_t ops) { uint32_t omod_clamp = ctx.info[instr->definitions[0].tempId()].label & @@ -2202,7 +2174,7 @@ void combine_instruction(opt_ctx &ctx, aco_ptr<Instruction>& instr) bool some_gfx9_only; if (get_minmax_info(instr->opcode, &min, &max, &min3, &max3, &med3, &some_gfx9_only) && (!some_gfx9_only || ctx.program->chip_class >= GFX9)) { - if (combine_minmax3(ctx, instr, instr->opcode == min ? min3 : max3)) ; + if (combine_three_valu_op(ctx, instr, instr->opcode, instr->opcode == min ? min3 : max3, "012", 1 | 2)); else combine_clamp(ctx, instr, min, max, med3); } } |