File: powf_massv_075_025exp.ll

package info (click to toggle)
llvm-toolchain-14 1%3A14.0.6-12
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,496,180 kB
  • sloc: cpp: 5,593,972; ansic: 986,872; asm: 585,869; python: 184,223; objc: 72,530; lisp: 31,119; f90: 27,793; javascript: 9,780; pascal: 9,762; sh: 9,482; perl: 7,468; ml: 5,432; awk: 3,523; makefile: 2,538; xml: 953; cs: 573; fortran: 567
file content (263 lines) | stat: -rw-r--r-- 10,550 bytes parent folder | download | duplicates (7)
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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
; RUN: llc -vector-library=MASSV < %s -mtriple=powerpc64le-unknown-unknown -mcpu=pwr10 | FileCheck -check-prefixes=CHECK-PWR9 %s
; RUN: llc -vector-library=MASSV < %s -mtriple=powerpc64le-unknown-unknown -mcpu=pwr9 | FileCheck -check-prefixes=CHECK-PWR9 %s
; RUN: llc -vector-library=MASSV < %s -mtriple=powerpc64le-unknown-unknown -mcpu=pwr8 | FileCheck -check-prefixes=CHECK-PWR8 %s
; RUN: llc -vector-library=MASSV < %s -mtriple=powerpc-ibm-aix-xcoff -mcpu=pwr10 | FileCheck -check-prefixes=CHECK-PWR10 %s
; RUN: llc -vector-library=MASSV < %s -mtriple=powerpc-ibm-aix-xcoff -mcpu=pwr9 | FileCheck -check-prefixes=CHECK-PWR9 %s
; RUN: llc -vector-library=MASSV < %s -mtriple=powerpc-ibm-aix-xcoff -mcpu=pwr8 | FileCheck -check-prefixes=CHECK-PWR8 %s
; RUN: llc -vector-library=MASSV < %s -mtriple=powerpc-ibm-aix-xcoff -mcpu=pwr7 | FileCheck -check-prefixes=CHECK-PWR7 %s

; Exponent is a variable
define void @vspow_var(float* nocapture %z, float* nocapture readonly %y, float* nocapture readonly %x)  {
; CHECK-LABEL:       @vspow_var
; CHECK-PWR10:       __powf4_P10
; CHECK-PWR9:        __powf4_P9
; CHECK-PWR8:        __powf4_P8
; CHECK-PWR7:        __powf4_P7
; CHECK:             blr
entry:
  br label %vector.body

vector.body:
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %entry ]
  %next.gep = getelementptr float, float* %z, i64 %index
  %next.gep31 = getelementptr float, float* %y, i64 %index
  %next.gep32 = getelementptr float, float* %x, i64 %index
  %0 = bitcast float* %next.gep32 to <4 x float>*
  %wide.load = load <4 x float>, <4 x float>* %0, align 4
  %1 = bitcast float* %next.gep31 to <4 x float>*
  %wide.load33 = load <4 x float>, <4 x float>* %1, align 4
  %2 = call ninf afn nsz <4 x float> @__powf4(<4 x float> %wide.load, <4 x float> %wide.load33)
  %3 = bitcast float* %next.gep to <4 x float>*
  store <4 x float> %2, <4 x float>* %3, align 4
  %index.next = add i64 %index, 4
  %4 = icmp eq i64 %index.next, 1024
  br i1 %4, label %for.end, label %vector.body

for.end:
  ret void
}

; Exponent is a constant != 0.75 and !=0.25
define void @vspow_const(float* nocapture %y, float* nocapture readonly %x)  {
; CHECK-LABEL:       @vspow_const
; CHECK-PWR10:       __powf4_P10
; CHECK-PWR9:        __powf4_P9
; CHECK-PWR8:        __powf4_P8
; CHECK-PWR7:        __powf4_P7
; CHECK:             blr
entry:
  br label %vector.body

vector.body:
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %entry ]
  %next.gep = getelementptr float, float* %y, i64 %index
  %next.gep19 = getelementptr float, float* %x, i64 %index
  %0 = bitcast float* %next.gep19 to <4 x float>*
  %wide.load = load <4 x float>, <4 x float>* %0, align 4
  %1 = call ninf afn nsz <4 x float> @__powf4(<4 x float> %wide.load, <4 x float> <float 0x3FE851EB80000000, float 0x3FE851EB80000000, float 0x3FE851EB80000000, float 0x3FE851EB80000000>)
  %2 = bitcast float* %next.gep to <4 x float>*
  store <4 x float> %1, <4 x float>* %2, align 4
  %index.next = add i64 %index, 4
  %3 = icmp eq i64 %index.next, 1024
  br i1 %3, label %for.end, label %vector.body

