mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 05:08:08 +02:00
agx: Fix packing of imsub instructions
The negate for imad is on the third source (a * b - c), not the second source. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22695>
This commit is contained in:
parent
8289fa253b
commit
c2793a304d
1 changed files with 4 additions and 2 deletions
|
|
@ -395,7 +395,8 @@ agx_pack_alu(struct util_dynarray *emission, agx_instr *I)
|
|||
|
||||
unsigned sxt = (extends && !zext) ? (1 << 10) : 0;
|
||||
|
||||
assert(!I->src[s].neg || s == 1);
|
||||
unsigned negate_src = (I->op == AGX_OPCODE_IMAD) ? 2 : 1;
|
||||
assert(!I->src[s].neg || s == negate_src);
|
||||
src_short |= sxt;
|
||||
}
|
||||
|
||||
|
|
@ -408,7 +409,8 @@ agx_pack_alu(struct util_dynarray *emission, agx_instr *I)
|
|||
extend |= (src_extend << extend_offset);
|
||||
}
|
||||
|
||||
if ((I->op == AGX_OPCODE_IMAD || I->op == AGX_OPCODE_IADD) && I->src[1].neg)
|
||||
if ((I->op == AGX_OPCODE_IMAD && I->src[2].neg) ||
|
||||
(I->op == AGX_OPCODE_IADD && I->src[1].neg))
|
||||
raw |= (1 << 27);
|
||||
|
||||
if (info.immediates & AGX_IMMEDIATE_TRUTH_TABLE) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue