[Beignet] [PATCH 1/2] fix dnetc overflow issue.

xionghu.luo at intel.com xionghu.luo at intel.com
Mon Dec 1 23:58:55 PST 2014


From: Luo Xionghu <xionghu.luo at intel.com>

the overflow type should be unsigned for uadd_with_overflow.
this patch fixed the "dnetc -test rc5-72 0" 15 fails out of
32 when disabled bswap.

Signed-off-by: Luo Xionghu <xionghu.luo at intel.com>
---
 backend/src/llvm/llvm_gen_backend.cpp |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/backend/src/llvm/llvm_gen_backend.cpp b/backend/src/llvm/llvm_gen_backend.cpp
index 3d74a0a..7f92658 100644
--- a/backend/src/llvm/llvm_gen_backend.cpp
+++ b/backend/src/llvm/llvm_gen_backend.cpp
@@ -2980,7 +2980,8 @@ namespace gbe
             ctx.ADD(dst0Type, dst0, src0, src1);
 
             ir::Register overflow = this->getRegister(&I, 1);
-            ctx.LT(dst0Type, overflow, dst0, src1);
+            const ir::Type unsignedType = makeTypeUnsigned(dst0Type);
+            ctx.LT(unsignedType, overflow, dst0, src1);
           }
           break;
           case Intrinsic::usub_with_overflow:
-- 
1.7.9.5



More information about the Beignet mailing list