Offset was wrong, it's at bit 8, not 4. Also, uses subr instead
of sub when src2 has neg. Similar to GK110 now.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: mesa-stable@lists.freedesktop.org
void
CodeEmitterNVC0::emitIMAD(const Instruction *i)
{
+ uint8_t addOp =
+ (i->src(2).mod.neg() << 1) | (i->src(0).mod.neg() ^ i->src(1).mod.neg());
+
assert(i->encSize == 8);
emitForm_A(i, HEX64(20000000, 00000003));
+ assert(addOp != 3);
+ code[0] |= addOp << 8;
+
if (isSignedType(i->dType))
code[0] |= 1 << 7;
if (isSignedType(i->sType))
if (i->flagsDef >= 0) code[1] |= 1 << 16;
if (i->flagsSrc >= 0) code[1] |= 1 << 23;
- if (i->src(2).mod.neg()) code[0] |= 0x10;
- if (i->src(1).mod.neg() ^
- i->src(0).mod.neg()) code[0] |= 0x20;
-
if (i->subOp == NV50_IR_SUBOP_MUL_HIGH)
code[0] |= 1 << 6;
}