The patchset LGTM, thanks.
> -----Original Message----- > From: Beignet [mailto:[email protected]] On Behalf Of > [email protected] > Sent: Wednesday, November 11, 2015 15:35 > To: [email protected] > Cc: Luo, Xionghu > Subject: [Beignet] [Patch v2 2/2] gbe: fix uitofp instruction issue. > > From: Luo Xionghu <[email protected]> > > llvm 3.7 may generate cast instructions "%13 = uitofp i1 %12 to float", while > the dst type is float or double , should call the coresponding > newXXXimmediate function. > > Signed-off-by: Luo Xionghu <[email protected]> > --- > backend/src/llvm/llvm_gen_backend.cpp | 12 +++++++++++- > 1 file changed, 11 insertions(+), 1 deletion(-) > > diff --git a/backend/src/llvm/llvm_gen_backend.cpp > b/backend/src/llvm/llvm_gen_backend.cpp > index 7299d53..717e3f3 100644 > --- a/backend/src/llvm/llvm_gen_backend.cpp > +++ b/backend/src/llvm/llvm_gen_backend.cpp > @@ -3144,11 +3144,21 @@ namespace gbe > // We use a select (0,1) not a convert when the destination is a > boolean > if (srcType == ir::TYPE_BOOL) { > const ir::RegisterFamily family = getFamily(dstType); > - const ir::ImmediateIndex zero = ctx.newIntegerImmediate(0, > dstType); > + ir::ImmediateIndex zero; > + if(dstType == ir::TYPE_FLOAT) > + zero = ctx.newFloatImmediate(0); > + else if(dstType == ir::TYPE_DOUBLE) > + zero = ctx.newDoubleImmediate(0); > + else > + 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_S64)) > one = ctx.newIntegerImmediate(-1, dstType); > + else if(dstType == ir::TYPE_FLOAT) > + one = ctx.newFloatImmediate(1); > + else if(dstType == ir::TYPE_DOUBLE) > + one = ctx.newDoubleImmediate(1); > else > one = ctx.newIntegerImmediate(1, dstType); > const ir::Register zeroReg = ctx.reg(family); > -- > 1.9.1 > > _______________________________________________ > Beignet mailing list > [email protected] > http://lists.freedesktop.org/mailman/listinfo/beignet _______________________________________________ Beignet mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/beignet
