[PATCH] D26767: [AMDGPU] Promote f16/i16 conversions to f32/i32 + custom lower f16 = fp_round f64

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 16 17:59:46 PST 2016


arsenm added a comment.

In https://reviews.llvm.org/D26767#598009, @kzhuravl wrote:

> In https://reviews.llvm.org/D26767#597992, @arsenm wrote:
>
> > If fp_tound has integer type after legalization, the legalization for it is broken
>
>
> Agreed, I have bitcasted it to f16 and removed bitcast from combining. However I found that in some existing cases we legalize fp_to_fp16 to integer types (which got me confused), namely:
>  https://github.com/llvm-mirror/llvm/blob/master/lib/Target/AMDGPU/AMDGPUISelLowering.cpp#L2100
>
> Also, why are our f16->f32 and f32->f16 are using i32?
>  https://github.com/llvm-mirror/llvm/blob/master/lib/Target/AMDGPU/VOP1Instructions.td#L132


fp_to_fp16 is not the same as fp_round. fp_to_fp16 is f16 stored in an integer type


https://reviews.llvm.org/D26767





More information about the llvm-commits mailing list