1 ; RUN: llc -mtriple arm-linux-gnueabihf -mattr=+vfp2 -float-abi=hard -global-isel %s -o - | FileCheck %s -check-prefix CHECK -check-prefix HARD
2 ; RUN: llc -mtriple arm-linux-gnueabi -mattr=+vfp2,+soft-float -float-abi=soft -global-isel %s -o - | FileCheck %s -check-prefix CHECK -check-prefix SOFT-AEABI
3 ; RUN: llc -mtriple arm-linux-gnu- -mattr=+vfp2,+soft-float -float-abi=soft -global-isel %s -o - | FileCheck %s -check-prefix CHECK -check-prefix SOFT-DEFAULT
5 define arm_aapcscc float @test_frem_float(float %x, float %y) {
6 ; CHECK-LABEL: test_frem_float:
12 define arm_aapcscc double @test_frem_double(double %x, double %y) {
13 ; CHECK-LABEL: test_frem_double:
15 %r = frem double %x, %y
19 declare float @llvm.pow.f32(float %x, float %y)
20 define arm_aapcscc float @test_fpow_float(float %x, float %y) {
21 ; CHECK-LABEL: test_fpow_float:
23 %r = call float @llvm.pow.f32(float %x, float %y)
27 declare double @llvm.pow.f64(double %x, double %y)
28 define arm_aapcscc double @test_fpow_double(double %x, double %y) {
29 ; CHECK-LABEL: test_fpow_double:
31 %r = call double @llvm.pow.f64(double %x, double %y)
35 define arm_aapcscc float @test_add_float(float %x, float %y) {
36 ; CHECK-LABEL: test_add_float:
38 ; SOFT-AEABI: bl __aeabi_fadd
39 ; SOFT-DEFAULT: bl __addsf3
40 %r = fadd float %x, %y
44 define arm_aapcscc double @test_add_double(double %x, double %y) {
45 ; CHECK-LABEL: test_add_double:
47 ; SOFT-AEABI: bl __aeabi_dadd
48 ; SOFT-DEFAULT: bl __adddf3
49 %r = fadd double %x, %y
53 define arm_aapcscc float @test_sub_float(float %x, float %y) {
54 ; CHECK-LABEL: test_sub_float:
56 ; SOFT-AEABI: bl __aeabi_fsub
57 ; SOFT-DEFAULT: bl __subsf3
58 %r = fsub float %x, %y
62 define arm_aapcscc double @test_sub_double(double %x, double %y) {
63 ; CHECK-LABEL: test_sub_double:
65 ; SOFT-AEABI: bl __aeabi_dsub
66 ; SOFT-DEFAULT: bl __subdf3
67 %r = fsub double %x, %y
70 define arm_aapcs_vfpcc i32 @test_cmp_float_ogt(float %x, float %y) {
71 ; CHECK-LABEL: test_cmp_float_ogt
73 ; HARD: vmrs APSR_nzcv, fpscr
75 ; SOFT-AEABI: bl __aeabi_fcmpgt
76 ; SOFT-DEFAULT: bl __gtsf2
78 %v = fcmp ogt float %x, %y
79 %r = zext i1 %v to i32
83 define arm_aapcs_vfpcc i32 @test_cmp_float_one(float %x, float %y) {
84 ; CHECK-LABEL: test_cmp_float_one
86 ; HARD: vmrs APSR_nzcv, fpscr
90 ; SOFT-AEABI-DAG: bl __aeabi_fcmpgt
91 ; SOFT-AEABI-DAG: bl __aeabi_fcmplt
92 ; SOFT-DEFAULT-DAG: bl __gtsf2
93 ; SOFT-DEFAULT-DAG: bl __ltsf2
95 %v = fcmp one float %x, %y
96 %r = zext i1 %v to i32