for.end:
  ret void
}

; Exponent is a constant != 0.75 and !=0.25 and they are different 
define void @vspow_neq_const(float* nocapture %y, float* nocapture readonly %x)  {
; CHECK-LABEL:       @vspow_neq_const
; CHECK-PWR10:       __powf4_P10
; CHECK-PWR9:        __powf4_P9
; CHECK-PWR8:        __powf4_P8
; CHECK-PWR7:        __powf4_P7
; CHECK:             blr
entry:
  br label %vector.body

vector.body:
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %entry ]
  %next.gep = getelementptr float, float* %y, i64 %index
  %next.gep19 = getelementptr float, float* %x, i64 %index
  %0 = bitcast float* %next.gep19 to <4 x float>*
  %wide.load = load <4 x float>, <4 x float>* %0, align 4
  %1 = call ninf afn nsz <4 x float> @__powf4(<4 x float> %wide.load, <4 x float> <float 0x3FE861EB80000000, float 0x3FE871EB80000000, float 0x3FE851EB80000000, float 0x3FE851EB80000000>)
  %2 = bitcast float* %next.gep to <4 x float>*
  store <4 x float> %1, <4 x float>* %2, align 4
  %index.next = add i64 %index, 4
  %3 = icmp eq i64 %index.next, 1024
  br i1 %3, label %for.end, label %vector.body

for.end:
  ret void
}

; Exponent is a constant != 0.75 and !=0.25
define void @vspow_neq075_const(float* nocapture %y, float* nocapture readonly %x)  {
; CHECK-LABEL:       @vspow_neq075_const
; CHECK-PWR10:       __powf4_P10
; CHECK-PWR9:        __powf4_P9
; CHECK-PWR8:        __powf4_P8
; CHECK-PWR7:        __powf4_P7
; CHECK:             blr
entry:
  br label %vector.body

vector.body:
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %entry ]
  %next.gep = getelementptr float, float* %y, i64 %index
  %next.gep19 = getelementptr float, float* %x, i64 %index
  %0 = bitcast float* %next.gep19 to <4 x float>*
  %wide.load = load <4 x float>, <4 x float>* %0, align 4
  %1 = call ninf afn nsz <4 x float> @__powf4(<4 x float> %wide.load, <4 x float> <float 7.500000e-01, float 7.500000e-01, float 7.500000e-01, float 0x3FE851EB80000000>)
  %2 = bitcast float* %next.gep to <4 x float>*
  store <4 x float> %1, <4 x float>* %2, align 4
  %index.next = add i64 %index, 4
  %3 = icmp eq i64 %index.next, 1024
  br i1 %3, label %for.end, label %vector.body

for.end:
  ret void
}

; Exponent is a constant != 0.75 and !=0.25
define void @vspow_neq025_const(float* nocapture %y, float* nocapture readonly %x)  {
; CHECK-LABEL:       @vspow_neq025_const
; CHECK-PWR10:       __powf4_P10
; CHECK-PWR9:        __powf4_P9
; CHECK-PWR8:        __powf4_P8
; CHECK-PWR7:        __powf4_P7
; CHECK:             blr
entry:
  br label %vector.body

vector.body:
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %entry ]
  %next.gep = getelementptr float, float* %y, i64 %index
  %next.gep19 = getelementptr float, float* %x, i64 %index
  %0 = bitcast float* %next.gep19 to <4 x float>*
  %wide.load = load <4 x float>, <4 x float>* %0, align 4
  %1 = call ninf afn nsz <4 x float> @__powf4(<4 x float> %wide.load, <4 x float> <float 0x3FE851EB80000000, float 2.500000e-01, float 0x3FE851EB80000000, float 2.500000e-01>)
  %2 = bitcast float* %next.gep to <4 x float>*
  store <4 x float> %1, <4 x float>* %2, align 4
  %index.next = add i64 %index, 4
  %3 = icmp eq i64 %index.next, 1024
  br i1 %3, label %for.end, label %vector.body

for.end:
  ret void
}

