nv50/ir: fix ConstantFolding::createMul for 64 bit muls

Fixes: 2f52925f5c
       "nv50/ir: move a * b -> a << log2(b) code into createMul()"

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
This commit is contained in:
Karol Herbst
2018-10-19 19:26:39 +02:00
parent bfb2b90246
commit 2d235d69c8
@@ -965,7 +965,7 @@ ConstantFolding::createMul(DataType ty, Value *def, Value *a, int64_t b, Value *
if (b >= 0 && util_is_power_of_two_or_zero64(b)) {
int shl = util_logbase2_64(b);
Value *res = c ? bld.getSSA() : def;
Value *res = c ? bld.getSSA(typeSizeof(ty)) : def;
bld.mkOp2(OP_SHL, ty, res, a, bld.mkImm(shl));
if (c)
bld.mkOp2(OP_ADD, ty, def, res, c);