1 # RUN: llc -O0 -mtriple arm-- -mattr=+vfp3,-neonfp -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK,VFP3
2 # RUN: llc -O0 -mtriple thumb-- -mattr=+v6t2,+vfp3,-neonfp -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK,VFP3
3 # RUN: llc -O0 -mtriple arm-- -mattr=+vfp2,-neonfp -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK,VFP2
4 # RUN: llc -O0 -mtriple thumb-- -mattr=+v6t2,+vfp2,-neonfp -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK,VFP2
6 define void @test_fpconst_zero_s32() { ret void }
7 define void @test_fpconst_zero_s64() { ret void }
9 define void @test_fpconst_8bit_s32() { ret void }
10 define void @test_fpconst_8bit_s64() { ret void }
13 name: test_fpconst_zero_s32
14 # CHECK-LABEL: name: test_fpconst_zero_s32
18 # CHECK: selected: true
20 - { id: 0, class: gprb }
21 - { id: 1, class: fprb }
24 # CHECK-NEXT: value: 'float 0.000000e+00'
25 # CHECK-NEXT: alignment: 4
26 # CHECK-NEXT: isTargetSpecific: false
32 ; CHECK: [[PTR:%[0-9]+]]:gpr = COPY $r0
34 %1(s32) = G_FCONSTANT float 0.0
35 ; CHECK: [[VREG:%[0-9]+]]:spr = VLDRS %const.0, 0, 14 /* CC::al */, $noreg :: (load (s32) from constant-pool)
37 G_STORE %1(s32), %0 :: (store (s32))
38 ; CHECK: VSTRS [[VREG]], [[PTR]], 0, 14 /* CC::al */, $noreg
41 ; CHECK: BX_RET 14 /* CC::al */, $noreg
44 name: test_fpconst_zero_s64
45 # CHECK-LABEL: name: test_fpconst_zero_s64
49 # CHECK: selected: true
51 - { id: 0, class: gprb }
52 - { id: 1, class: fprb }
55 # CHECK-NEXT: value: 'double 0.000000e+00'
56 # CHECK-NEXT: alignment: 8
57 # CHECK-NEXT: isTargetSpecific: false
63 ; CHECK: [[PTR:%[0-9]+]]:gpr = COPY $r0
65 %1(s64) = G_FCONSTANT double 0.0
66 ; CHECK: [[VREG:%[0-9]+]]:dpr = VLDRD %const.0, 0, 14 /* CC::al */, $noreg :: (load (s64) from constant-pool)
68 G_STORE %1(s64), %0 :: (store (s64))
69 ; CHECK: VSTRD [[VREG]], [[PTR]], 0, 14 /* CC::al */, $noreg
72 ; CHECK: BX_RET 14 /* CC::al */, $noreg
75 name: test_fpconst_8bit_s32
76 # CHECK-LABEL: name: test_fpconst_8bit_s32
80 # CHECK: selected: true
82 - { id: 0, class: gprb }
83 - { id: 1, class: fprb }
87 # VFP2-NEXT: value: 'float -2.000000e+00'
88 # VFP2-NEXT: alignment: 4
89 # VFP2-NEXT: isTargetSpecific: false
95 ; CHECK: [[PTR:%[0-9]+]]:gpr = COPY $r0
97 %1(s32) = G_FCONSTANT float -2.0
98 ; VFP3: [[VREG:%[0-9]+]]:spr = FCONSTS 128, 14 /* CC::al */, $noreg
99 ; VFP2: [[VREG:%[0-9]+]]:spr = VLDRS %const.0, 0, 14 /* CC::al */, $noreg :: (load (s32) from constant-pool)
101 G_STORE %1(s32), %0 :: (store (s32))
102 ; CHECK: VSTRS [[VREG]], [[PTR]], 0, 14 /* CC::al */, $noreg
105 ; CHECK: BX_RET 14 /* CC::al */, $noreg
108 name: test_fpconst_8bit_s64
109 # CHECK-LABEL: name: test_fpconst_8bit_s64
111 regBankSelected: true
113 # CHECK: selected: true
115 - { id: 0, class: gprb }
116 - { id: 1, class: fprb }
117 # VFP3: constants: []
120 # VFP2-NEXT: value: double 5.000000e-01
121 # VFP2-NEXT: alignment: 8
122 # VFP2-NEXT: isTargetSpecific: false
128 ; CHECK: [[PTR:%[0-9]+]]:gpr = COPY $r0
130 %1(s64) = G_FCONSTANT double 5.0e-1
131 ; VFP3: [[VREG:%[0-9]+]]:dpr = FCONSTD 96, 14 /* CC::al */, $noreg
132 ; VFP2: [[VREG:%[0-9]+]]:dpr = VLDRD %const.0, 0, 14 /* CC::al */, $noreg :: (load (s64) from constant-pool)
134 G_STORE %1(s64), %0 :: (store (s64))
135 ; CHECK: VSTRD [[VREG]], [[PTR]], 0, 14 /* CC::al */, $noreg
138 ; CHECK: BX_RET 14 /* CC::al */, $noreg