mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-25 06:08:21 +02:00
aco: fix packed 16bit fneg/fsat optimization
Make sure that the Operand is '1.0.xx'. Fixes:b03be30e07('aco: optimize packed fneg') Reviewed-by: Rhys Perry <pendingchaos02@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17395> (cherry picked from commit66d46a23fb)
This commit is contained in:
parent
8a44563486
commit
9276b2f2f3
2 changed files with 9 additions and 3 deletions
|
|
@ -472,7 +472,7 @@
|
|||
"description": "aco: fix packed 16bit fneg/fsat optimization",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "b03be30e07546b813acc1156407b964e68892beb"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -3326,7 +3326,8 @@ combine_vop3p(opt_ctx& ctx, aco_ptr<Instruction>& instr)
|
|||
|
||||
/* apply clamp */
|
||||
if (instr->opcode == aco_opcode::v_pk_mul_f16 && instr->operands[1].constantEquals(0x3C00) &&
|
||||
vop3p->clamp && instr->operands[0].isTemp() && ctx.uses[instr->operands[0].tempId()] == 1) {
|
||||
vop3p->clamp && instr->operands[0].isTemp() && ctx.uses[instr->operands[0].tempId()] == 1 &&
|
||||
!((vop3p->opsel_lo | vop3p->opsel_hi) & 2)) {
|
||||
|
||||
ssa_info& info = ctx.info[instr->operands[0].tempId()];
|
||||
if (info.is_vop3p() && instr_info.can_use_output_modifiers[(int)info.instr->opcode]) {
|
||||
|
|
@ -3350,6 +3351,12 @@ combine_vop3p(opt_ctx& ctx, aco_ptr<Instruction>& instr)
|
|||
ssa_info& info = ctx.info[op.tempId()];
|
||||
if (info.is_vop3p() && info.instr->opcode == aco_opcode::v_pk_mul_f16 &&
|
||||
info.instr->operands[1].constantEquals(0x3C00)) {
|
||||
|
||||
VOP3P_instruction* fneg = &info.instr->vop3p();
|
||||
|
||||
if ((fneg->opsel_lo | fneg->opsel_hi) & 2)
|
||||
continue;
|
||||
|
||||
Operand ops[3];
|
||||
for (unsigned j = 0; j < instr->operands.size(); j++)
|
||||
ops[j] = instr->operands[j];
|
||||
|
|
@ -3357,7 +3364,6 @@ combine_vop3p(opt_ctx& ctx, aco_ptr<Instruction>& instr)
|
|||
if (!check_vop3_operands(ctx, instr->operands.size(), ops))
|
||||
continue;
|
||||
|
||||
VOP3P_instruction* fneg = &info.instr->vop3p();
|
||||
if (fneg->clamp)
|
||||
continue;
|
||||
instr->operands[i] = fneg->operands[0];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue