Mesa (master): nv50/ir: fix ConstantFolding::createMul for 64 bit muls

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Oct 20 10:21:30 UTC 2018


Module: Mesa
Branch: master
Commit: 2d235d69c825a22f218507fd2ba186973ba79002
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=2d235d69c825a22f218507fd2ba186973ba79002

Author: Karol Herbst <kherbst at redhat.com>
Date:   Fri Oct 19 19:26:39 2018 +0200

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

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

Reviewed-by: Rhys Perry <pendingchaos02 at gmail.com>
Signed-off-by: Karol Herbst <kherbst at redhat.com>

---

 src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
index d851cf3c37..8767e5efb9 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
@@ -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);




More information about the mesa-commit mailing list