mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-03-17 19:00:33 +01:00
aco: fix neg(abs(mul(a, b))) if the mul is not VOP3
Previously, is_abs was just ignored if mul_instr->isVOP3()==false. Signed-off-by: Rhys Perry <pendingchaos02@gmail.com> Reviewed-by: Daniel Schürmann <daniel@schuermann.dev> Fixes:93c8ebfa78("aco: Initial commit of independent AMD compiler") Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14773> (cherry picked from commit452975f257)
This commit is contained in:
parent
c975c588b1
commit
154ce77176
2 changed files with 9 additions and 5 deletions
|
|
@ -3343,7 +3343,7 @@
|
|||
"description": "aco: fix neg(abs(mul(a, b))) if the mul is not VOP3",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "93c8ebfa780ebd1495095e794731881aef29e7d3"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -3326,12 +3326,16 @@ combine_instruction(opt_ctx& ctx, aco_ptr<Instruction>& instr)
|
|||
VOP3_instruction& new_mul = instr->vop3();
|
||||
if (mul_instr->isVOP3()) {
|
||||
VOP3_instruction& mul = mul_instr->vop3();
|
||||
new_mul.neg[0] = mul.neg[0] && !is_abs;
|
||||
new_mul.neg[1] = mul.neg[1] && !is_abs;
|
||||
new_mul.abs[0] = mul.abs[0] || is_abs;
|
||||
new_mul.abs[1] = mul.abs[1] || is_abs;
|
||||
new_mul.neg[0] = mul.neg[0];
|
||||
new_mul.neg[1] = mul.neg[1];
|
||||
new_mul.abs[0] = mul.abs[0];
|
||||
new_mul.abs[1] = mul.abs[1];
|
||||
new_mul.omod = mul.omod;
|
||||
}
|
||||
if (is_abs) {
|
||||
new_mul.neg[0] = new_mul.neg[1] = false;
|
||||
new_mul.abs[0] = new_mul.abs[1] = true;
|
||||
}
|
||||
new_mul.neg[0] ^= true;
|
||||
new_mul.clamp = false;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue