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 --check-prefixes=CHECK-LE
4; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -O2 \
5; RUN:     -ppc-asm-full-reg-names -mcpu=pwr10 < %s | FileCheck %s \
6; RUN:     --check-prefixes=CHECK-NOPCREL-BE
7; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu -O2 \
8; RUN:     -mattr=-pcrelative-memops -ppc-asm-full-reg-names -mcpu=pwr10 < %s | \
9; RUN:     FileCheck %s --check-prefixes=CHECK-NOPCREL-LE
10; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu -O2 \
11; RUN:     -mattr=-prefix-instrs -ppc-asm-full-reg-names -mcpu=pwr10 < %s | \
12; RUN:     FileCheck %s --check-prefixes=CHECK-NOPREFIX
13; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -O2 \
14; RUN:     -ppc-asm-full-reg-names -target-abi=elfv2 -mcpu=pwr10 < %s | \
15; RUN:     FileCheck %s --check-prefixes=CHECK-BE
16
17define dso_local <2 x double> @testDoubleToDoubleFail() local_unnamed_addr {
18; CHECK-LE-LABEL: testDoubleToDoubleFail:
19; CHECK-LE:       # %bb.0: # %entry
20; CHECK-LE-NEXT:    xxsplti32dx vs34, 0, 1081435463
21; CHECK-LE-NEXT:    xxsplti32dx vs34, 1, -1374389535
22; CHECK-LE-NEXT:    blr
23;
24; CHECK-NOPCREL-BE-LABEL: testDoubleToDoubleFail:
25; CHECK-NOPCREL-BE:       # %bb.0: # %entry
26; CHECK-NOPCREL-BE-NEXT:    xxsplti32dx vs34, 0, 1081435463
27; CHECK-NOPCREL-BE-NEXT:    xxsplti32dx vs34, 1, -1374389535
28; CHECK-NOPCREL-BE-NEXT:    blr
29;
30; CHECK-NOPCREL-LE-LABEL: testDoubleToDoubleFail:
31; CHECK-NOPCREL-LE:       # %bb.0: # %entry
32; CHECK-NOPCREL-LE-NEXT:    xxsplti32dx vs34, 0, 1081435463
33; CHECK-NOPCREL-LE-NEXT:    xxsplti32dx vs34, 1, -1374389535
34; CHECK-NOPCREL-LE-NEXT:    blr
35;
36; CHECK-NOPREFIX-LABEL: testDoubleToDoubleFail:
37; CHECK-NOPREFIX:       # %bb.0: # %entry
38; CHECK-NOPREFIX-NEXT:    addis r3, r2, .LCPI0_0@toc@ha
39; CHECK-NOPREFIX-NEXT:    addi r3, r3, .LCPI0_0@toc@l
40; CHECK-NOPREFIX-NEXT:    lxvx vs34, 0, r3
41; CHECK-NOPREFIX-NEXT:    blr
42;
43; CHECK-BE-LABEL: testDoubleToDoubleFail:
44; CHECK-BE:       # %bb.0: # %entry
45; CHECK-BE-NEXT:    xxsplti32dx vs34, 0, 1081435463
46; CHECK-BE-NEXT:    xxsplti32dx vs34, 1, -1374389535
47; CHECK-BE-NEXT:    blr
48entry:
49  ret <2 x double> <double 3.423300e+02, double 3.423300e+02>
50}
51
52define dso_local <2 x double> @testFloatDenormToDouble() local_unnamed_addr {
53; CHECK-LE-LABEL: testFloatDenormToDouble:
54; CHECK-LE:       # %bb.0: # %entry
55; CHECK-LE-NEXT:    xxsplti32dx vs34, 0, 940259579
56; CHECK-LE-NEXT:    xxsplti32dx vs34, 1, -2147483648
57; CHECK-LE-NEXT:    blr
58;
59; CHECK-NOPCREL-BE-LABEL: testFloatDenormToDouble:
60; CHECK-NOPCREL-BE:       # %bb.0: # %entry
61; CHECK-NOPCREL-BE-NEXT:    xxsplti32dx vs34, 0, 940259579
62; CHECK-NOPCREL-BE-NEXT:    xxsplti32dx vs34, 1, -2147483648
63; CHECK-NOPCREL-BE-NEXT:    blr
64;
65; CHECK-NOPCREL-LE-LABEL: testFloatDenormToDouble:
66; CHECK-NOPCREL-LE:       # %bb.0: # %entry
67; CHECK-NOPCREL-LE-NEXT:    xxsplti32dx vs34, 0, 940259579
68; CHECK-NOPCREL-LE-NEXT:    xxsplti32dx vs34, 1, -2147483648
69; CHECK-NOPCREL-LE-NEXT:    blr
70;
71; CHECK-NOPREFIX-LABEL: testFloatDenormToDouble:
72; CHECK-NOPREFIX:       # %bb.0: # %entry
73; CHECK-NOPREFIX-NEXT:    addis r3, r2, .LCPI1_0@toc@ha
74; CHECK-NOPREFIX-NEXT:    addi r3, r3, .LCPI1_0@toc@l
75; CHECK-NOPREFIX-NEXT:    lxvx vs34, 0, r3
76; CHECK-NOPREFIX-NEXT:    blr
77;
78; CHECK-BE-LABEL: testFloatDenormToDouble:
79; CHECK-BE:       # %bb.0: # %entry
80; CHECK-BE-NEXT:    xxsplti32dx vs34, 0, 940259579
81; CHECK-BE-NEXT:    xxsplti32dx vs34, 1, -2147483648
82; CHECK-BE-NEXT:    blr
83entry:
84  ret <2 x double> <double 0x380B38FB80000000, double 0x380B38FB80000000>
85}
86
87define dso_local <2 x double> @testDoubleToDoubleNaNFail() local_unnamed_addr {
88; CHECK-LE-LABEL: testDoubleToDoubleNaNFail:
89; CHECK-LE:       # %bb.0: # %entry
90; CHECK-LE-NEXT:    xxsplti32dx vs34, 0, -1
91; CHECK-LE-NEXT:    xxsplti32dx vs34, 1, -16
92; CHECK-LE-NEXT:    blr
93;
94; CHECK-NOPCREL-BE-LABEL: testDoubleToDoubleNaNFail:
95; CHECK-NOPCREL-BE:       # %bb.0: # %entry
96; CHECK-NOPCREL-BE-NEXT:    xxsplti32dx vs34, 0, -1
97; CHECK-NOPCREL-BE-NEXT:    xxsplti32dx vs34, 1, -16
98; CHECK-NOPCREL-BE-NEXT:    blr
99;
100; CHECK-NOPCREL-LE-LABEL: testDoubleToDoubleNaNFail:
101; CHECK-NOPCREL-LE:       # %bb.0: # %entry
102; CHECK-NOPCREL-LE-NEXT:    xxsplti32dx vs34, 0, -1
103; CHECK-NOPCREL-LE-NEXT:    xxsplti32dx vs34, 1, -16
104; CHECK-NOPCREL-LE-NEXT:    blr
105;
106; CHECK-NOPREFIX-LABEL: testDoubleToDoubleNaNFail:
107; CHECK-NOPREFIX:       # %bb.0: # %entry
108; CHECK-NOPREFIX-NEXT:    addis r3, r2, .LCPI2_0@toc@ha
109; CHECK-NOPREFIX-NEXT:    addi r3, r3, .LCPI2_0@toc@l
110; CHECK-NOPREFIX-NEXT:    lxvx vs34, 0, r3
111; CHECK-NOPREFIX-NEXT:    blr
112;
113; CHECK-BE-LABEL: testDoubleToDoubleNaNFail:
114; CHECK-BE:       # %bb.0: # %entry
115; CHECK-BE-NEXT:    xxsplti32dx vs34, 0, -1
116; CHECK-BE-NEXT:    xxsplti32dx vs34, 1, -16
117; CHECK-BE-NEXT:    blr
118entry:
119  ret <2 x double> <double 0xFFFFFFFFFFFFFFF0, double 0xFFFFFFFFFFFFFFF0>
120}
121
122define dso_local double @testDoubleNonRepresentableScalar() local_unnamed_addr {
123; CHECK-LE-LABEL: testDoubleNonRepresentableScalar:
124; CHECK-LE:       # %bb.0: # %entry
125; CHECK-LE-NEXT:    plfd f1, .LCPI3_0@PCREL(0), 1
126; CHECK-LE-NEXT:    blr
127;
128; CHECK-NOPCREL-BE-LABEL: testDoubleNonRepresentableScalar:
129; CHECK-NOPCREL-BE:       # %bb.0: # %entry
130; CHECK-NOPCREL-BE-NEXT:    addis r3, r2, .LCPI3_0@toc@ha
131; CHECK-NOPCREL-BE-NEXT:    lfd f1, .LCPI3_0@toc@l(r3)
132; CHECK-NOPCREL-BE-NEXT:    blr
133;
134; CHECK-NOPCREL-LE-LABEL: testDoubleNonRepresentableScalar:
135; CHECK-NOPCREL-LE:       # %bb.0: # %entry
136; CHECK-NOPCREL-LE-NEXT:    addis r3, r2, .LCPI3_0@toc@ha
137; CHECK-NOPCREL-LE-NEXT:    lfd f1, .LCPI3_0@toc@l(r3)
138; CHECK-NOPCREL-LE-NEXT:    blr
139;
140; CHECK-NOPREFIX-LABEL: testDoubleNonRepresentableScalar:
141; CHECK-NOPREFIX:       # %bb.0: # %entry
142; CHECK-NOPREFIX-NEXT:    addis r3, r2, .LCPI3_0@toc@ha
143; CHECK-NOPREFIX-NEXT:    lfd f1, .LCPI3_0@toc@l(r3)
144; CHECK-NOPREFIX-NEXT:    blr
145;
146; CHECK-BE-LABEL: testDoubleNonRepresentableScalar:
147; CHECK-BE:       # %bb.0: # %entry
148; CHECK-BE-NEXT:    plfd f1, .LCPI3_0@PCREL(0), 1
149; CHECK-BE-NEXT:    blr
150entry:
151  ret double 3.423300e+02
152}
153
154define dso_local float @testFloatDenormScalar() local_unnamed_addr {
155; CHECK-LE-LABEL: testFloatDenormScalar:
156; CHECK-LE:       # %bb.0: # %entry
157; CHECK-LE-NEXT:    plfs f1, .LCPI4_0@PCREL(0), 1
158; CHECK-LE-NEXT:    blr
159;
160; CHECK-NOPCREL-BE-LABEL: testFloatDenormScalar:
161; CHECK-NOPCREL-BE:       # %bb.0: # %entry
162; CHECK-NOPCREL-BE-NEXT:    addis r3, r2, .LCPI4_0@toc@ha
163; CHECK-NOPCREL-BE-NEXT:    lfs f1, .LCPI4_0@toc@l(r3)
164; CHECK-NOPCREL-BE-NEXT:    blr
165;
166; CHECK-NOPCREL-LE-LABEL: testFloatDenormScalar:
167; CHECK-NOPCREL-LE:       # %bb.0: # %entry
168; CHECK-NOPCREL-LE-NEXT:    addis r3, r2, .LCPI4_0@toc@ha
169; CHECK-NOPCREL-LE-NEXT:    lfs f1, .LCPI4_0@toc@l(r3)
170; CHECK-NOPCREL-LE-NEXT:    blr
171;
172; CHECK-NOPREFIX-LABEL: testFloatDenormScalar:
173; CHECK-NOPREFIX:       # %bb.0: # %entry
174; CHECK-NOPREFIX-NEXT:    addis r3, r2, .LCPI4_0@toc@ha
175; CHECK-NOPREFIX-NEXT:    lfs f1, .LCPI4_0@toc@l(r3)
176; CHECK-NOPREFIX-NEXT:    blr
177;
178; CHECK-BE-LABEL: testFloatDenormScalar:
179; CHECK-BE:       # %bb.0: # %entry
180; CHECK-BE-NEXT:    plfs f1, .LCPI4_0@PCREL(0), 1
181; CHECK-BE-NEXT:    blr
182entry:
183  ret float 0x380B38FB80000000
184}
185
186define dso_local double @testFloatDenormToDoubleScalar() local_unnamed_addr {
187; CHECK-LE-LABEL: testFloatDenormToDoubleScalar:
188; CHECK-LE:       # %bb.0: # %entry
189; CHECK-LE-NEXT:    plfs f1, .LCPI5_0@PCREL(0), 1
190; CHECK-LE-NEXT:    blr
191;
192; CHECK-NOPCREL-BE-LABEL: testFloatDenormToDoubleScalar:
193; CHECK-NOPCREL-BE:       # %bb.0: # %entry
194; CHECK-NOPCREL-BE-NEXT:    addis r3, r2, .LCPI5_0@toc@ha
195; CHECK-NOPCREL-BE-NEXT:    lfs f1, .LCPI5_0@toc@l(r3)
196; CHECK-NOPCREL-BE-NEXT:    blr
197;
198; CHECK-NOPCREL-LE-LABEL: testFloatDenormToDoubleScalar:
199; CHECK-NOPCREL-LE:       # %bb.0: # %entry
200; CHECK-NOPCREL-LE-NEXT:    addis r3, r2, .LCPI5_0@toc@ha
201; CHECK-NOPCREL-LE-NEXT:    lfs f1, .LCPI5_0@toc@l(r3)
202; CHECK-NOPCREL-LE-NEXT:    blr
203;
204; CHECK-NOPREFIX-LABEL: testFloatDenormToDoubleScalar:
205; CHECK-NOPREFIX:       # %bb.0: # %entry
206; CHECK-NOPREFIX-NEXT:    addis r3, r2, .LCPI5_0@toc@ha
207; CHECK-NOPREFIX-NEXT:    lfs f1, .LCPI5_0@toc@l(r3)
208; CHECK-NOPREFIX-NEXT:    blr
209;
210; CHECK-BE-LABEL: testFloatDenormToDoubleScalar:
211; CHECK-BE:       # %bb.0: # %entry
212; CHECK-BE-NEXT:    plfs f1, .LCPI5_0@PCREL(0), 1
213; CHECK-BE-NEXT:    blr
214entry:
215  ret double 0x380B38FB80000000
216}
217