[Beignet] [PATCH] fix llvm.trunc.float instruction bug.

Zhigang Gong zhigang.gong at linux.intel.com
Thu Jan 15 00:42:29 PST 2015


Why use RNDU? we should use RNDD here.

On Thu, Jan 15, 2015 at 05:22:48PM +0800, xionghu.luo at intel.com wrote:
> From: Luo <xionghu.luo at intel.com>
> 
> float to float trunc should use RNDU IR instruction.
> 
> Signed-off-by: Luo <xionghu.luo at intel.com>
> ---
>  backend/src/llvm/llvm_gen_backend.cpp | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/backend/src/llvm/llvm_gen_backend.cpp b/backend/src/llvm/llvm_gen_backend.cpp
> index 53dec0a..3e1588f 100644
> --- a/backend/src/llvm/llvm_gen_backend.cpp
> +++ b/backend/src/llvm/llvm_gen_backend.cpp
> @@ -3310,11 +3310,9 @@ error:
>              ir::Type srcType = getType(ctx, llvmSrcType);
>              GBE_ASSERT(srcType == dstType);
>  
> -            const ir::Register tmp = ctx.reg(getFamily(ir::TYPE_S32));
>              const ir::Register dst = this->getRegister(&I);
>              const ir::Register src = this->getRegister(I.getOperand(0));
> -            ctx.CVT(ir::TYPE_S32, srcType, tmp, src);
> -            ctx.CVT(dstType, ir::TYPE_S32, dst, tmp);
> +            ctx.RNDU(dstType, dst, src);
>            }
>            break;
>            case Intrinsic::copysign:
> -- 
> 1.9.1
> 
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list