1 ; RUN: llc -mtriple=arm-eabi -mattr=+vfp2 %s -o - \
2 ; RUN: | FileCheck %s -check-prefix=VFP2
4 ; RUN: llc -mtriple=arm-eabi -mattr=+neon,-neonfp %s -o - \
5 ; RUN: | FileCheck %s -check-prefix=NFP0
7 ; RUN: llc -mtriple=arm-eabi -mattr=+neon,+neonfp %s -o - \
8 ; RUN: | FileCheck %s -check-prefix=NFP1
10 ; RUN: llc -mtriple=arm-eabi -mcpu=cortex-a8 %s -o - \
11 ; RUN: | FileCheck %s -check-prefix=CORTEXA8
13 ; RUN: llc -mtriple=arm-eabi -mcpu=cortex-a8 --enable-unsafe-fp-math %s -o - \
14 ; RUN: | FileCheck %s -check-prefix=CORTEXA8U
16 ; RUN: llc -mtriple=arm-darwin -mcpu=cortex-a8 %s -o - \
17 ; RUN: | FileCheck %s -check-prefix=CORTEXA8U
19 ; RUN: llc -mtriple=arm-eabi -mcpu=cortex-a9 %s -o - \
20 ; RUN: | FileCheck %s -check-prefix=CORTEXA9
22 define float @test1(float* %a) {
24 %0 = load float, float* %a, align 4 ; <float> [#uses=2]
25 %1 = fsub float -0.000000e+00, %0 ; <float> [#uses=2]
26 %2 = fpext float %1 to double ; <double> [#uses=1]
27 %3 = fcmp olt double %2, 1.234000e+00 ; <i1> [#uses=1]
28 %retval = select i1 %3, float %1, float %0 ; <float> [#uses=1]
32 ; VFP2: vneg.f32 s{{.*}}, s{{.*}}
35 ; NFP1: vneg.f32 d{{.*}}, d{{.*}}
38 ; NFP0: vneg.f32 s{{.*}}, s{{.*}}
40 ; CORTEXA8-LABEL: test1:
41 ; CORTEXA8: vneg.f32 s{{.*}}, s{{.*}}
43 ; CORTEXA8U-LABEL: test1:
44 ; CORTEXA8U: vneg.f32 d{{.*}}, d{{.*}}
46 ; CORTEXA9-LABEL: test1:
47 ; CORTEXA9: vneg.f32 s{{.*}}, s{{.*}}
49 define float @test2(float* %a) {
51 %0 = load float, float* %a, align 4 ; <float> [#uses=2]
52 %1 = fmul float -1.000000e+00, %0 ; <float> [#uses=2]
53 %2 = fpext float %1 to double ; <double> [#uses=1]
54 %3 = fcmp olt double %2, 1.234000e+00 ; <i1> [#uses=1]
55 %retval = select i1 %3, float %1, float %0 ; <float> [#uses=1]
59 ; VFP2: vneg.f32 s{{.*}}, s{{.*}}
62 ; NFP1: vneg.f32 d{{.*}}, d{{.*}}
65 ; NFP0: vneg.f32 s{{.*}}, s{{.*}}
67 ; CORTEXA8-LABEL: test2:
68 ; CORTEXA8: vneg.f32 s{{.*}}, s{{.*}}
70 ; CORTEXA8U-LABEL: test2:
71 ; CORTEXA8U: vneg.f32 d{{.*}}, d{{.*}}
73 ; CORTEXA9-LABEL: test2:
74 ; CORTEXA9: vneg.f32 s{{.*}}, s{{.*}}
76 ; If we're bitcasting an integer to an FP vector, we should avoid the FP/vector unit entirely.
77 ; Make sure that we're flipping the sign bit and only the sign bit of each float (PR20354).
78 ; So instead of something like this:
84 ; eor r0, r0, #-214783648
85 ; eor r1, r1, #-214783648
87 define <2 x float> @fneg_bitcast(i64 %i) {
88 %bitcast = bitcast i64 %i to <2 x float>
89 %fneg = fsub <2 x float> <float -0.0, float -0.0>, %bitcast
92 ; VFP2-LABEL: fneg_bitcast:
93 ; VFP2-DAG: eor r0, r0, #-2147483648
94 ; VFP2-DAG: eor r1, r1, #-2147483648
97 ; NFP1-LABEL: fneg_bitcast:
98 ; NFP1-DAG: eor r0, r0, #-2147483648
99 ; NFP1-DAG: eor r1, r1, #-2147483648
102 ; NFP0-LABEL: fneg_bitcast:
103 ; NFP0-DAG: eor r0, r0, #-2147483648
104 ; NFP0-DAG: eor r1, r1, #-2147483648
107 ; CORTEXA8-LABEL: fneg_bitcast:
108 ; CORTEXA8-DAG: eor r0, r0, #-2147483648
109 ; CORTEXA8-DAG: eor r1, r1, #-2147483648
110 ; CORTEXA8-NOT: vneg.f32
112 ; CORTEXA8U-LABEL: fneg_bitcast:
113 ; CORTEXA8U-DAG: eor r0, r0, #-2147483648
114 ; CORTEXA8U-DAG: eor r1, r1, #-2147483648
115 ; CORTEXA8U-NOT: vneg.f32
117 ; CORTEXA9-LABEL: fneg_bitcast:
118 ; CORTEXA9-DAG: eor r0, r0, #-2147483648
119 ; CORTEXA9-DAG: eor r1, r1, #-2147483648
120 ; CORTEXA9-NOT: vneg.f32