cde-vfp.ll
6.34 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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
; RUN: llc -mtriple=thumbv8.1m.main -mattr=+cdecp0 -mattr=+cdecp1 -mattr=+mve -verify-machineinstrs -o - %s | FileCheck %s
; RUN: llc -mtriple=thumbv8m.main -mattr=+cdecp0 -mattr=+cdecp1 -mattr=+fp-armv8d16sp -verify-machineinstrs -o - %s | FileCheck %s
declare float @llvm.arm.cde.vcx1.f32(i32 immarg, i32 immarg)
declare float @llvm.arm.cde.vcx1a.f32(i32 immarg, float, i32 immarg)
declare float @llvm.arm.cde.vcx2.f32(i32 immarg, float, i32 immarg)
declare float @llvm.arm.cde.vcx2a.f32(i32 immarg, float, float, i32 immarg)
declare float @llvm.arm.cde.vcx3.f32(i32 immarg, float, float, i32 immarg)
declare float @llvm.arm.cde.vcx3a.f32(i32 immarg, float, float, float, i32 immarg)
declare double @llvm.arm.cde.vcx1.f64(i32 immarg, i32 immarg)
declare double @llvm.arm.cde.vcx1a.f64(i32 immarg, double, i32 immarg)
declare double @llvm.arm.cde.vcx2.f64(i32 immarg, double, i32 immarg)
declare double @llvm.arm.cde.vcx2a.f64(i32 immarg, double, double, i32 immarg)
declare double @llvm.arm.cde.vcx3.f64(i32 immarg, double, double, i32 immarg)
declare double @llvm.arm.cde.vcx3a.f64(i32 immarg, double, double, double, i32 immarg)
define arm_aapcs_vfpcc i32 @test_vcx1_u32() {
; CHECK-LABEL: test_vcx1_u32:
; CHECK: @ %bb.0: @ %entry
; CHECK-NEXT: vcx1 p0, s0, #11
; CHECK-NEXT: vmov r0, s0
; CHECK-NEXT: bx lr
entry:
%0 = call float @llvm.arm.cde.vcx1.f32(i32 0, i32 11)
%1 = bitcast float %0 to i32
ret i32 %1
}
define arm_aapcs_vfpcc i32 @test_vcx1a_u32(i32 %acc) {
; CHECK-LABEL: test_vcx1a_u32:
; CHECK: @ %bb.0: @ %entry
; CHECK-NEXT: vmov s0, r0
; CHECK-NEXT: vcx1a p1, s0, #12
; CHECK-NEXT: vmov r0, s0
; CHECK-NEXT: bx lr
entry:
%0 = bitcast i32 %acc to float
%1 = call float @llvm.arm.cde.vcx1a.f32(i32 1, float %0, i32 12)
%2 = bitcast float %1 to i32
ret i32 %2
}
define arm_aapcs_vfpcc i32 @test_vcx2_u32(i32 %n) {
; CHECK-LABEL: test_vcx2_u32:
; CHECK: @ %bb.0: @ %entry
; CHECK-NEXT: vmov s0, r0
; CHECK-NEXT: vcx2 p0, s0, s0, #21
; CHECK-NEXT: vmov r0, s0
; CHECK-NEXT: bx lr
entry:
%0 = bitcast i32 %n to float
%1 = call float @llvm.arm.cde.vcx2.f32(i32 0, float %0, i32 21)
%2 = bitcast float %1 to i32
ret i32 %2
}
define arm_aapcs_vfpcc i32 @test_vcx2a_u32(i32 %acc, i32 %n) {
; CHECK-LABEL: test_vcx2a_u32:
; CHECK: @ %bb.0: @ %entry
; CHECK-NEXT: vmov s0, r1
; CHECK-NEXT: vmov s2, r0
; CHECK-NEXT: vcx2a p0, s2, s0, #22
; CHECK-NEXT: vmov r0, s2
; CHECK-NEXT: bx lr
entry:
%0 = bitcast i32 %acc to float
%1 = bitcast i32 %n to float
%2 = call float @llvm.arm.cde.vcx2a.f32(i32 0, float %0, float %1, i32 22)
%3 = bitcast float %2 to i32
ret i32 %3
}
define arm_aapcs_vfpcc i32 @test_vcx3_u32(i32 %n, i32 %m) {
; CHECK-LABEL: test_vcx3_u32:
; CHECK: @ %bb.0: @ %entry
; CHECK-NEXT: vmov s0, r1
; CHECK-NEXT: vmov s2, r0
; CHECK-NEXT: vcx3 p1, s0, s2, s0, #3
; CHECK-NEXT: vmov r0, s0
; CHECK-NEXT: bx lr
entry:
%0 = bitcast i32 %n to float
%1 = bitcast i32 %m to float
%2 = call float @llvm.arm.cde.vcx3.f32(i32 1, float %0, float %1, i32 3)
%3 = bitcast float %2 to i32
ret i32 %3
}
define arm_aapcs_vfpcc i32 @test_vcx3a_u32(i32 %acc, i32 %n, i32 %m) {
; CHECK-LABEL: test_vcx3a_u32:
; CHECK: @ %bb.0: @ %entry
; CHECK-NEXT: vmov s0, r2
; CHECK-NEXT: vmov s2, r1
; CHECK-NEXT: vmov s4, r0
; CHECK-NEXT: vcx3a p0, s4, s2, s0, #5
; CHECK-NEXT: vmov r0, s4
; CHECK-NEXT: bx lr
entry:
%0 = bitcast i32 %acc to float
%1 = bitcast i32 %n to float
%2 = bitcast i32 %m to float
%3 = call float @llvm.arm.cde.vcx3a.f32(i32 0, float %0, float %1, float %2, i32 5)
%4 = bitcast float %3 to i32
ret i32 %4
}
define arm_aapcs_vfpcc i64 @test_vcx1d_u64() {
; CHECK-LABEL: test_vcx1d_u64:
; CHECK: @ %bb.0: @ %entry
; CHECK-NEXT: vcx1 p0, d0, #11
; CHECK-NEXT: vmov r0, r1, d0
; CHECK-NEXT: bx lr
entry:
%0 = call double @llvm.arm.cde.vcx1.f64(i32 0, i32 11)
%1 = bitcast double %0 to i64
ret i64 %1
}
define arm_aapcs_vfpcc i64 @test_vcx1da_u64(i64 %acc) {
; CHECK-LABEL: test_vcx1da_u64:
; CHECK: @ %bb.0: @ %entry
; CHECK-NEXT: vmov d0, r0, r1
; CHECK-NEXT: vcx1a p1, d0, #12
; CHECK-NEXT: vmov r0, r1, d0
; CHECK-NEXT: bx lr
entry:
%0 = bitcast i64 %acc to double
%1 = call double @llvm.arm.cde.vcx1a.f64(i32 1, double %0, i32 12)
%2 = bitcast double %1 to i64
ret i64 %2
}
define arm_aapcs_vfpcc i64 @test_vcx2d_u64(i64 %n) {
; CHECK-LABEL: test_vcx2d_u64:
; CHECK: @ %bb.0: @ %entry
; CHECK-NEXT: vmov d0, r0, r1
; CHECK-NEXT: vcx2 p0, d0, d0, #21
; CHECK-NEXT: vmov r0, r1, d0
; CHECK-NEXT: bx lr
entry:
%0 = bitcast i64 %n to double
%1 = call double @llvm.arm.cde.vcx2.f64(i32 0, double %0, i32 21)
%2 = bitcast double %1 to i64
ret i64 %2
}
define arm_aapcs_vfpcc i64 @test_vcx2da_u64(i64 %acc, i64 %n) {
; CHECK-LABEL: test_vcx2da_u64:
; CHECK: @ %bb.0: @ %entry
; CHECK-NEXT: vmov d0, r2, r3
; CHECK-NEXT: vmov d1, r0, r1
; CHECK-NEXT: vcx2a p0, d1, d0, #22
; CHECK-NEXT: vmov r0, r1, d1
; CHECK-NEXT: bx lr
entry:
%0 = bitcast i64 %acc to double
%1 = bitcast i64 %n to double
%2 = call double @llvm.arm.cde.vcx2a.f64(i32 0, double %0, double %1, i32 22)
%3 = bitcast double %2 to i64
ret i64 %3
}
define arm_aapcs_vfpcc i64 @test_vcx3d_u64(i64 %n, i64 %m) {
; CHECK-LABEL: test_vcx3d_u64:
; CHECK: @ %bb.0: @ %entry
; CHECK-NEXT: vmov d0, r2, r3
; CHECK-NEXT: vmov d1, r0, r1
; CHECK-NEXT: vcx3 p1, d0, d1, d0, #3
; CHECK-NEXT: vmov r0, r1, d0
; CHECK-NEXT: bx lr
entry:
%0 = bitcast i64 %n to double
%1 = bitcast i64 %m to double
%2 = call double @llvm.arm.cde.vcx3.f64(i32 1, double %0, double %1, i32 3)
%3 = bitcast double %2 to i64
ret i64 %3
}
define arm_aapcs_vfpcc i64 @test_vcx3da_u64(i64 %acc, i64 %n, i64 %m) {
; CHECK-LABEL: test_vcx3da_u64:
; CHECK: @ %bb.0: @ %entry
; CHECK-NEXT: push {r7, lr}
; CHECK-NEXT: ldrd lr, r12, [sp, #8]
; CHECK-DAG: vmov [[D0:d.*]], r0, r1
; CHECK-DAG: vmov [[D1:d.*]], r2, r3
; CHECK-DAG: vmov [[D2:d.*]], lr, r12
; CHECK-NEXT: vcx3a p0, [[D0]], [[D1]], [[D2]], #5
; CHECK-NEXT: vmov r0, r1, [[D0]]
; CHECK-NEXT: pop {r7, pc}
entry:
%0 = bitcast i64 %acc to double
%1 = bitcast i64 %n to double
%2 = bitcast i64 %m to double
%3 = call double @llvm.arm.cde.vcx3a.f64(i32 0, double %0, double %1, double %2, i32 5)
%4 = bitcast double %3 to i64
ret i64 %4
}