[Beignet] [PATCH] fix operators for 64 bit integer

Homer Hsing homer.xing at intel.com
Mon Nov 4 02:39:33 CET 2013


if operand is signed 64 bit integer, emit -1 for SExt casting

Signed-off-by: Homer Hsing <homer.xing at intel.com>
---
 backend/src/llvm/llvm_gen_backend.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/backend/src/llvm/llvm_gen_backend.cpp b/backend/src/llvm/llvm_gen_backend.cpp
index 6f4ed72..b824bf9 100644
--- a/backend/src/llvm/llvm_gen_backend.cpp
+++ b/backend/src/llvm/llvm_gen_backend.cpp
@@ -1694,7 +1694,7 @@ namespace gbe
           const ir::ImmediateIndex zero = ctx.newIntegerImmediate(0, dstType);
           ir::ImmediateIndex one;
           if (I.getOpcode() == Instruction::SExt
-              && (dstType == ir::TYPE_S8 || dstType == ir::TYPE_S16 || dstType == ir::TYPE_S32))
+              && (dstType == ir::TYPE_S8 || dstType == ir::TYPE_S16 || dstType == ir::TYPE_S32 || dstType == ir::TYPE_S64))
             one = ctx.newIntegerImmediate(-1, dstType);
           else
             one = ctx.newIntegerImmediate(1, dstType);
-- 
1.8.3.2



More information about the Beignet mailing list