; Exponent is 0.75
define void @vspow_075(float* nocapture %y, float* nocapture readonly %x)  {
; CHECK-LABEL:       @vspow_075
; CHECK-NOT:         __powf4_P{{[7,8,9,10]}}
; CHECK:             xvrsqrtesp
; CHECK:             blr
entry:
  br label %vector.body

vector.body:
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %entry ]
  %next.gep = getelementptr float, float* %y, i64 %index
  %next.gep19 = getelementptr float, float* %x, i64 %index
  %0 = bitcast float* %next.gep19 to <4 x float>*
  %wide.load = load <4 x float>, <4 x float>* %0, align 4
  %1 = call ninf afn <4 x float> @__powf4(<4 x float> %wide.load, <4 x float> <float 7.500000e-01, float 7.500000e-01, float 7.500000e-01, float 7.500000e-01>)
  %2 = bitcast float* %next.gep to <4 x float>*
  store <4 x float> %1, <4 x float>* %2, align 4
  %index.next = add i64 %index, 4
  %3 = icmp eq i64 %index.next, 1024
  br i1 %3, label %for.end, label %vector.body

for.end:
  ret void
}

; Exponent is 0.25
define void @vspow_025(float* nocapture %y, float* nocapture readonly %x)  {
; CHECK-LABEL:       @vspow_025
; CHECK-NOT:         __powf4_P{{[7,8,9,10]}}
; CHECK:             xvrsqrtesp
; CHECK:             blr
entry:
  br label %vector.body

vector.body:
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %entry ]
  %next.gep = getelementptr float, float* %y, i64 %index
  %next.gep19 = getelementptr float, float* %x, i64 %index
  %0 = bitcast float* %next.gep19 to <4 x float>*
  %wide.load = load <4 x float>, <4 x float>* %0, align 4
  %1 = call ninf afn nsz <4 x float> @__powf4(<4 x float> %wide.load, <4 x float> <float 2.500000e-01, float 2.500000e-01, float 2.500000e-01, float 2.500000e-01>)
  %2 = bitcast float* %next.gep to <4 x float>*
  store <4 x float> %1, <4 x float>* %2, align 4
  %index.next = add i64 %index, 4
  %3 = icmp eq i64 %index.next, 1024
  br i1 %3, label %for.end, label %vector.body

for.end:
  ret void
}

; Exponent is 0.75 but no proper fast-math flags
define void @vspow_075_nofast(float* nocapture %y, float* nocapture readonly %x)  {
; CHECK-LABEL:       @vspow_075_nofast
; CHECK-PWR10:       __powf4_P10
; CHECK-PWR9:        __powf4_P9
; CHECK-PWR8:        __powf4_P8
; CHECK-PWR7:        __powf4_P7
; CHECK-NOT:         xvrsqrtesp
; CHECK:             blr
entry:
  br label %vector.body

vector.body:
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %entry ]
  %next.gep = getelementptr float, float* %y, i64 %index
  %next.gep19 = getelementptr float, float* %x, i64 %index
  %0 = bitcast float* %next.gep19 to <4 x float>*
  %wide.load = load <4 x float>, <4 x float>* %0, align 4
  %1 = call <4 x float> @__powf4(<4 x float> %wide.load, <4 x float> <float 7.500000e-01, float 7.500000e-01, float 7.500000e-01, float 7.500000e-01>)
  %2 = bitcast float* %next.gep to <4 x float>*
  store <4 x float> %1, <4 x float>* %2, align 4
  %index.next = add i64 %index, 4
  %3 = icmp eq i64 %index.next, 1024
  br i1 %3, label %for.end, label %vector.body

for.end:
  ret void
}

; Exponent is 0.25 but no proper fast-math flags
define void @vspow_025_nofast(float* nocapture %y, float* nocapture readonly %x)  {
; CHECK-LABEL:       @vspow_025_nofast
; CHECK-PWR10:       __powf4_P10
; CHECK-PWR9:        __powf4_P9
; CHECK-PWR8:        __powf4_P8
; CHECK-PWR7:        __powf4_P7
; CHECK-NOT:         xvrsqrtesp
; CHECK:             blr
entry:
  br label %vector.body

vector.body:
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %entry ]
  %next.gep = getelementptr float, float* %y, i64 %index
  %next.gep19 = getelementptr float, float* %x, i64 %index
  %0 = bitcast float* %next.gep19 to <4 x float>*
  %wide.load = load <4 x float>, <4 x float>* %0, align 4
  %1 = call <4 x float> @__powf4(<4 x float> %wide.load, <4 x float> <float 2.500000e-01, float 2.500000e-01, float 2.500000e-01, float 2.500000e-01>)
  %2 = bitcast float* %next.gep to <4 x float>*
  store <4 x float> %1, <4 x float>* %2, align 4
  %index.next = add i64 %index, 4
  %3 = icmp eq i64 %index.next, 1024
  br i1 %3, label %for.end, label %vector.body

for.end:
  ret void
}

; Function Attrs: nounwind readnone speculatable willreturn
declare <4 x float> @__powf4(<4 x float>, <4 x float>)