diff options
| author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2017-05-02 10:33:08 +0000 |
|---|---|---|
| committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2017-05-02 10:33:08 +0000 |
| commit | 89ad89cc73e3e713aaad6aa9ff98fd118573a0b7 (patch) | |
| tree | 87af5cc767bfdb5d26ce8cf111749eb92f5f604b /llvm/test/CodeGen/NVPTX/f16-instructions.ll | |
| parent | 1c5550671dee51da58fb657a7b08c174f67089b0 (diff) | |
| download | bcm5719-llvm-89ad89cc73e3e713aaad6aa9ff98fd118573a0b7.tar.gz bcm5719-llvm-89ad89cc73e3e713aaad6aa9ff98fd118573a0b7.zip | |
[SelectionDAG] Improve support for promotion of <1 x fX> floating point argument types (PR31088)
PR31088 demonstrated that we were assuming that only integers require promotion from <1 x iX> types, when in fact float types may require it as well - in this case half floats.
This patch adds support for extension/truncation for both integer and float types.
Differential Revision: https://reviews.llvm.org/D32391
llvm-svn: 301910
Diffstat (limited to 'llvm/test/CodeGen/NVPTX/f16-instructions.ll')
| -rw-r--r-- | llvm/test/CodeGen/NVPTX/f16-instructions.ll | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/NVPTX/f16-instructions.ll b/llvm/test/CodeGen/NVPTX/f16-instructions.ll index 403a67f02f8..3d414082079 100644 --- a/llvm/test/CodeGen/NVPTX/f16-instructions.ll +++ b/llvm/test/CodeGen/NVPTX/f16-instructions.ll @@ -36,6 +36,21 @@ define half @test_fadd(half %a, half %b) #0 { ret half %r } +; CHECK-LABEL: test_fadd_v1f16( +; CHECK-DAG: ld.param.b16 [[A:%h[0-9]+]], [test_fadd_v1f16_param_0]; +; CHECK-DAG: ld.param.b16 [[B:%h[0-9]+]], [test_fadd_v1f16_param_1]; +; CHECK-F16-NEXT: add.rn.f16 [[R:%h[0-9]+]], [[A]], [[B]]; +; CHECK-NOF16-DAG: cvt.f32.f16 [[A32:%f[0-9]+]], [[A]] +; CHECK-NOF16-DAG: cvt.f32.f16 [[B32:%f[0-9]+]], [[B]] +; CHECK-NOF16-NEXT: add.rn.f32 [[R32:%f[0-9]+]], [[A32]], [[B32]]; +; CHECK-NOF16-NEXT: cvt.rn.f16.f32 [[R:%h[0-9]+]], [[R32]] +; CHECK-NEXT: st.param.b16 [func_retval0+0], [[R]]; +; CHECK-NEXT: ret; +define <1 x half> @test_fadd_v1f16(<1 x half> %a, <1 x half> %b) #0 { + %r = fadd <1 x half> %a, %b + ret <1 x half> %r +} + ; Check that we can lower fadd with immediate arguments. ; CHECK-LABEL: test_fadd_imm_0( ; CHECK-DAG: ld.param.b16 [[B:%h[0-9]+]], [test_fadd_imm_0_param_0]; |

