nv50/ir/gk110: fix handling of OP_SUB for floating point ops
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
This commit is contained in:
parent
72310869f0
commit
3c40be2615
|
@ -534,7 +534,10 @@ CodeEmitterGK110::emitFADD(const Instruction *i)
|
||||||
assert(i->rnd == ROUND_N);
|
assert(i->rnd == ROUND_N);
|
||||||
assert(!i->saturate);
|
assert(!i->saturate);
|
||||||
|
|
||||||
emitForm_L(i, 0x400, 0, i->src(1).mod);
|
Modifier mod = i->src(1).mod ^
|
||||||
|
Modifier(i->op == OP_SUB ? NV50_IR_MOD_NEG : 0);
|
||||||
|
|
||||||
|
emitForm_L(i, 0x400, 0, mod);
|
||||||
|
|
||||||
FTZ_(3a);
|
FTZ_(3a);
|
||||||
NEG_(3b, 0);
|
NEG_(3b, 0);
|
||||||
|
@ -549,9 +552,11 @@ CodeEmitterGK110::emitFADD(const Instruction *i)
|
||||||
|
|
||||||
if (code[0] & 0x1) {
|
if (code[0] & 0x1) {
|
||||||
modNegAbsF32_3b(i, 1);
|
modNegAbsF32_3b(i, 1);
|
||||||
|
if (i->op == OP_SUB) code[1] ^= 1 << 27;
|
||||||
} else {
|
} else {
|
||||||
ABS_(34, 1);
|
ABS_(34, 1);
|
||||||
NEG_(30, 1);
|
NEG_(30, 1);
|
||||||
|
if (i->op == OP_SUB) code[1] ^= 1 << 16;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue