nv50/ir: only take abs value when computing high result
authorIlia Mirkin <imirkin@alum.mit.edu>
Sat, 7 Nov 2015 23:47:40 +0000 (18:47 -0500)
committerIlia Mirkin <imirkin@alum.mit.edu>
Sat, 7 Nov 2015 23:58:58 +0000 (18:58 -0500)
Not reachable from TGSI since it only has UMUL, no IMUL. However it's
surprising that setting argument types to s32 will cause sign to get
lost.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nv50.cpp

index eec502be79862bcc6d997706ee155ef27f5775e9..75164ef064111394fea50f8626bae35afc13077b 100644 (file)
@@ -75,7 +75,7 @@ expandIntegerMUL(BuildUtil *bld, Instruction *mul)
    s[0] = mul->getSrc(0);
    s[1] = mul->getSrc(1);
 
-   if (isSignedType(mul->sType)) {
+   if (isSignedType(mul->sType) && highResult) {
       s[0] = bld->getSSA(fullSize);
       s[1] = bld->getSSA(fullSize);
       bld->mkOp1(OP_ABS, mul->sType, s[0], mul->getSrc(0));