aco: change usesModifiers() considering opsel_hi on packed instructions

opsel_hi == 1 means that the high operand selects the
high bits of the input, which is the normal behavior.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6680>
This commit is contained in:
Daniel Schürmann 2020-09-14 11:53:33 +01:00 committed by Marge Bot
parent 178b33c870
commit 036a369f46
1 changed files with 5 additions and 1 deletions

View File

@ -1443,8 +1443,12 @@ constexpr bool Instruction::usesModifiers() const noexcept
for (unsigned i = 0; i < operands.size(); i++) {
if (vop3p->neg_lo[i] || vop3p->neg_hi[i])
return true;
/* opsel_hi must be 1 to not be considered a modifier - even for constants */
if (!(vop3p->opsel_hi & (1 << i)))
return true;
}
return vop3p->opsel_lo || vop3p->opsel_hi || vop3p->clamp;
return vop3p->opsel_lo || vop3p->clamp;
} else if (isVOP3()) {
const VOP3A_instruction *vop3 = static_cast<const VOP3A_instruction*>(this);
for (unsigned i = 0; i < operands.size(); i++) {