diff --git a/llvm/test/CodeGen/ARM/fp16-promote.ll b/llvm/test/CodeGen/ARM/fp16-promote.ll index e3c905d83584..e691c2bb8a97 100644 --- a/llvm/test/CodeGen/ARM/fp16-promote.ll +++ b/llvm/test/CodeGen/ARM/fp16-promote.ll @@ -5,18 +5,10 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3 target triple = "armv7-eabihf" ; CHECK-FP16-LABEL: test_fadd: -; CHECK-FP16-NEXT: .fnstart -; CHECK-FP16-NEXT: ldrh r2, [r0] -; CHECK-FP16-NEXT: ldrh r1, [r1] -; CHECK-FP16-NEXT: vmov s0, r1 -; CHECK-FP16-NEXT: vmov s2, r2 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s0, s0 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s2, s2 -; CHECK-FP16-NEXT: vadd.f32 s0, s2, s0 -; CHECK-FP16-NEXT: vcvtb.f16.f32 s0, s0 -; CHECK-FP16-NEXT: vmov r1, s0 -; CHECK-FP16-NEXT: strh r1, [r0] -; CHECK-FP16-NEXT: bx lr +; CHECK-FP16: vcvtb.f32.f16 +; CHECK-FP16: vcvtb.f32.f16 +; CHECK-FP16: vadd.f32 +; CHECK-FP16: vcvtb.f16.f32 ; CHECK-LIBCALL-LABEL: test_fadd: ; CHECK-LIBCALL: bl __gnu_h2f_ieee ; CHECK-LIBCALL: bl __gnu_h2f_ieee @@ -31,18 +23,10 @@ define void @test_fadd(half* %p, half* %q) #0 { } ; CHECK-FP16-LABEL: test_fsub: -; CHECK-FP16-NEXT: .fnstart -; CHECK-FP16-NEXT: ldrh r2, [r0] -; CHECK-FP16-NEXT: ldrh r1, [r1] -; CHECK-FP16-NEXT: vmov s0, r1 -; CHECK-FP16-NEXT: vmov s2, r2 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s0, s0 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s2, s2 -; CHECK-FP16-NEXT: vsub.f32 s0, s2, s0 -; CHECK-FP16-NEXT: vcvtb.f16.f32 s0, s0 -; CHECK-FP16-NEXT: vmov r1, s0 -; CHECK-FP16-NEXT: strh r1, [r0] -; CHECK-FP16-NEXT: bx lr +; CHECK-FP16: vcvtb.f32.f16 +; CHECK-FP16: vcvtb.f32.f16 +; CHECK-FP16: vsub.f32 +; CHECK-FP16: vcvtb.f16.f32 ; CHECK-LIBCALL-LABEL: test_fsub: ; CHECK-LIBCALL: bl __gnu_h2f_ieee ; CHECK-LIBCALL: bl __gnu_h2f_ieee @@ -57,18 +41,10 @@ define void @test_fsub(half* %p, half* %q) #0 { } ; CHECK-FP16-LABEL: test_fmul: -; CHECK-FP16-NEXT: .fnstart -; CHECK-FP16-NEXT: ldrh r2, [r0] -; CHECK-FP16-NEXT: ldrh r1, [r1] -; CHECK-FP16-NEXT: vmov s0, r1 -; CHECK-FP16-NEXT: vmov s2, r2 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s0, s0 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s2, s2 -; CHECK-FP16-NEXT: vmul.f32 s0, s2, s0 -; CHECK-FP16-NEXT: vcvtb.f16.f32 s0, s0 -; CHECK-FP16-NEXT: vmov r1, s0 -; CHECK-FP16-NEXT: strh r1, [r0] -; CHECK-FP16-NEXT: bx lr +; CHECK-FP16: vcvtb.f32.f16 +; CHECK-FP16: vcvtb.f32.f16 +; CHECK-FP16: vmul.f32 +; CHECK-FP16: vcvtb.f16.f32 ; CHECK-LIBCALL-LABEL: test_fmul ; CHECK-LIBCALL: bl __gnu_h2f_ieee ; CHECK-LIBCALL: bl __gnu_h2f_ieee @@ -83,18 +59,10 @@ define void @test_fmul(half* %p, half* %q) #0 { } ; CHECK-FP16-LABEL: test_fdiv: -; CHECK-FP16-NEXT: .fnstart -; CHECK-FP16-NEXT: ldrh r2, [r0] -; CHECK-FP16-NEXT: ldrh r1, [r1] -; CHECK-FP16-NEXT: vmov s0, r1 -; CHECK-FP16-NEXT: vmov s2, r2 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s0, s0 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s2, s2 -; CHECK-FP16-NEXT: vdiv.f32 s0, s2, s0 -; CHECK-FP16-NEXT: vcvtb.f16.f32 s0, s0 -; CHECK-FP16-NEXT: vmov r1, s0 -; CHECK-FP16-NEXT: strh r1, [r0] -; CHECK-FP16-NEXT: bx lr +; CHECK-FP16: vcvtb.f32.f16 +; CHECK-FP16: vcvtb.f32.f16 +; CHECK-FP16: vdiv.f32 +; CHECK-FP16: vcvtb.f16.f32 ; CHECK-LIBCALL-LABEL: test_fdiv ; CHECK-LIBCALL: bl __gnu_h2f_ieee ; CHECK-LIBCALL: bl __gnu_h2f_ieee @@ -109,23 +77,10 @@ define void @test_fdiv(half* %p, half* %q) #0 { } ; CHECK-FP16-LABEL: test_frem: -; CHECK-FP16-NEXT: .fnstart -; CHECK-FP16-NEXT: push {r4, lr} -; CHECK-FP16-NEXT: mov r4, r0 -; CHECK-FP16-NEXT: ldrh r0, [r1] -; CHECK-FP16-NEXT: ldrh r1, [r4] -; CHECK-FP16-NEXT: vmov s2, r0 -; CHECK-FP16-NEXT: vmov s0, r1 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s0, s0 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s2, s2 -; CHECK-FP16-NEXT: vmov r0, s0 -; CHECK-FP16-NEXT: vmov r1, s2 -; CHECK-FP16-NEXT: bl fmodf -; CHECK-FP16-NEXT: vmov s0, r0 -; CHECK-FP16-NEXT: vcvtb.f16.f32 s0, s0 -; CHECK-FP16-NEXT: vmov r0, s0 -; CHECK-FP16-NEXT: strh r0, [r4] -; CHECK-FP16-NEXT: pop {r4, pc} +; CHECK-FP16: vcvtb.f32.f16 +; CHECK-FP16: vcvtb.f32.f16 +; CHECK-FP16: bl fmodf +; CHECK-FP16: vcvtb.f16.f32 ; CHECK-LIBCALL-LABEL: test_frem ; CHECK-LIBCALL: bl __gnu_h2f_ieee ; CHECK-LIBCALL: bl __gnu_h2f_ieee @@ -191,13 +146,13 @@ define half @test_tailcall_flipped(half %a, half %b) #0 { ; Optimizer picks %p or %q based on %c and only loads that value ; No conversion is needed -; CHECK-BOTH-LABEL: test_select: -; CHECK-BOTH-NEXT: .fnstart -; CHECK-BOTH-NEXT: cmp r2, #0 -; CHECK-BOTH-NEXT: movne r1, r0 -; CHECK-BOTH-NEXT: ldrh r1, [r1] -; CHECK-BOTH-NEXT: strh r1, [r0] -; CHECK-BOTH-NEXT: bx lr +; CHECK-ALL-LABEL: test_select: +; CHECK-ALL-NEXT: .fnstart +; CHECK-ALL-NEXT: cmp r2, #0 +; CHECK-ALL-NEXT: movne r1, r0 +; CHECK-ALL-NEXT: ldrh r1, [r1] +; CHECK-ALL-NEXT: strh r1, [r0] +; CHECK-ALL-NEXT: bx lr define void @test_select(half* %p, half* %q, i1 zeroext %c) #0 { %a = load half, half* %p, align 2 %b = load half, half* %q, align 2 @@ -209,18 +164,11 @@ define void @test_select(half* %p, half* %q, i1 zeroext %c) #0 { ; Test only two variants of fcmp. These get translated to f32 vcmpe ; instructions anyway. ; CHECK-FP16-LABEL: test_fcmp_une: -; CHECK-FP16-NEXT: .fnstart -; CHECK-FP16-NEXT: ldrh r2, [r0] -; CHECK-FP16-NEXT: ldrh r0, [r1] -; CHECK-FP16-NEXT: vmov s0, r0 -; CHECK-FP16-NEXT: vmov s2, r2 -; CHECK-FP16-NEXT: mov r0, #0 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s0, s0 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s2, s2 -; CHECK-FP16-NEXT: vcmpe.f32 s2, s0 -; CHECK-FP16-NEXT: vmrs APSR_nzcv, fpscr -; CHECK-FP16-NEXT: movwne r0, #1 -; CHECK-FP16-NEXT: bx lr +; CHECK-FP16: vcvtb.f32.f16 +; CHECK-FP16: vcvtb.f32.f16 +; CHECK-FP16: vcmpe.f32 +; CHECK-FP16: vmrs APSR_nzcv, fpscr +; CHECK-FP16: movwne ; CHECK-LIBCALL-LABEL: test_fcmp_une: ; CHECK-LIBCALL: bl __gnu_h2f_ieee ; CHECK-LIBCALL: bl __gnu_h2f_ieee @@ -234,19 +182,12 @@ define i1 @test_fcmp_une(half* %p, half* %q) #0 { } ; CHECK-FP16-LABEL: test_fcmp_ueq: -; CHECK-FP16-NEXT: .fnstart -; CHECK-FP16-NEXT: ldrh r2, [r0] -; CHECK-FP16-NEXT: ldrh r0, [r1] -; CHECK-FP16-NEXT: vmov s0, r0 -; CHECK-FP16-NEXT: vmov s2, r2 -; CHECK-FP16-NEXT: mov r0, #0 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s0, s0 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s2, s2 -; CHECK-FP16-NEXT: vcmpe.f32 s2, s0 -; CHECK-FP16-NEXT: vmrs APSR_nzcv, fpscr -; CHECK-FP16-NEXT: movweq r0, #1 -; CHECK-FP16-NEXT: movwvs r0, #1 -; CHECK-FP16-NEXT: bx lr +; CHECK-FP16: vcvtb.f32.f16 +; CHECK-FP16: vcvtb.f32.f16 +; CHECK-FP16: vcmpe.f32 +; CHECK-FP16: vmrs APSR_nzcv, fpscr +; CHECK-FP16: movweq +; CHECK-FP16: movwvs ; CHECK-LIBCALL-LABEL: test_fcmp_ueq: ; CHECK-LIBCALL: bl __gnu_h2f_ieee ; CHECK-LIBCALL: bl __gnu_h2f_ieee @@ -260,19 +201,12 @@ define i1 @test_fcmp_ueq(half* %p, half* %q) #0 { } ; CHECK-FP16-LABEL: test_br_cc: -; CHECK-FP16-NEXT: .fnstart -; CHECK-FP16-NEXT: ldrh r0, [r0] -; CHECK-FP16-NEXT: ldrh r1, [r1] -; CHECK-FP16-NEXT: vmov s0, r1 -; CHECK-FP16-NEXT: vmov s2, r0 -; CHECK-FP16-NEXT: mov r0, #0 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s0, s0 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s2, s2 -; CHECK-FP16-NEXT: vcmpe.f32 s2, s0 -; CHECK-FP16-NEXT: vmrs APSR_nzcv, fpscr -; CHECK-FP16-NEXT: strmi r0, [r3] -; CHECK-FP16-NEXT: strpl r0, [r2] -; CHECK-FP16-NEXT: bx lr +; CHECK-FP16: vcvtb.f32.f16 +; CHECK-FP16: vcvtb.f32.f16 +; CHECK-FP16: vcmpe.f32 +; CHECK-FP16: vmrs APSR_nzcv, fpscr +; CHECK-FP16: strmi +; CHECK-FP16: strpl ; CHECK-LIBCALL-LABEL: test_br_cc: ; CHECK-LIBCALL: bl __gnu_h2f_ieee ; CHECK-LIBCALL: bl __gnu_h2f_ieee @@ -294,30 +228,18 @@ else: declare i1 @test_dummy(half* %p) #0 ; CHECK-FP16-LABEL: test_phi: -; CHECK-FP16-NEXT: .fnstart -; CHECK-FP16-NEXT: push {r4, lr} -; CHECK-FP16-NEXT: vpush {d8, d9} -; CHECK-FP16-NEXT: mov r4, r0 -; CHECK-FP16-NEXT: ldrh r0, [r4] -; CHECK-FP16-NEXT: vmov s0, r0 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s18, s0 -; CHECK-FP16-NEXT: [[LOOP:.LBB[1-9_]+]]: -; CHECK-FP16-NEXT: ldrh r0, [r4] -; CHECK-FP16-NEXT: vmov.f32 s16, s18 -; CHECK-FP16-NEXT: vmov s0, r0 -; CHECK-FP16-NEXT: mov r0, r4 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s18, s0 -; CHECK-FP16-NEXT: bl test_dummy -; CHECK-FP16-NEXT: tst r0, #1 -; CHECK-FP16-NEXT: bne [[LOOP]] -; CHECK-FP16-NEXT: vcvtb.f16.f32 s0, s16 -; CHECK-FP16-NEXT: vmov r0, s0 -; CHECK-FP16-NEXT: strh r0, [r4] +; CHECK-FP16: vcvtb.f32.f16 +; CHECK-FP16: [[LOOP:.LBB[1-9_]+]]: +; CHECK-FP16: vcvtb.f32.f16 +; CHECK-FP16: bl test_dummy +; CHECK-FP16: bne [[LOOP]] +; CHECK-FP16: vcvtb.f16.f32 ; CHECK-LIBCALL-LABEL: test_phi: ; CHECK-LIBCALL: bl __gnu_h2f_ieee ; CHECK-LIBCALL: [[LOOP:.LBB[1-9_]+]]: ; CHECK-LIBCALL: bl __gnu_h2f_ieee ; CHECK-LIBCALL: bl test_dummy +; CHECK-LIBCALL: bne [[LOOP]] ; CHECK-LIBCALL: bl __gnu_f2h_ieee define void @test_phi(half* %p) #0 { entry: @@ -334,13 +256,8 @@ return: } ; CHECK-FP16-LABEL: test_fptosi_i32: -; CHECK-FP16-NEXT: .fnstart -; CHECK-FP16-NEXT: ldrh r0, [r0] -; CHECK-FP16-NEXT: vmov s0, r0 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s0, s0 -; CHECK-FP16-NEXT: vcvt.s32.f32 s0, s0 -; CHECK-FP16-NEXT: vmov r0, s0 -; CHECK-FP16-NEXT: bx +; CHECK-FP16: vcvtb.f32.f16 +; CHECK-FP16: vcvt.s32.f32 ; CHECK-LIBCALL-LABEL: test_fptosi_i32: ; CHECK-LIBCALL: bl __gnu_h2f_ieee ; CHECK-LIBCALL: vcvt.s32.f32 @@ -351,14 +268,8 @@ define i32 @test_fptosi_i32(half* %p) #0 { } ; CHECK-FP16-LABEL: test_fptosi_i64: -; CHECK-FP16-NEXT: .fnstart -; CHECK-FP16-NEXT: push {r11, lr} -; CHECK-FP16-NEXT: ldrh r0, [r0] -; CHECK-FP16-NEXT: vmov s0, r0 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s0, s0 -; CHECK-FP16-NEXT: vmov r0, s0 -; CHECK-FP16-NEXT: __aeabi_f2lz -; CHECK-FP16-NEXT: pop {r11, pc} +; CHECK-FP16: vcvtb.f32.f16 +; CHECK-FP16: bl __aeabi_f2lz ; CHECK-LIBCALL-LABEL: test_fptosi_i64: ; CHECK-LIBCALL: bl __gnu_h2f_ieee ; CHECK-LIBCALL: bl __aeabi_f2lz @@ -369,13 +280,8 @@ define i64 @test_fptosi_i64(half* %p) #0 { } ; CHECK-FP16-LABEL: test_fptoui_i32: -; CHECK-FP16-NEXT: .fnstart -; CHECK-FP16-NEXT: ldrh r0, [r0] -; CHECK-FP16-NEXT: vmov s0, r0 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s0, s0 -; CHECK-FP16-NEXT: vcvt.u32.f32 s0, s0 -; CHECK-FP16-NEXT: vmov r0, s0 -; CHECK-FP16-NEXT: bx +; CHECK-FP16: vcvtb.f32.f16 +; CHECK-FP16: vcvt.u32.f32 ; CHECK-LIBCALL-LABEL: test_fptoui_i32: ; CHECK-LIBCALL: bl __gnu_h2f_ieee ; CHECK-LIBCALL: vcvt.u32.f32 @@ -386,14 +292,8 @@ define i32 @test_fptoui_i32(half* %p) #0 { } ; CHECK-FP16-LABEL: test_fptoui_i64: -; CHECK-FP16-NEXT: .fnstart -; CHECK-FP16-NEXT: push {r11, lr} -; CHECK-FP16-NEXT: ldrh r0, [r0] -; CHECK-FP16-NEXT: vmov s0, r0 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s0, s0 -; CHECK-FP16-NEXT: vmov r0, s0 -; CHECK-FP16-NEXT: __aeabi_f2ulz -; CHECK-FP16-NEXT: pop {r11, pc} +; CHECK-FP16: vcvtb.f32.f16 +; CHECK-FP16: bl __aeabi_f2ulz ; CHECK-LIBCALL-LABEL: test_fptoui_i64: ; CHECK-LIBCALL: bl __gnu_h2f_ieee ; CHECK-LIBCALL: bl __aeabi_f2ulz @@ -404,13 +304,8 @@ define i64 @test_fptoui_i64(half* %p) #0 { } ; CHECK-FP16-LABEL: test_sitofp_i32: -; CHECK-FP16-NEXT: .fnstart -; CHECK-FP16-NEXT: vmov s0, r0 -; CHECK-FP16-NEXT: vcvt.f32.s32 s0, s0 -; CHECK-FP16-NEXT: vcvtb.f16.f32 s0, s0 -; CHECK-FP16-NEXT: vmov r0, s0 -; CHECK-FP16-NEXT: strh r0, [r1] -; CHECK-FP16-NEXT: bx +; CHECK-FP16: vcvt.f32.s32 +; CHECK-FP16: vcvtb.f16.f32 ; CHECK-LIBCALL-LABEL: test_sitofp_i32: ; CHECK-LIBCALL: vcvt.f32.s32 ; CHECK-LIBCALL: bl __gnu_f2h_ieee @@ -421,13 +316,8 @@ define void @test_sitofp_i32(i32 %a, half* %p) #0 { } ; CHECK-FP16-LABEL: test_uitofp_i32: -; CHECK-FP16-NEXT: .fnstart -; CHECK-FP16-NEXT: vmov s0, r0 -; CHECK-FP16-NEXT: vcvt.f32.u32 s0, s0 -; CHECK-FP16-NEXT: vcvtb.f16.f32 s0, s0 -; CHECK-FP16-NEXT: vmov r0, s0 -; CHECK-FP16-NEXT: strh r0, [r1] -; CHECK-FP16-NEXT: bx +; CHECK-FP16: vcvt.f32.u32 +; CHECK-FP16: vcvtb.f16.f32 ; CHECK-LIBCALL-LABEL: test_uitofp_i32: ; CHECK-LIBCALL: vcvt.f32.u32 ; CHECK-LIBCALL: bl __gnu_f2h_ieee @@ -438,15 +328,8 @@ define void @test_uitofp_i32(i32 %a, half* %p) #0 { } ; CHECK-FP16-LABEL: test_sitofp_i64: -; CHECK-FP16-NEXT: .fnstart -; CHECK-FP16-NEXT: push {r4, lr} -; CHECK-FP16-NEXT: mov r4, r2 -; CHECK-FP16-NEXT: bl __aeabi_l2f -; CHECK-FP16-NEXT: vmov s0, r0 -; CHECK-FP16-NEXT: vcvtb.f16.f32 s0, s0 -; CHECK-FP16-NEXT: vmov r0, s0 -; CHECK-FP16-NEXT: strh r0, [r4] -; CHECK-FP16-NEXT: pop {r4, pc} +; CHECK-FP16: bl __aeabi_l2f +; CHECK-FP16: vcvtb.f16.f32 ; CHECK-LIBCALL-LABEL: test_sitofp_i64: ; CHECK-LIBCALL: bl __aeabi_l2f ; CHECK-LIBCALL: bl __gnu_f2h_ieee @@ -457,15 +340,8 @@ define void @test_sitofp_i64(i64 %a, half* %p) #0 { } ; CHECK-FP16-LABEL: test_uitofp_i64: -; CHECK-FP16-NEXT: .fnstart -; CHECK-FP16-NEXT: push {r4, lr} -; CHECK-FP16-NEXT: mov r4, r2 -; CHECK-FP16-NEXT: bl __aeabi_ul2f -; CHECK-FP16-NEXT: vmov s0, r0 -; CHECK-FP16-NEXT: vcvtb.f16.f32 s0, s0 -; CHECK-FP16-NEXT: vmov r0, s0 -; CHECK-FP16-NEXT: strh r0, [r4] -; CHECK-FP16-NEXT: pop {r4, pc} +; CHECK-FP16: bl __aeabi_ul2f +; CHECK-FP16: vcvtb.f16.f32 ; CHECK-LIBCALL-LABEL: test_uitofp_i64: ; CHECK-LIBCALL: bl __aeabi_ul2f ; CHECK-LIBCALL: bl __gnu_f2h_ieee @@ -476,12 +352,7 @@ define void @test_uitofp_i64(i64 %a, half* %p) #0 { } ; CHECK-FP16-LABEL: test_fptrunc_float: -; CHECK-FP16-NEXT: .fnstart -; CHECK-FP16-NEXT: vmov s0, r0 -; CHECK-FP16-NEXT: vcvtb.f16.f32 s0, s0 -; CHECK-FP16-NEXT: vmov r0, s0 -; CHECK-FP16-NEXT: strh r0, [r1] -; CHECK-FP16-NEXT: bx +; CHECK-FP16: vcvtb.f16.f32 ; CHECK-LIBCALL-LABEL: test_fptrunc_float: ; CHECK-LIBCALL: bl __gnu_f2h_ieee define void @test_fptrunc_float(float %f, half* %p) #0 { @@ -491,12 +362,7 @@ define void @test_fptrunc_float(float %f, half* %p) #0 { } ; CHECK-FP16-LABEL: test_fptrunc_double: -; CHECK-FP16-NEXT: .fnstart -; CHECK-FP16-NEXT: push {r4, lr} -; CHECK-FP16-NEXT: mov r4, r2 -; CHECK-FP16-NEXT: bl __aeabi_d2h -; CHECK-FP16-NEXT: strh r0, [r4] -; CHECK-FP16-NEXT: pop {r4, pc} +; CHECK-FP16: bl __aeabi_d2h ; CHECK-LIBCALL-LABEL: test_fptrunc_double: ; CHECK-LIBCALL: bl __aeabi_d2h define void @test_fptrunc_double(double %d, half* %p) #0 { @@ -506,12 +372,7 @@ define void @test_fptrunc_double(double %d, half* %p) #0 { } ; CHECK-FP16-LABEL: test_fpextend_float: -; CHECK-FP16-NEXT: .fnstart -; CHECK-FP16-NEXT: ldrh r0, [r0] -; CHECK-FP16-NEXT: vmov s0, r0 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s0, s0 -; CHECK-FP16-NEXT: vmov r0, s0 -; CHECK-FP16-NEXT: bx lr +; CHECK-FP16: vcvtb.f32.f16 ; CHECK-LIBCALL-LABEL: test_fpextend_float: ; CHECK-LIBCALL: b __gnu_h2f_ieee define float @test_fpextend_float(half* %p) { @@ -521,13 +382,8 @@ define float @test_fpextend_float(half* %p) { } ; CHECK-FP16-LABEL: test_fpextend_double: -; CHECK-FP16-NEXT: .fnstart -; CHECK-FP16-NEXT: ldrh r0, [r0] -; CHECK-FP16-NEXT: vmov s0, r0 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s0, s0 -; CHECK-FP16-NEXT: vcvt.f64.f32 d16, s0 -; CHECK-FP16-NEXT: vmov r0, r1, d16 -; CHECK-FP16-NEXT: bx lr +; CHECK-FP16: vcvtb.f32.f16 +; CHECK-FP16: vcvt.f64.f32 ; CHECK-LIBCALL-LABEL: test_fpextend_double: ; CHECK-LIBCALL: bl __gnu_h2f_ieee ; CHECK-LIBCALL: vcvt.f64.f32 @@ -537,20 +393,20 @@ define double @test_fpextend_double(half* %p) { ret double %r } -; CHECK-BOTH-LABEL: test_bitcast_halftoi16: -; CHECK-BOTH-NEXT: .fnstart -; CHECK-BOTH-NEXT: ldrh r0, [r0] -; CHECK-BOTH-NEXT: bx lr +; CHECK-ALL-LABEL: test_bitcast_halftoi16: +; CHECK-ALL-NEXT: .fnstart +; CHECK-ALL-NEXT: ldrh r0, [r0] +; CHECK-ALL-NEXT: bx lr define i16 @test_bitcast_halftoi16(half* %p) #0 { %a = load half, half* %p, align 2 %r = bitcast half %a to i16 ret i16 %r } -; CHECK-BOTH-LABEL: test_bitcast_i16tohalf: -; CHECK-BOTH-NEXT: .fnstart -; CHECK-BOTH-NEXT: strh r0, [r1] -; CHECK-BOTH-NEXT: bx lr +; CHECK-ALL-LABEL: test_bitcast_i16tohalf: +; CHECK-ALL-NEXT: .fnstart +; CHECK-ALL-NEXT: strh r0, [r1] +; CHECK-ALL-NEXT: bx lr define void @test_bitcast_i16tohalf(i16 %a, half* %p) #0 { %r = bitcast i16 %a to half store half %r, half* %p @@ -581,15 +437,9 @@ declare half @llvm.round.f16(half %a) #0 declare half @llvm.fmuladd.f16(half %a, half %b, half %c) #0 ; CHECK-FP16-LABEL: test_sqrt: -; CHECK-FP16-NEXT: .fnstart -; CHECK-FP16-NEXT: ldrh r1, [r0] -; CHECK-FP16-NEXT: vmov s0, r1 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s0, s0 -; CHECK-FP16-NEXT: vsqrt.f32 s0, s0 -; CHECK-FP16-NEXT: vcvtb.f16.f32 s0, s0 -; CHECK-FP16-NEXT: vmov r1, s0 -; CHECK-FP16-NEXT: strh r1, [r0] -; CHECK-FP16-NEXT: bx lr +; CHECK-FP16: vcvtb.f32.f16 +; CHECK-FP16: vsqrt.f32 +; CHECK-FP16: vcvtb.f16.f32 ; CHECK-LIBCALL-LABEL: test_sqrt: ; CHECK-LIBCALL: bl __gnu_h2f_ieee ; CHECK-LIBCALL: vsqrt.f32 @@ -602,19 +452,9 @@ define void @test_sqrt(half* %p) #0 { } ; CHECK-FP16-LABEL: test_fpowi: -; CHECK-FP16-NEXT: .fnstart -; CHECK-FP16-NEXT: push {r4, lr} -; CHECK-FP16-NEXT: mov r4, r0 -; CHECK-FP16-NEXT: ldrh r0, [r4] -; CHECK-FP16-NEXT: vmov s0, r0 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s0, s0 -; CHECK-FP16-NEXT: vmov r0, s0 -; CHECK-FP16-NEXT: bl __powisf2 -; CHECK-FP16-NEXT: vmov s0, r0 -; CHECK-FP16-NEXT: vcvtb.f16.f32 s0, s0 -; CHECK-FP16-NEXT: vmov r0, s0 -; CHECK-FP16-NEXT: strh r0, [r4] -; CHECK-FP16-NEXT: pop {r4, pc} +; CHECK-FP16: vcvtb.f32.f16 +; CHECK-FP16: bl __powisf2 +; CHECK-FP16: vcvtb.f16.f32 ; CHECK-LIBCALL-LABEL: test_fpowi: ; CHECK-LIBCALL: bl __gnu_h2f_ieee ; CHECK-LIBCALL: bl __powisf2 @@ -627,19 +467,9 @@ define void @test_fpowi(half* %p, i32 %b) #0 { } ; CHECK-FP16-LABEL: test_sin: -; CHECK-FP16-NEXT: .fnstart -; CHECK-FP16-NEXT: push {r4, lr} -; CHECK-FP16-NEXT: mov r4, r0 -; CHECK-FP16-NEXT: ldrh r0, [r4] -; CHECK-FP16-NEXT: vmov s0, r0 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s0, s0 -; CHECK-FP16-NEXT: vmov r0, s0 -; CHECK-FP16-NEXT: bl sinf -; CHECK-FP16-NEXT: vmov s0, r0 -; CHECK-FP16-NEXT: vcvtb.f16.f32 s0, s0 -; CHECK-FP16-NEXT: vmov r0, s0 -; CHECK-FP16-NEXT: strh r0, [r4] -; CHECK-FP16-NEXT: pop {r4, pc} +; CHECK-FP16: vcvtb.f32.f16 +; CHECK-FP16: bl sinf +; CHECK-FP16: vcvtb.f16.f32 ; CHECK-LIBCALL-LABEL: test_sin: ; CHECK-LIBCALL: bl __gnu_h2f_ieee ; CHECK-LIBCALL: bl sinf @@ -652,19 +482,9 @@ define void @test_sin(half* %p) #0 { } ; CHECK-FP16-LABEL: test_cos: -; CHECK-FP16-NEXT: .fnstart -; CHECK-FP16-NEXT: push {r4, lr} -; CHECK-FP16-NEXT: mov r4, r0 -; CHECK-FP16-NEXT: ldrh r0, [r4] -; CHECK-FP16-NEXT: vmov s0, r0 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s0, s0 -; CHECK-FP16-NEXT: vmov r0, s0 -; CHECK-FP16-NEXT: bl cosf -; CHECK-FP16-NEXT: vmov s0, r0 -; CHECK-FP16-NEXT: vcvtb.f16.f32 s0, s0 -; CHECK-FP16-NEXT: vmov r0, s0 -; CHECK-FP16-NEXT: strh r0, [r4] -; CHECK-FP16-NEXT: pop {r4, pc} +; CHECK-FP16: vcvtb.f32.f16 +; CHECK-FP16: bl cosf +; CHECK-FP16: vcvtb.f16.f32 ; CHECK-LIBCALL-LABEL: test_cos: ; CHECK-LIBCALL: bl __gnu_h2f_ieee ; CHECK-LIBCALL: bl cosf @@ -677,23 +497,10 @@ define void @test_cos(half* %p) #0 { } ; CHECK-FP16-LABEL: test_pow: -; CHECK-FP16-NEXT: .fnstart -; CHECK-FP16-NEXT: push {r4, lr} -; CHECK-FP16-NEXT: mov r4, r0 -; CHECK-FP16-NEXT: ldrh r0, [r1] -; CHECK-FP16-NEXT: ldrh r1, [r4] -; CHECK-FP16-NEXT: vmov s2, r0 -; CHECK-FP16-NEXT: vmov s0, r1 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s0, s0 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s2, s2 -; CHECK-FP16-NEXT: vmov r0, s0 -; CHECK-FP16-NEXT: vmov r1, s2 -; CHECK-FP16-NEXT: bl powf -; CHECK-FP16-NEXT: vmov s0, r0 -; CHECK-FP16-NEXT: vcvtb.f16.f32 s0, s0 -; CHECK-FP16-NEXT: vmov r0, s0 -; CHECK-FP16-NEXT: strh r0, [r4] -; CHECK-FP16-NEXT: pop {r4, pc} +; CHECK-FP16: vcvtb.f32.f16 +; CHECK-FP16: vcvtb.f32.f16 +; CHECK-FP16: bl powf +; CHECK-FP16: vcvtb.f16.f32 ; CHECK-LIBCALL-LABEL: test_pow: ; CHECK-LIBCALL: bl __gnu_h2f_ieee ; CHECK-LIBCALL: bl __gnu_h2f_ieee @@ -708,19 +515,9 @@ define void @test_pow(half* %p, half* %q) #0 { } ; CHECK-FP16-LABEL: test_exp: -; CHECK-FP16-NEXT: .fnstart -; CHECK-FP16-NEXT: push {r4, lr} -; CHECK-FP16-NEXT: mov r4, r0 -; CHECK-FP16-NEXT: ldrh r0, [r4] -; CHECK-FP16-NEXT: vmov s0, r0 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s0, s0 -; CHECK-FP16-NEXT: vmov r0, s0 -; CHECK-FP16-NEXT: bl expf -; CHECK-FP16-NEXT: vmov s0, r0 -; CHECK-FP16-NEXT: vcvtb.f16.f32 s0, s0 -; CHECK-FP16-NEXT: vmov r0, s0 -; CHECK-FP16-NEXT: strh r0, [r4] -; CHECK-FP16-NEXT: pop {r4, pc} +; CHECK-FP16: vcvtb.f32.f16 +; CHECK-FP16: bl expf +; CHECK-FP16: vcvtb.f16.f32 ; CHECK-LIBCALL-LABEL: test_exp: ; CHECK-LIBCALL: bl __gnu_h2f_ieee ; CHECK-LIBCALL: bl expf @@ -733,19 +530,9 @@ define void @test_exp(half* %p) #0 { } ; CHECK-FP16-LABEL: test_exp2: -; CHECK-FP16-NEXT: .fnstart -; CHECK-FP16-NEXT: push {r4, lr} -; CHECK-FP16-NEXT: mov r4, r0 -; CHECK-FP16-NEXT: ldrh r0, [r4] -; CHECK-FP16-NEXT: vmov s0, r0 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s0, s0 -; CHECK-FP16-NEXT: vmov r0, s0 -; CHECK-FP16-NEXT: bl exp2f -; CHECK-FP16-NEXT: vmov s0, r0 -; CHECK-FP16-NEXT: vcvtb.f16.f32 s0, s0 -; CHECK-FP16-NEXT: vmov r0, s0 -; CHECK-FP16-NEXT: strh r0, [r4] -; CHECK-FP16-NEXT: pop {r4, pc} +; CHECK-FP16: vcvtb.f32.f16 +; CHECK-FP16: bl exp2f +; CHECK-FP16: vcvtb.f16.f32 ; CHECK-LIBCALL-LABEL: test_exp2: ; CHECK-LIBCALL: bl __gnu_h2f_ieee ; CHECK-LIBCALL: bl exp2f @@ -758,19 +545,9 @@ define void @test_exp2(half* %p) #0 { } ; CHECK-FP16-LABEL: test_log: -; CHECK-FP16-NEXT: .fnstart -; CHECK-FP16-NEXT: push {r4, lr} -; CHECK-FP16-NEXT: mov r4, r0 -; CHECK-FP16-NEXT: ldrh r0, [r4] -; CHECK-FP16-NEXT: vmov s0, r0 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s0, s0 -; CHECK-FP16-NEXT: vmov r0, s0 -; CHECK-FP16-NEXT: bl logf -; CHECK-FP16-NEXT: vmov s0, r0 -; CHECK-FP16-NEXT: vcvtb.f16.f32 s0, s0 -; CHECK-FP16-NEXT: vmov r0, s0 -; CHECK-FP16-NEXT: strh r0, [r4] -; CHECK-FP16-NEXT: pop {r4, pc} +; CHECK-FP16: vcvtb.f32.f16 +; CHECK-FP16: bl logf +; CHECK-FP16: vcvtb.f16.f32 ; CHECK-LIBCALL-LABEL: test_log: ; CHECK-LIBCALL: bl __gnu_h2f_ieee ; CHECK-LIBCALL: bl logf @@ -783,19 +560,9 @@ define void @test_log(half* %p) #0 { } ; CHECK-FP16-LABEL: test_log10: -; CHECK-FP16-NEXT: .fnstart -; CHECK-FP16-NEXT: push {r4, lr} -; CHECK-FP16-NEXT: mov r4, r0 -; CHECK-FP16-NEXT: ldrh r0, [r4] -; CHECK-FP16-NEXT: vmov s0, r0 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s0, s0 -; CHECK-FP16-NEXT: vmov r0, s0 -; CHECK-FP16-NEXT: bl log10f -; CHECK-FP16-NEXT: vmov s0, r0 -; CHECK-FP16-NEXT: vcvtb.f16.f32 s0, s0 -; CHECK-FP16-NEXT: vmov r0, s0 -; CHECK-FP16-NEXT: strh r0, [r4] -; CHECK-FP16-NEXT: pop {r4, pc} +; CHECK-FP16: vcvtb.f32.f16 +; CHECK-FP16: bl log10f +; CHECK-FP16: vcvtb.f16.f32 ; CHECK-LIBCALL-LABEL: test_log10: ; CHECK-LIBCALL: bl __gnu_h2f_ieee ; CHECK-LIBCALL: bl log10f @@ -808,19 +575,9 @@ define void @test_log10(half* %p) #0 { } ; CHECK-FP16-LABEL: test_log2: -; CHECK-FP16-NEXT: .fnstart -; CHECK-FP16-NEXT: push {r4, lr} -; CHECK-FP16-NEXT: mov r4, r0 -; CHECK-FP16-NEXT: ldrh r0, [r4] -; CHECK-FP16-NEXT: vmov s0, r0 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s0, s0 -; CHECK-FP16-NEXT: vmov r0, s0 -; CHECK-FP16-NEXT: bl log2f -; CHECK-FP16-NEXT: vmov s0, r0 -; CHECK-FP16-NEXT: vcvtb.f16.f32 s0, s0 -; CHECK-FP16-NEXT: vmov r0, s0 -; CHECK-FP16-NEXT: strh r0, [r4] -; CHECK-FP16-NEXT: pop {r4, pc} +; CHECK-FP16: vcvtb.f32.f16 +; CHECK-FP16: bl log2f +; CHECK-FP16: vcvtb.f16.f32 ; CHECK-LIBCALL-LABEL: test_log2: ; CHECK-LIBCALL: bl __gnu_h2f_ieee ; CHECK-LIBCALL: bl log2f @@ -833,27 +590,11 @@ define void @test_log2(half* %p) #0 { } ; CHECK-FP16-LABEL: test_fma: -; CHECK-FP16-NEXT: .fnstart -; CHECK-FP16-NEXT: push {r4, lr} -; CHECK-FP16-NEXT: mov r4, r0 -; CHECK-FP16-NEXT: ldrh r0, [r2] -; CHECK-FP16-NEXT: ldrh r1, [r1] -; CHECK-FP16-NEXT: ldrh r2, [r4] -; CHECK-FP16-NEXT: vmov s2, r1 -; CHECK-FP16-NEXT: vmov s4, r0 -; CHECK-FP16-NEXT: vmov s0, r2 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s0, s0 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s2, s2 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s4, s4 -; CHECK-FP16-NEXT: vmov r0, s0 -; CHECK-FP16-NEXT: vmov r1, s2 -; CHECK-FP16-NEXT: vmov r2, s4 -; CHECK-FP16-NEXT: bl fmaf -; CHECK-FP16-NEXT: vmov s0, r0 -; CHECK-FP16-NEXT: vcvtb.f16.f32 s0, s0 -; CHECK-FP16-NEXT: vmov r0, s0 -; CHECK-FP16-NEXT: strh r0, [r4] -; CHECK-FP16-NEXT: pop {r4, pc} +; CHECK-FP16: vcvtb.f32.f16 +; CHECK-FP16: vcvtb.f32.f16 +; CHECK-FP16: vcvtb.f32.f16 +; CHECK-FP16: bl fmaf +; CHECK-FP16: vcvtb.f16.f32 ; CHECK-LIBCALL-LABEL: test_fma: ; CHECK-LIBCALL: bl __gnu_h2f_ieee ; CHECK-LIBCALL: bl __gnu_h2f_ieee @@ -870,15 +611,9 @@ define void @test_fma(half* %p, half* %q, half* %r) #0 { } ; CHECK-FP16-LABEL: test_fabs: -; CHECK-FP16-NEXT: .fnstart -; CHECK-FP16-NEXT: ldrh r1, [r0] -; CHECK-FP16-NEXT: vmov s0, r1 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s0, s0 -; CHECK-FP16-NEXT: vabs.f32 s0, s0 -; CHECK-FP16-NEXT: vcvtb.f16.f32 s0, s0 -; CHECK-FP16-NEXT: vmov r1, s0 -; CHECK-FP16-NEXT: strh r1, [r0] -; CHECK-FP16-NEXT: bx lr +; CHECK-FP16: vcvtb.f32.f16 +; CHECK-FP16: vabs.f32 +; CHECK-FP16: vcvtb.f16.f32 ; CHECK-LIBCALL-LABEL: test_fabs: ; CHECK-LIBCALL: bl __gnu_h2f_ieee ; CHECK-LIBCALL: bfc @@ -891,23 +626,10 @@ define void @test_fabs(half* %p) { } ; CHECK-FP16-LABEL: test_minnum: -; CHECK-FP16-NEXT: .fnstart -; CHECK-FP16-NEXT: push {r4, lr} -; CHECK-FP16-NEXT: mov r4, r0 -; CHECK-FP16-NEXT: ldrh r0, [r1] -; CHECK-FP16-NEXT: ldrh r1, [r4] -; CHECK-FP16-NEXT: vmov s2, r0 -; CHECK-FP16-NEXT: vmov s0, r1 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s0, s0 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s2, s2 -; CHECK-FP16-NEXT: vmov r0, s0 -; CHECK-FP16-NEXT: vmov r1, s2 -; CHECK-FP16-NEXT: bl fminf -; CHECK-FP16-NEXT: vmov s0, r0 -; CHECK-FP16-NEXT: vcvtb.f16.f32 s0, s0 -; CHECK-FP16-NEXT: vmov r0, s0 -; CHECK-FP16-NEXT: strh r0, [r4] -; CHECK-FP16-NEXT: pop {r4, pc} +; CHECK-FP16: vcvtb.f32.f16 +; CHECK-FP16: vcvtb.f32.f16 +; CHECK-FP16: bl fminf +; CHECK-FP16: vcvtb.f16.f32 ; CHECK-LIBCALL-LABEL: test_minnum: ; CHECK-LIBCALL: bl __gnu_h2f_ieee ; CHECK-LIBCALL: bl __gnu_h2f_ieee @@ -922,23 +644,10 @@ define void @test_minnum(half* %p, half* %q) #0 { } ; CHECK-FP16-LABEL: test_maxnum: -; CHECK-FP16-NEXT: .fnstart -; CHECK-FP16-NEXT: push {r4, lr} -; CHECK-FP16-NEXT: mov r4, r0 -; CHECK-FP16-NEXT: ldrh r0, [r1] -; CHECK-FP16-NEXT: ldrh r1, [r4] -; CHECK-FP16-NEXT: vmov s2, r0 -; CHECK-FP16-NEXT: vmov s0, r1 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s0, s0 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s2, s2 -; CHECK-FP16-NEXT: vmov r0, s0 -; CHECK-FP16-NEXT: vmov r1, s2 -; CHECK-FP16-NEXT: bl fmaxf -; CHECK-FP16-NEXT: vmov s0, r0 -; CHECK-FP16-NEXT: vcvtb.f16.f32 s0, s0 -; CHECK-FP16-NEXT: vmov r0, s0 -; CHECK-FP16-NEXT: strh r0, [r4] -; CHECK-FP16-NEXT: pop {r4, pc} +; CHECK-FP16: vcvtb.f32.f16 +; CHECK-FP16: vcvtb.f32.f16 +; CHECK-FP16: bl fmaxf +; CHECK-FP16: vcvtb.f16.f32 ; CHECK-LIBCALL-LABEL: test_maxnum: ; CHECK-LIBCALL: bl __gnu_h2f_ieee ; CHECK-LIBCALL: bl __gnu_h2f_ieee @@ -953,19 +662,10 @@ define void @test_maxnum(half* %p, half* %q) #0 { } ; CHECK-FP16-LABEL: test_copysign: -; CHECK-FP16-NEXT: .fnstart -; CHECK-FP16-NEXT: ldrh r1, [r1] -; CHECK-FP16-NEXT: ldrh r2, [r0] -; CHECK-FP16-NEXT: vmov.i32 d2, #0x80000000 -; CHECK-FP16-NEXT: vmov s0, r2 -; CHECK-FP16-NEXT: vmov s2, r1 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s0, s0 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s2, s2 -; CHECK-FP16-NEXT: vbsl d2, d1, d0 -; CHECK-FP16-NEXT: vcvtb.f16.f32 s0, s4 -; CHECK-FP16-NEXT: vmov r1, s0 -; CHECK-FP16-NEXT: strh r1, [r0] -; CHECK-FP16-NEXT: bx lr +; CHECK-FP16: vcvtb.f32.f16 +; CHECK-FP16: vcvtb.f32.f16 +; CHECK-FP16: vbsl +; CHECK-FP16: vcvtb.f16.f32 ; CHECK-LIBCALL-LABEL: test_copysign: ; CHECK-LIBCALL: bl __gnu_h2f_ieee ; CHECK-LIBCALL: bl __gnu_h2f_ieee @@ -980,19 +680,9 @@ define void @test_copysign(half* %p, half* %q) #0 { } ; CHECK-FP16-LABEL: test_floor: -; CHECK-FP16-NEXT: .fnstart -; CHECK-FP16-NEXT: push {r4, lr} -; CHECK-FP16-NEXT: mov r4, r0 -; CHECK-FP16-NEXT: ldrh r0, [r4] -; CHECK-FP16-NEXT: vmov s0, r0 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s0, s0 -; CHECK-FP16-NEXT: vmov r0, s0 -; CHECK-FP16-NEXT: bl floorf -; CHECK-FP16-NEXT: vmov s0, r0 -; CHECK-FP16-NEXT: vcvtb.f16.f32 s0, s0 -; CHECK-FP16-NEXT: vmov r0, s0 -; CHECK-FP16-NEXT: strh r0, [r4] -; CHECK-FP16-NEXT: pop {r4, pc} +; CHECK-FP16: vcvtb.f32.f16 +; CHECK-FP16: bl floorf +; CHECK-FP16: vcvtb.f16.f32 ; CHECK-LIBCALL-LABEL: test_floor: ; CHECK-LIBCALL: bl __gnu_h2f_ieee ; CHECK-LIBCALL: bl floorf @@ -1005,19 +695,9 @@ define void @test_floor(half* %p) { } ; CHECK-FP16-LABEL: test_ceil: -; CHECK-FP16-NEXT: .fnstart -; CHECK-FP16-NEXT: push {r4, lr} -; CHECK-FP16-NEXT: mov r4, r0 -; CHECK-FP16-NEXT: ldrh r0, [r4] -; CHECK-FP16-NEXT: vmov s0, r0 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s0, s0 -; CHECK-FP16-NEXT: vmov r0, s0 -; CHECK-FP16-NEXT: bl ceilf -; CHECK-FP16-NEXT: vmov s0, r0 -; CHECK-FP16-NEXT: vcvtb.f16.f32 s0, s0 -; CHECK-FP16-NEXT: vmov r0, s0 -; CHECK-FP16-NEXT: strh r0, [r4] -; CHECK-FP16-NEXT: pop {r4, pc} +; CHECK-FP16: vcvtb.f32.f16 +; CHECK-FP16: bl ceilf +; CHECK-FP16: vcvtb.f16.f32 ; CHECK-LIBCALL-LABEL: test_ceil: ; CHECK-LIBCALL: bl __gnu_h2f_ieee ; CHECK-LIBCALL: bl ceilf @@ -1030,19 +710,9 @@ define void @test_ceil(half* %p) { } ; CHECK-FP16-LABEL: test_trunc: -; CHECK-FP16-NEXT: .fnstart -; CHECK-FP16-NEXT: push {r4, lr} -; CHECK-FP16-NEXT: mov r4, r0 -; CHECK-FP16-NEXT: ldrh r0, [r4] -; CHECK-FP16-NEXT: vmov s0, r0 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s0, s0 -; CHECK-FP16-NEXT: vmov r0, s0 -; CHECK-FP16-NEXT: bl truncf -; CHECK-FP16-NEXT: vmov s0, r0 -; CHECK-FP16-NEXT: vcvtb.f16.f32 s0, s0 -; CHECK-FP16-NEXT: vmov r0, s0 -; CHECK-FP16-NEXT: strh r0, [r4] -; CHECK-FP16-NEXT: pop {r4, pc} +; CHECK-FP16: vcvtb.f32.f16 +; CHECK-FP16: bl truncf +; CHECK-FP16: vcvtb.f16.f32 ; CHECK-LIBCALL-LABEL: test_trunc: ; CHECK-LIBCALL: bl __gnu_h2f_ieee ; CHECK-LIBCALL: bl truncf @@ -1055,19 +725,9 @@ define void @test_trunc(half* %p) { } ; CHECK-FP16-LABEL: test_rint: -; CHECK-FP16-NEXT: .fnstart -; CHECK-FP16-NEXT: push {r4, lr} -; CHECK-FP16-NEXT: mov r4, r0 -; CHECK-FP16-NEXT: ldrh r0, [r4] -; CHECK-FP16-NEXT: vmov s0, r0 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s0, s0 -; CHECK-FP16-NEXT: vmov r0, s0 -; CHECK-FP16-NEXT: bl rintf -; CHECK-FP16-NEXT: vmov s0, r0 -; CHECK-FP16-NEXT: vcvtb.f16.f32 s0, s0 -; CHECK-FP16-NEXT: vmov r0, s0 -; CHECK-FP16-NEXT: strh r0, [r4] -; CHECK-FP16-NEXT: pop {r4, pc} +; CHECK-FP16: vcvtb.f32.f16 +; CHECK-FP16: bl rintf +; CHECK-FP16: vcvtb.f16.f32 ; CHECK-LIBCALL-LABEL: test_rint: ; CHECK-LIBCALL: bl __gnu_h2f_ieee ; CHECK-LIBCALL: bl rintf @@ -1080,19 +740,9 @@ define void @test_rint(half* %p) { } ; CHECK-FP16-LABEL: test_nearbyint: -; CHECK-FP16-NEXT: .fnstart -; CHECK-FP16-NEXT: push {r4, lr} -; CHECK-FP16-NEXT: mov r4, r0 -; CHECK-FP16-NEXT: ldrh r0, [r4] -; CHECK-FP16-NEXT: vmov s0, r0 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s0, s0 -; CHECK-FP16-NEXT: vmov r0, s0 -; CHECK-FP16-NEXT: bl nearbyintf -; CHECK-FP16-NEXT: vmov s0, r0 -; CHECK-FP16-NEXT: vcvtb.f16.f32 s0, s0 -; CHECK-FP16-NEXT: vmov r0, s0 -; CHECK-FP16-NEXT: strh r0, [r4] -; CHECK-FP16-NEXT: pop {r4, pc} +; CHECK-FP16: vcvtb.f32.f16 +; CHECK-FP16: bl nearbyintf +; CHECK-FP16: vcvtb.f16.f32 ; CHECK-LIBCALL-LABEL: test_nearbyint: ; CHECK-LIBCALL: bl __gnu_h2f_ieee ; CHECK-LIBCALL: bl nearbyintf @@ -1105,19 +755,9 @@ define void @test_nearbyint(half* %p) { } ; CHECK-FP16-LABEL: test_round: -; CHECK-FP16-NEXT: .fnstart -; CHECK-FP16-NEXT: push {r4, lr} -; CHECK-FP16-NEXT: mov r4, r0 -; CHECK-FP16-NEXT: ldrh r0, [r4] -; CHECK-FP16-NEXT: vmov s0, r0 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s0, s0 -; CHECK-FP16-NEXT: vmov r0, s0 -; CHECK-FP16-NEXT: bl roundf -; CHECK-FP16-NEXT: vmov s0, r0 -; CHECK-FP16-NEXT: vcvtb.f16.f32 s0, s0 -; CHECK-FP16-NEXT: vmov r0, s0 -; CHECK-FP16-NEXT: strh r0, [r4] -; CHECK-FP16-NEXT: pop {r4, pc} +; CHECK-FP16: vcvtb.f32.f16 +; CHECK-FP16: bl roundf +; CHECK-FP16: vcvtb.f16.f32 ; CHECK-LIBCALL-LABEL: test_round: ; CHECK-LIBCALL: bl __gnu_h2f_ieee ; CHECK-LIBCALL: bl roundf @@ -1130,21 +770,11 @@ define void @test_round(half* %p) { } ; CHECK-FP16-LABEL: test_fmuladd: -; CHECK-FP16-NEXT: .fnstart -; CHECK-FP16-NEXT: ldrh r2, [r2] -; CHECK-FP16-NEXT: ldrh r3, [r0] -; CHECK-FP16-NEXT: ldrh r1, [r1] -; CHECK-FP16-NEXT: vmov s0, r1 -; CHECK-FP16-NEXT: vmov s2, r3 -; CHECK-FP16-NEXT: vmov s4, r2 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s0, s0 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s2, s2 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s4, s4 -; CHECK-FP16-NEXT: vmla.f32 s4, s2, s0 -; CHECK-FP16-NEXT: vcvtb.f16.f32 s0, s4 -; CHECK-FP16-NEXT: vmov r1, s0 -; CHECK-FP16-NEXT: strh r1, [r0] -; CHECK-FP16-NEXT: bx lr +; CHECK-FP16: vcvtb.f32.f16 +; CHECK-FP16: vcvtb.f32.f16 +; CHECK-FP16: vcvtb.f32.f16 +; CHECK-FP16: vmla.f32 +; CHECK-FP16: vcvtb.f16.f32 ; CHECK-LIBCALL-LABEL: test_fmuladd: ; CHECK-LIBCALL: bl __gnu_h2f_ieee ; CHECK-LIBCALL: bl __gnu_h2f_ieee @@ -1167,26 +797,26 @@ define void @test_fmuladd(half* %p, half* %q, half* %r) #0 { ; CHECK-ALL-LABEL: test_insertelement: ; CHECK-ALL-NEXT: .fnstart ; CHECK-ALL-NEXT: sub sp, sp, #8 -; CHECK-ALL-NEXT: ldrh r3, [r1, #6] -; CHECK-ALL-NEXT: strh r3, [sp, #6] -; CHECK-ALL-NEXT: ldrh r3, [r1, #4] -; CHECK-ALL-NEXT: strh r3, [sp, #4] -; CHECK-ALL-NEXT: ldrh r3, [r1, #2] -; CHECK-ALL-NEXT: strh r3, [sp, #2] -; CHECK-ALL-NEXT: ldrh r3, [r1] -; CHECK-ALL-NEXT: strh r3, [sp] -; CHECK-ALL-NEXT: mov r3, sp -; CHECK-ALL-NEXT: ldrh r0, [r0] -; CHECK-ALL-NEXT: add r2, r3, r2, lsl #1 -; CHECK-ALL-NEXT: strh r0, [r2] -; CHECK-ALL-NEXT: ldrh r0, [sp, #6] -; CHECK-ALL-NEXT: strh r0, [r1, #6] -; CHECK-ALL-NEXT: ldrh r0, [sp, #4] -; CHECK-ALL-NEXT: strh r0, [r1, #4] -; CHECK-ALL-NEXT: ldrh r0, [sp, #2] -; CHECK-ALL-NEXT: strh r0, [r1, #2] -; CHECK-ALL-NEXT: ldrh r0, [sp] -; CHECK-ALL-NEXT: strh r0, [r1] +; CHECK-ALL-NEXT: ldrh +; CHECK-ALL-NEXT: strh +; CHECK-ALL-NEXT: ldrh +; CHECK-ALL-NEXT: strh +; CHECK-ALL-NEXT: ldrh +; CHECK-ALL-NEXT: strh +; CHECK-ALL-NEXT: ldrh +; CHECK-ALL-NEXT: strh +; CHECK-ALL-NEXT: mov +; CHECK-ALL-NEXT: ldrh +; CHECK-ALL-NEXT: add +; CHECK-ALL-NEXT: strh +; CHECK-ALL-NEXT: ldrh +; CHECK-ALL-NEXT: strh +; CHECK-ALL-NEXT: ldrh +; CHECK-ALL-NEXT: strh +; CHECK-ALL-NEXT: ldrh +; CHECK-ALL-NEXT: strh +; CHECK-ALL-NEXT: ldrh +; CHECK-ALL-NEXT: strh ; CHECK-ALL-NEXT: add sp, sp, #8 ; CHECK-ALL-NEXT: bx lr define void @test_insertelement(half* %p, <4 x half>* %q, i32 %i) #0 { @@ -1200,18 +830,18 @@ define void @test_insertelement(half* %p, <4 x half>* %q, i32 %i) #0 { ; CHECK-ALL-LABEL: test_extractelement: ; CHECK-ALL-NEXT: .fnstart ; CHECK-ALL-NEXT: sub sp, sp, #8 -; CHECK-ALL-NEXT: ldrh r12, [r1, #2] -; CHECK-ALL-NEXT: ldrh r3, [r1] -; CHECK-ALL-NEXT: orr r3, r3, r12, lsl #16 -; CHECK-ALL-NEXT: str r3, [sp] -; CHECK-ALL-NEXT: ldrh r3, [r1, #6] -; CHECK-ALL-NEXT: ldrh r1, [r1, #4] -; CHECK-ALL-NEXT: orr r1, r1, r3, lsl #16 -; CHECK-ALL-NEXT: str r1, [sp, #4] -; CHECK-ALL-NEXT: mov r1, sp -; CHECK-ALL-NEXT: add r1, r1, r2, lsl #1 -; CHECK-ALL-NEXT: ldrh r1, [r1] -; CHECK-ALL-NEXT: strh r1, [r0] +; CHECK-ALL-NEXT: ldrh +; CHECK-ALL-NEXT: ldrh +; CHECK-ALL-NEXT: orr +; CHECK-ALL-NEXT: str +; CHECK-ALL-NEXT: ldrh +; CHECK-ALL-NEXT: ldrh +; CHECK-ALL-NEXT: orr +; CHECK-ALL-NEXT: str +; CHECK-ALL-NEXT: mov +; CHECK-ALL-NEXT: add +; CHECK-ALL-NEXT: ldrh +; CHECK-ALL-NEXT: strh ; CHECK-ALL-NEXT: add sp, sp, #8 ; CHECK-ALL-NEXT: bx lr define void @test_extractelement(half* %p, <4 x half>* %q, i32 %i) #0 { @@ -1227,10 +857,10 @@ define void @test_extractelement(half* %p, <4 x half>* %q, i32 %i) #0 { ; CHECK-ALL-LABEL: test_insertvalue: ; CHECK-ALL-NEXT: .fnstart -; CHECK-ALL-NEXT: ldr r2, [r0] -; CHECK-ALL-NEXT: ldrh r1, [r1] -; CHECK-ALL-NEXT: strh r1, [r0, #4] -; CHECK-ALL-NEXT: str r2, [r0] +; CHECK-ALL-NEXT: ldr +; CHECK-ALL-NEXT: ldrh +; CHECK-ALL-NEXT: strh +; CHECK-ALL-NEXT: str ; CHECK-ALL-NEXT: bx lr define void @test_insertvalue(%struct.dummy* %p, half* %q) { %a = load %struct.dummy, %struct.dummy* %p @@ -1242,8 +872,8 @@ define void @test_insertvalue(%struct.dummy* %p, half* %q) { ; CHECK-ALL-LABEL: test_extractvalue: ; CHECK-ALL-NEXT: .fnstart -; CHECK-ALL-NEXT: ldrh r0, [r0, #4] -; CHECK-ALL-NEXT: strh r0, [r1] +; CHECK-ALL-NEXT: ldrh +; CHECK-ALL-NEXT: strh ; CHECK-ALL-NEXT: bx lr define void @test_extractvalue(%struct.dummy* %p, half* %q) { %a = load %struct.dummy, %struct.dummy* %p @@ -1253,23 +883,9 @@ define void @test_extractvalue(%struct.dummy* %p, half* %q) { } ; CHECK-FP16-LABEL: test_struct_return: -; CHECK-FP16-NEXT: .fnstart -; CHECK-FP16-NEXT: ldr r2, [r0] -; CHECK-FP16-NEXT: ldrh r0, [r0, #4] -; CHECK-FP16-NEXT: vmov s0, r0 -; CHECK-FP16-NEXT: mov r0, r2 -; CHECK-FP16-NEXT: vcvtb.f32.f16 s0, s0 -; CHECK-FP16-NEXT: vmov r1, s0 -; CHECK-FP16-NEXT: bx lr +; CHECK-FP16: vcvtb.f32.f16 ; CHECK-LIBCALL-LABEL: test_struct_return: -; CHECK-LIBCALL-NEXT: .fnstart -; CHECK-LIBCALL-NEXT: push {r4, lr} -; CHECK-LIBCALL-NEXT: ldr r4, [r0] -; CHECK-LIBCALL-NEXT: ldrh r0, [r0, #4] -; CHECK-LIBCALL-NEXT: bl __gnu_h2f_ieee -; CHECK-LIBCALL-NEXT: mov r1, r0 -; CHECK-LIBCALL-NEXT: mov r0, r4 -; CHECK-LIBCALL-NEXT: pop {r4, pc} +; CHECK-LIBCALL: bl __gnu_h2f_ieee define %struct.dummy @test_struct_return(%struct.dummy* %p) { %a = load %struct.dummy, %struct.dummy* %p ret %struct.dummy %a