select-fp-const.mir
4.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# RUN: llc -O0 -mtriple arm-- -mattr=+vfp3,-neonfp -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK,VFP3
# RUN: llc -O0 -mtriple thumb-- -mattr=+v6t2,+vfp3,-neonfp -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK,VFP3
# RUN: llc -O0 -mtriple arm-- -mattr=+vfp2,-neonfp -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK,VFP2
# RUN: llc -O0 -mtriple thumb-- -mattr=+v6t2,+vfp2,-neonfp -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK,VFP2
--- |
define void @test_fpconst_zero_s32() { ret void }
define void @test_fpconst_zero_s64() { ret void }
define void @test_fpconst_8bit_s32() { ret void }
define void @test_fpconst_8bit_s64() { ret void }
...
---
name: test_fpconst_zero_s32
# CHECK-LABEL: name: test_fpconst_zero_s32
legalized: true
regBankSelected: true
selected: false
# CHECK: selected: true
registers:
- { id: 0, class: gprb }
- { id: 1, class: fprb }
# CHECK: constants:
# CHECK-NEXT: id: 0
# CHECK-NEXT: value: 'float 0.000000e+00'
# CHECK-NEXT: alignment: 4
# CHECK-NEXT: isTargetSpecific: false
body: |
bb.0:
liveins: $r0
%0(p0) = COPY $r0
; CHECK: [[PTR:%[0-9]+]]:gpr = COPY $r0
%1(s32) = G_FCONSTANT float 0.0
; CHECK: [[VREG:%[0-9]+]]:spr = VLDRS %const.0, 0, 14, $noreg :: (load 4 from constant-pool)
G_STORE %1(s32), %0 :: (store 4)
; CHECK: VSTRS [[VREG]], [[PTR]], 0, 14, $noreg
BX_RET 14, $noreg
; CHECK: BX_RET 14, $noreg
...
---
name: test_fpconst_zero_s64
# CHECK-LABEL: name: test_fpconst_zero_s64
legalized: true
regBankSelected: true
selected: false
# CHECK: selected: true
registers:
- { id: 0, class: gprb }
- { id: 1, class: fprb }
# CHECK: constants:
# CHECK-NEXT: id: 0
# CHECK-NEXT: value: 'double 0.000000e+00'
# CHECK-NEXT: alignment: 8
# CHECK-NEXT: isTargetSpecific: false
body: |
bb.0:
liveins: $r0
%0(p0) = COPY $r0
; CHECK: [[PTR:%[0-9]+]]:gpr = COPY $r0
%1(s64) = G_FCONSTANT double 0.0
; CHECK: [[VREG:%[0-9]+]]:dpr = VLDRD %const.0, 0, 14, $noreg :: (load 8 from constant-pool)
G_STORE %1(s64), %0 :: (store 8)
; CHECK: VSTRD [[VREG]], [[PTR]], 0, 14, $noreg
BX_RET 14, $noreg
; CHECK: BX_RET 14, $noreg
...
---
name: test_fpconst_8bit_s32
# CHECK-LABEL: name: test_fpconst_8bit_s32
legalized: true
regBankSelected: true
selected: false
# CHECK: selected: true
registers:
- { id: 0, class: gprb }
- { id: 1, class: fprb }
# VFP3: constants: []
# VFP2: constants:
# VFP2-NEXT: id: 0
# VFP2-NEXT: value: 'float -2.000000e+00'
# VFP2-NEXT: alignment: 4
# VFP2-NEXT: isTargetSpecific: false
body: |
bb.0:
liveins: $r0
%0(p0) = COPY $r0
; CHECK: [[PTR:%[0-9]+]]:gpr = COPY $r0
%1(s32) = G_FCONSTANT float -2.0
; VFP3: [[VREG:%[0-9]+]]:spr = FCONSTS 128, 14, $noreg
; VFP2: [[VREG:%[0-9]+]]:spr = VLDRS %const.0, 0, 14, $noreg :: (load 4 from constant-pool)
G_STORE %1(s32), %0 :: (store 4)
; CHECK: VSTRS [[VREG]], [[PTR]], 0, 14, $noreg
BX_RET 14, $noreg
; CHECK: BX_RET 14, $noreg
...
---
name: test_fpconst_8bit_s64
# CHECK-LABEL: name: test_fpconst_8bit_s64
legalized: true
regBankSelected: true
selected: false
# CHECK: selected: true
registers:
- { id: 0, class: gprb }
- { id: 1, class: fprb }
# VFP3: constants: []
# VFP2: constants:
# VFP2-NEXT: id: 0
# VFP2-NEXT: value: double 5.000000e-01
# VFP2-NEXT: alignment: 8
# VFP2-NEXT: isTargetSpecific: false
body: |
bb.0:
liveins: $r0
%0(p0) = COPY $r0
; CHECK: [[PTR:%[0-9]+]]:gpr = COPY $r0
%1(s64) = G_FCONSTANT double 5.0e-1
; VFP3: [[VREG:%[0-9]+]]:dpr = FCONSTD 96, 14, $noreg
; VFP2: [[VREG:%[0-9]+]]:dpr = VLDRD %const.0, 0, 14, $noreg :: (load 8 from constant-pool)
G_STORE %1(s64), %0 :: (store 8)
; CHECK: VSTRD [[VREG]], [[PTR]], 0, 14, $noreg
BX_RET 14, $noreg
; CHECK: BX_RET 14, $noreg
...