This patch looks good to me. -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Zhigang Gong Sent: Monday, October 28, 2013 5:46 PM To: [email protected] Cc: Zhigang Gong Subject: [Beignet] [PATCH v2] GBE: fix a bug for the cast(FPToUI) instruction.
We need to choose unsigned dst type for this case. v2: fix a typo. Signed-off-by: Zhigang Gong <[email protected]> --- backend/src/llvm/llvm_gen_backend.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/src/llvm/llvm_gen_backend.cpp b/backend/src/llvm/llvm_gen_backend.cpp index 62d6eab..c2ed4b9 100644 --- a/backend/src/llvm/llvm_gen_backend.cpp +++ b/backend/src/llvm/llvm_gen_backend.cpp @@ -1660,7 +1660,11 @@ namespace gbe // Get the element type for a vector Type *llvmDstType = I.getType(); Type *llvmSrcType = I.getOperand(0)->getType(); - const ir::Type dstType = getType(ctx, llvmDstType); + ir::Type dstType; + if (I.getOpcode() == Instruction::FPToUI) + dstType = getUnsignedType(ctx, llvmDstType); + else + dstType = getType(ctx, llvmDstType); ir::Type srcType; if (I.getOpcode() == Instruction::ZExt || I.getOpcode() == Instruction::UIToFP) { srcType = getUnsignedType(ctx, llvmSrcType); -- 1.7.9.5 _______________________________________________ Beignet mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/beignet _______________________________________________ Beignet mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/beignet
