1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu -O2 \
3 ; RUN: -ppc-asm-full-reg-names -mcpu=pwr10 < %s | FileCheck %s
4 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -O2 \
5 ; RUN: -ppc-asm-full-reg-names -mcpu=pwr10 < %s | FileCheck %s
7 define dso_local <4 x i32> @testZero() local_unnamed_addr {
8 ; CHECK-LABEL: testZero:
9 ; CHECK: # %bb.0: # %entry
10 ; CHECK-NEXT: xxlxor vs34, vs34, vs34
14 ret <4 x i32> zeroinitializer
17 define dso_local <4 x float> @testZeroF() local_unnamed_addr {
18 ; CHECK-LABEL: testZeroF:
19 ; CHECK: # %bb.0: # %entry
20 ; CHECK-NEXT: xxlxor vs34, vs34, vs34
24 ret <4 x float> zeroinitializer
27 define dso_local <4 x i32> @testAllOneS() local_unnamed_addr {
28 ; CHECK-LABEL: testAllOneS:
29 ; CHECK: # %bb.0: # %entry
30 ; CHECK-NEXT: xxleqv vs34, vs34, vs34
34 ret <4 x i32> <i32 -1, i32 -1, i32 -1, i32 -1>
37 define dso_local <4 x i32> @test5Bit() local_unnamed_addr {
38 ; CHECK-LABEL: test5Bit:
39 ; CHECK: # %bb.0: # %entry
40 ; CHECK-NEXT: vspltisw v2, 7
44 ret <4 x i32> <i32 7, i32 7, i32 7, i32 7>
47 define dso_local <16 x i8> @test1ByteChar() local_unnamed_addr {
48 ; CHECK-LABEL: test1ByteChar:
49 ; CHECK: # %bb.0: # %entry
50 ; CHECK-NEXT: xxspltib vs34, 7
54 ret <16 x i8> <i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7>
57 define dso_local <4 x i32> @test1ByteSplatInt() local_unnamed_addr {
58 ; Here the splat of 171 or 0xABABABAB can be done using a byte splat
59 ; of 0xAB using xxspltib while avoiding the use of xxspltiw.
60 ; CHECK-LABEL: test1ByteSplatInt:
61 ; CHECK: # %bb.0: # %entry
62 ; CHECK-NEXT: xxspltib vs34, 171
66 ret <4 x i32> <i32 -1414812757, i32 -1414812757, i32 -1414812757, i32 -1414812757>
69 define dso_local <4 x i32> @test5Bit2Ins() local_unnamed_addr {
70 ; Splats within the range [-32,31] can be done using two vsplti[bhw]
71 ; instructions, but we prefer the xxspltiw instruction to them.
72 ; CHECK-LABEL: test5Bit2Ins:
73 ; CHECK: # %bb.0: # %entry
74 ; CHECK-NEXT: xxspltiw vs34, 16
78 ret <4 x i32> <i32 16, i32 16, i32 16, i32 16>
81 define dso_local <4 x float> @testFloatNegZero() local_unnamed_addr {
82 ; 0.0f is not the same as -0.0f. We try to splat -0.0f
83 ; CHECK-LABEL: testFloatNegZero:
84 ; CHECK: # %bb.0: # %entry
85 ; CHECK-NEXT: xxspltiw vs34, -2147483648
89 ret <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>
92 define dso_local <4 x float> @testFloat() local_unnamed_addr {
93 ; CHECK-LABEL: testFloat:
94 ; CHECK: # %bb.0: # %entry
95 ; CHECK-NEXT: xxspltiw vs34, 1135323709
99 ret <4 x float> <float 0x40757547A0000000, float 0x40757547A0000000, float 0x40757547A0000000, float 0x40757547A0000000>
102 define dso_local <4 x float> @testIntToFloat() local_unnamed_addr {
103 ; CHECK-LABEL: testIntToFloat:
104 ; CHECK: # %bb.0: # %entry
105 ; CHECK-NEXT: xxspltiw vs34, 1135312896
109 ret <4 x float> <float 3.430000e+02, float 3.430000e+02, float 3.430000e+02, float 3.430000e+02>
112 define dso_local <4 x i32> @testUndefInt() local_unnamed_addr {
113 ; CHECK-LABEL: testUndefInt:
114 ; CHECK: # %bb.0: # %entry
115 ; CHECK-NEXT: xxspltiw vs34, 18
119 ret <4 x i32> <i32 18, i32 undef, i32 undef, i32 18>
122 define dso_local <4 x float> @testUndefIntToFloat() local_unnamed_addr {
123 ; CHECK-LABEL: testUndefIntToFloat:
124 ; CHECK: # %bb.0: # %entry
125 ; CHECK-NEXT: xxspltiw vs34, 1135312896
129 ret <4 x float> <float 3.430000e+02, float undef, float undef, float 3.430000e+02>
132 define dso_local <2 x i64> @testPseudo8Byte() local_unnamed_addr {
133 ; CHECK-LABEL: testPseudo8Byte:
134 ; CHECK: # %bb.0: # %entry
135 ; CHECK-NEXT: xxspltiw vs34, -1430532899
139 ret <2 x i64> <i64 -6144092014192636707, i64 -6144092014192636707>
142 define dso_local <8 x i16> @test2Byte() local_unnamed_addr {
143 ; CHECK-LABEL: test2Byte:
144 ; CHECK: # %bb.0: # %entry
145 ; CHECK-NEXT: xxspltiw vs34, 1179666
149 ret <8 x i16> <i16 18, i16 18, i16 18, i16 18, i16 18, i16 18, i16 18, i16 18>
152 define dso_local <8 x i16> @test2ByteUndef() local_unnamed_addr {
153 ; CHECK-LABEL: test2ByteUndef:
154 ; CHECK: # %bb.0: # %entry
155 ; CHECK-NEXT: xxspltiw vs34, 1179666
159 ret <8 x i16> <i16 18, i16 undef, i16 18, i16 18, i16 18, i16 undef, i16 18, i16 18>
162 define dso_local <2 x double> @testFloatToDouble() local_unnamed_addr {
163 ; CHECK-LABEL: testFloatToDouble:
164 ; CHECK: # %bb.0: # %entry
165 ; CHECK-NEXT: xxspltidp vs34, 1135290941
169 ret <2 x double> <double 0x40756547A0000000, double 0x40756547A0000000>
172 define dso_local <2 x double> @testDoubleLower4ByteZero() local_unnamed_addr {
173 ; The expanded double will have 0 in the last 32 bits. Imprecise handling of
174 ; return value of data structures like APInt, returned when calling getZextValue
175 ; , like saving the return value into an unsigned instead of uint64_t may cause
177 ; CHECK-LABEL: testDoubleLower4ByteZero:
178 ; CHECK: # %bb.0: # %entry
179 ; CHECK-NEXT: xxspltidp vs34, 1093664768
183 ret <2 x double> <double 1.100000e+01, double 1.100000e+01>
186 define dso_local <2 x double> @testDoubleToDoubleZero() local_unnamed_addr {
187 ; Should be using canonicalized form to splat zero and use shorter instructions
189 ; CHECK-LABEL: testDoubleToDoubleZero:
190 ; CHECK: # %bb.0: # %entry
191 ; CHECK-NEXT: xxlxor vs34, vs34, vs34
195 ret <2 x double> zeroinitializer
198 define dso_local <2 x double> @testDoubleToDoubleNegZero() local_unnamed_addr {
199 ; CHECK-LABEL: testDoubleToDoubleNegZero:
200 ; CHECK: # %bb.0: # %entry
201 ; CHECK-NEXT: xxspltidp vs34, -2147483648
205 ret <2 x double> <double -0.000000e+00, double -0.000000e+00>
208 define dso_local <2 x double> @testDoubleToDoubleNaN() local_unnamed_addr {
209 ; CHECK-LABEL: testDoubleToDoubleNaN:
210 ; CHECK: # %bb.0: # %entry
211 ; CHECK-NEXT: xxspltidp vs34, -16
215 ret <2 x double> <double 0xFFFFFFFE00000000, double 0xFFFFFFFE00000000>
218 define dso_local <2 x double> @testDoubleToDoubleInfinity() local_unnamed_addr {
219 ; CHECK-LABEL: testDoubleToDoubleInfinity:
220 ; CHECK: # %bb.0: # %entry
221 ; CHECK-NEXT: xxspltidp vs34, 2139095040
225 ret <2 x double> <double 0x7FF0000000000000, double 0x7FF0000000000000>
228 define dso_local <2 x double> @testFloatToDoubleNaN() local_unnamed_addr {
229 ; CHECK-LABEL: testFloatToDoubleNaN:
230 ; CHECK: # %bb.0: # %entry
231 ; CHECK-NEXT: xxspltidp vs34, -1
235 ret <2 x double> <double 0xFFFFFFFFE0000000, double 0xFFFFFFFFE0000000>
238 define dso_local <2 x double> @testFloatToDoubleInfinity() local_unnamed_addr {
239 ; CHECK-LABEL: testFloatToDoubleInfinity:
240 ; CHECK: # %bb.0: # %entry
241 ; CHECK-NEXT: xxspltidp vs34, 2139095040
245 ret <2 x double> <double 0x7FF0000000000000, double 0x7FF0000000000000>
248 define dso_local float @testFloatScalar() local_unnamed_addr {
249 ; CHECK-LABEL: testFloatScalar:
250 ; CHECK: # %bb.0: # %entry
251 ; CHECK-NEXT: xxspltidp vs1, 1135290941
255 ret float 0x40756547A0000000
258 define dso_local float @testFloatZeroScalar() local_unnamed_addr {
259 ; CHECK-LABEL: testFloatZeroScalar:
260 ; CHECK: # %bb.0: # %entry
261 ; CHECK-NEXT: xxlxor f1, f1, f1
265 ret float 0.000000e+00
268 define dso_local double @testDoubleRepresentableScalar() local_unnamed_addr {
269 ; CHECK-LABEL: testDoubleRepresentableScalar:
270 ; CHECK: # %bb.0: # %entry
271 ; CHECK-NEXT: xxspltidp vs1, 1135290941
275 ret double 0x40756547A0000000
278 define dso_local double @testDoubleZeroScalar() local_unnamed_addr {
279 ; CHECK-LABEL: testDoubleZeroScalar:
280 ; CHECK: # %bb.0: # %entry
281 ; CHECK-NEXT: xxlxor f1, f1, f1
285 ret double 0.000000e+00
288 define dso_local <4 x i32> @vec_splati() local_unnamed_addr {
289 ; CHECK-LABEL: vec_splati:
290 ; CHECK: # %bb.0: # %entry
291 ; CHECK-NEXT: xxspltiw vs34, -17
294 ret <4 x i32> <i32 -17, i32 -17, i32 -17, i32 -17>
297 define dso_local <2 x double> @vec_splatid() local_unnamed_addr {
298 ; CHECK-LABEL: vec_splatid:
299 ; CHECK: # %bb.0: # %entry
300 ; CHECK-NEXT: xxspltidp vs34, 1065353216
303 ret <2 x double> <double 1.000000e+00, double 1.000000e+00>