1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
2 // REQUIRES: powerpc-registered-target
3 // RUN: %clang_cc1 -triple powerpc64-unknown-linux-gnu \
4 // RUN: -emit-llvm %s -o - -target-cpu pwr7 | FileCheck %s --check-prefix=64BIT
5 // RUN: %clang_cc1 -triple powerpc64le-unknown-linux-gnu \
6 // RUN: -emit-llvm %s -o - -target-cpu pwr8 | FileCheck %s --check-prefix=64BITLE
7 // RUN: %clang_cc1 -triple powerpc64-unknown-aix \
8 // RUN: -emit-llvm %s -o - -target-cpu pwr7 | FileCheck %s --check-prefix=64BITAIX
9 // RUN: %clang_cc1 -triple powerpc-unknown-linux-gnu \
10 // RUN: -emit-llvm %s -o - -target-cpu pwr7 | FileCheck %s --check-prefix=32BIT
11 // RUN: %clang_cc1 -triple powerpcle-unknown-linux-gnu \
12 // RUN: -emit-llvm %s -o - -target-cpu pwr8 | FileCheck %s --check-prefix=32BITLE
13 // RUN: %clang_cc1 -triple powerpc-unknown-aix \
14 // RUN: -emit-llvm %s -o - -target-cpu pwr7 | FileCheck %s --check-prefix=32BITAIX
16 // 64BIT-LABEL: @testcmplx(
18 // 64BIT-NEXT: [[RETVAL:%.*]] = alloca { double, double }, align 8
19 // 64BIT-NEXT: [[REAL_ADDR:%.*]] = alloca double, align 8
20 // 64BIT-NEXT: [[IMAG_ADDR:%.*]] = alloca double, align 8
21 // 64BIT-NEXT: store double [[REAL:%.*]], ptr [[REAL_ADDR]], align 8
22 // 64BIT-NEXT: store double [[IMAG:%.*]], ptr [[IMAG_ADDR]], align 8
23 // 64BIT-NEXT: [[TMP0:%.*]] = load double, ptr [[REAL_ADDR]], align 8
24 // 64BIT-NEXT: [[TMP1:%.*]] = load double, ptr [[IMAG_ADDR]], align 8
25 // 64BIT-NEXT: [[RETVAL_REALP:%.*]] = getelementptr inbounds { double, double }, ptr [[RETVAL]], i32 0, i32 0
26 // 64BIT-NEXT: [[RETVAL_IMAGP:%.*]] = getelementptr inbounds { double, double }, ptr [[RETVAL]], i32 0, i32 1
27 // 64BIT-NEXT: store double [[TMP0]], ptr [[RETVAL_REALP]], align 8
28 // 64BIT-NEXT: store double [[TMP1]], ptr [[RETVAL_IMAGP]], align 8
29 // 64BIT-NEXT: [[TMP2:%.*]] = load { double, double }, ptr [[RETVAL]], align 8
30 // 64BIT-NEXT: ret { double, double } [[TMP2]]
32 // 64BITLE-LABEL: @testcmplx(
33 // 64BITLE-NEXT: entry:
34 // 64BITLE-NEXT: [[RETVAL:%.*]] = alloca { double, double }, align 8
35 // 64BITLE-NEXT: [[REAL_ADDR:%.*]] = alloca double, align 8
36 // 64BITLE-NEXT: [[IMAG_ADDR:%.*]] = alloca double, align 8
37 // 64BITLE-NEXT: store double [[REAL:%.*]], ptr [[REAL_ADDR]], align 8
38 // 64BITLE-NEXT: store double [[IMAG:%.*]], ptr [[IMAG_ADDR]], align 8
39 // 64BITLE-NEXT: [[TMP0:%.*]] = load double, ptr [[REAL_ADDR]], align 8
40 // 64BITLE-NEXT: [[TMP1:%.*]] = load double, ptr [[IMAG_ADDR]], align 8
41 // 64BITLE-NEXT: [[RETVAL_REALP:%.*]] = getelementptr inbounds { double, double }, ptr [[RETVAL]], i32 0, i32 0
42 // 64BITLE-NEXT: [[RETVAL_IMAGP:%.*]] = getelementptr inbounds { double, double }, ptr [[RETVAL]], i32 0, i32 1
43 // 64BITLE-NEXT: store double [[TMP0]], ptr [[RETVAL_REALP]], align 8
44 // 64BITLE-NEXT: store double [[TMP1]], ptr [[RETVAL_IMAGP]], align 8
45 // 64BITLE-NEXT: [[TMP2:%.*]] = load { double, double }, ptr [[RETVAL]], align 8
46 // 64BITLE-NEXT: ret { double, double } [[TMP2]]
48 // 64BITAIX-LABEL: @testcmplx(
49 // 64BITAIX-NEXT: entry:
50 // 64BITAIX-NEXT: [[RETVAL:%.*]] = alloca { double, double }, align 4
51 // 64BITAIX-NEXT: [[REAL_ADDR:%.*]] = alloca double, align 8
52 // 64BITAIX-NEXT: [[IMAG_ADDR:%.*]] = alloca double, align 8
53 // 64BITAIX-NEXT: store double [[REAL:%.*]], ptr [[REAL_ADDR]], align 8
54 // 64BITAIX-NEXT: store double [[IMAG:%.*]], ptr [[IMAG_ADDR]], align 8
55 // 64BITAIX-NEXT: [[TMP0:%.*]] = load double, ptr [[REAL_ADDR]], align 8
56 // 64BITAIX-NEXT: [[TMP1:%.*]] = load double, ptr [[IMAG_ADDR]], align 8
57 // 64BITAIX-NEXT: [[RETVAL_REALP:%.*]] = getelementptr inbounds { double, double }, ptr [[RETVAL]], i32 0, i32 0
58 // 64BITAIX-NEXT: [[RETVAL_IMAGP:%.*]] = getelementptr inbounds { double, double }, ptr [[RETVAL]], i32 0, i32 1
59 // 64BITAIX-NEXT: store double [[TMP0]], ptr [[RETVAL_REALP]], align 4
60 // 64BITAIX-NEXT: store double [[TMP1]], ptr [[RETVAL_IMAGP]], align 4
61 // 64BITAIX-NEXT: [[TMP2:%.*]] = load { double, double }, ptr [[RETVAL]], align 4
62 // 64BITAIX-NEXT: ret { double, double } [[TMP2]]
64 // 32BIT-LABEL: @testcmplx(
66 // 32BIT-NEXT: [[REAL_ADDR:%.*]] = alloca double, align 8
67 // 32BIT-NEXT: [[IMAG_ADDR:%.*]] = alloca double, align 8
68 // 32BIT-NEXT: store double [[REAL:%.*]], ptr [[REAL_ADDR]], align 8
69 // 32BIT-NEXT: store double [[IMAG:%.*]], ptr [[IMAG_ADDR]], align 8
70 // 32BIT-NEXT: [[TMP0:%.*]] = load double, ptr [[REAL_ADDR]], align 8
71 // 32BIT-NEXT: [[TMP1:%.*]] = load double, ptr [[IMAG_ADDR]], align 8
72 // 32BIT-NEXT: [[AGG_RESULT_REALP:%.*]] = getelementptr inbounds { double, double }, ptr [[AGG_RESULT:%.*]], i32 0, i32 0
73 // 32BIT-NEXT: [[AGG_RESULT_IMAGP:%.*]] = getelementptr inbounds { double, double }, ptr [[AGG_RESULT]], i32 0, i32 1
74 // 32BIT-NEXT: store double [[TMP0]], ptr [[AGG_RESULT_REALP]], align 8
75 // 32BIT-NEXT: store double [[TMP1]], ptr [[AGG_RESULT_IMAGP]], align 8
76 // 32BIT-NEXT: [[AGG_RESULT_REALP1:%.*]] = getelementptr inbounds { double, double }, ptr [[AGG_RESULT]], i32 0, i32 0
77 // 32BIT-NEXT: [[AGG_RESULT_REAL:%.*]] = load double, ptr [[AGG_RESULT_REALP1]], align 8
78 // 32BIT-NEXT: [[AGG_RESULT_IMAGP2:%.*]] = getelementptr inbounds { double, double }, ptr [[AGG_RESULT]], i32 0, i32 1
79 // 32BIT-NEXT: [[AGG_RESULT_IMAG:%.*]] = load double, ptr [[AGG_RESULT_IMAGP2]], align 8
80 // 32BIT-NEXT: [[AGG_RESULT_REALP3:%.*]] = getelementptr inbounds { double, double }, ptr [[AGG_RESULT]], i32 0, i32 0
81 // 32BIT-NEXT: [[AGG_RESULT_IMAGP4:%.*]] = getelementptr inbounds { double, double }, ptr [[AGG_RESULT]], i32 0, i32 1
82 // 32BIT-NEXT: store double [[AGG_RESULT_REAL]], ptr [[AGG_RESULT_REALP3]], align 8
83 // 32BIT-NEXT: store double [[AGG_RESULT_IMAG]], ptr [[AGG_RESULT_IMAGP4]], align 8
84 // 32BIT-NEXT: ret void
86 // 32BITLE-LABEL: @testcmplx(
87 // 32BITLE-NEXT: entry:
88 // 32BITLE-NEXT: [[REAL_ADDR:%.*]] = alloca double, align 8
89 // 32BITLE-NEXT: [[IMAG_ADDR:%.*]] = alloca double, align 8
90 // 32BITLE-NEXT: store double [[REAL:%.*]], ptr [[REAL_ADDR]], align 8
91 // 32BITLE-NEXT: store double [[IMAG:%.*]], ptr [[IMAG_ADDR]], align 8
92 // 32BITLE-NEXT: [[TMP0:%.*]] = load double, ptr [[REAL_ADDR]], align 8
93 // 32BITLE-NEXT: [[TMP1:%.*]] = load double, ptr [[IMAG_ADDR]], align 8
94 // 32BITLE-NEXT: [[AGG_RESULT_REALP:%.*]] = getelementptr inbounds { double, double }, ptr [[AGG_RESULT:%.*]], i32 0, i32 0
95 // 32BITLE-NEXT: [[AGG_RESULT_IMAGP:%.*]] = getelementptr inbounds { double, double }, ptr [[AGG_RESULT]], i32 0, i32 1
96 // 32BITLE-NEXT: store double [[TMP0]], ptr [[AGG_RESULT_REALP]], align 8
97 // 32BITLE-NEXT: store double [[TMP1]], ptr [[AGG_RESULT_IMAGP]], align 8
98 // 32BITLE-NEXT: [[AGG_RESULT_REALP1:%.*]] = getelementptr inbounds { double, double }, ptr [[AGG_RESULT]], i32 0, i32 0
99 // 32BITLE-NEXT: [[AGG_RESULT_REAL:%.*]] = load double, ptr [[AGG_RESULT_REALP1]], align 8
100 // 32BITLE-NEXT: [[AGG_RESULT_IMAGP2:%.*]] = getelementptr inbounds { double, double }, ptr [[AGG_RESULT]], i32 0, i32 1
101 // 32BITLE-NEXT: [[AGG_RESULT_IMAG:%.*]] = load double, ptr [[AGG_RESULT_IMAGP2]], align 8
102 // 32BITLE-NEXT: [[AGG_RESULT_REALP3:%.*]] = getelementptr inbounds { double, double }, ptr [[AGG_RESULT]], i32 0, i32 0
103 // 32BITLE-NEXT: [[AGG_RESULT_IMAGP4:%.*]] = getelementptr inbounds { double, double }, ptr [[AGG_RESULT]], i32 0, i32 1
104 // 32BITLE-NEXT: store double [[AGG_RESULT_REAL]], ptr [[AGG_RESULT_REALP3]], align 8
105 // 32BITLE-NEXT: store double [[AGG_RESULT_IMAG]], ptr [[AGG_RESULT_IMAGP4]], align 8
106 // 32BITLE-NEXT: ret void
108 // 32BITAIX-LABEL: @testcmplx(
109 // 32BITAIX-NEXT: entry:
110 // 32BITAIX-NEXT: [[RETVAL:%.*]] = alloca { double, double }, align 4
111 // 32BITAIX-NEXT: [[REAL_ADDR:%.*]] = alloca double, align 8
112 // 32BITAIX-NEXT: [[IMAG_ADDR:%.*]] = alloca double, align 8
113 // 32BITAIX-NEXT: store double [[REAL:%.*]], ptr [[REAL_ADDR]], align 8
114 // 32BITAIX-NEXT: store double [[IMAG:%.*]], ptr [[IMAG_ADDR]], align 8
115 // 32BITAIX-NEXT: [[TMP0:%.*]] = load double, ptr [[REAL_ADDR]], align 8
116 // 32BITAIX-NEXT: [[TMP1:%.*]] = load double, ptr [[IMAG_ADDR]], align 8
117 // 32BITAIX-NEXT: [[RETVAL_REALP:%.*]] = getelementptr inbounds { double, double }, ptr [[RETVAL]], i32 0, i32 0
118 // 32BITAIX-NEXT: [[RETVAL_IMAGP:%.*]] = getelementptr inbounds { double, double }, ptr [[RETVAL]], i32 0, i32 1
119 // 32BITAIX-NEXT: store double [[TMP0]], ptr [[RETVAL_REALP]], align 4
120 // 32BITAIX-NEXT: store double [[TMP1]], ptr [[RETVAL_IMAGP]], align 4
121 // 32BITAIX-NEXT: [[TMP2:%.*]] = load { double, double }, ptr [[RETVAL]], align 4
122 // 32BITAIX-NEXT: ret { double, double } [[TMP2]]
124 double _Complex
testcmplx(double real
, double imag
) {
125 return __cmplx(real
, imag
);
128 // 64BIT-LABEL: @testcmplxf(
129 // 64BIT-NEXT: entry:
130 // 64BIT-NEXT: [[RETVAL:%.*]] = alloca { float, float }, align 4
131 // 64BIT-NEXT: [[REAL_ADDR:%.*]] = alloca float, align 4
132 // 64BIT-NEXT: [[IMAG_ADDR:%.*]] = alloca float, align 4
133 // 64BIT-NEXT: store float [[REAL:%.*]], ptr [[REAL_ADDR]], align 4
134 // 64BIT-NEXT: store float [[IMAG:%.*]], ptr [[IMAG_ADDR]], align 4
135 // 64BIT-NEXT: [[TMP0:%.*]] = load float, ptr [[REAL_ADDR]], align 4
136 // 64BIT-NEXT: [[TMP1:%.*]] = load float, ptr [[IMAG_ADDR]], align 4
137 // 64BIT-NEXT: [[RETVAL_REALP:%.*]] = getelementptr inbounds { float, float }, ptr [[RETVAL]], i32 0, i32 0
138 // 64BIT-NEXT: [[RETVAL_IMAGP:%.*]] = getelementptr inbounds { float, float }, ptr [[RETVAL]], i32 0, i32 1
139 // 64BIT-NEXT: store float [[TMP0]], ptr [[RETVAL_REALP]], align 4
140 // 64BIT-NEXT: store float [[TMP1]], ptr [[RETVAL_IMAGP]], align 4
141 // 64BIT-NEXT: [[TMP2:%.*]] = load { float, float }, ptr [[RETVAL]], align 4
142 // 64BIT-NEXT: ret { float, float } [[TMP2]]
144 // 64BITLE-LABEL: @testcmplxf(
145 // 64BITLE-NEXT: entry:
146 // 64BITLE-NEXT: [[RETVAL:%.*]] = alloca { float, float }, align 4
147 // 64BITLE-NEXT: [[REAL_ADDR:%.*]] = alloca float, align 4
148 // 64BITLE-NEXT: [[IMAG_ADDR:%.*]] = alloca float, align 4
149 // 64BITLE-NEXT: store float [[REAL:%.*]], ptr [[REAL_ADDR]], align 4
150 // 64BITLE-NEXT: store float [[IMAG:%.*]], ptr [[IMAG_ADDR]], align 4
151 // 64BITLE-NEXT: [[TMP0:%.*]] = load float, ptr [[REAL_ADDR]], align 4
152 // 64BITLE-NEXT: [[TMP1:%.*]] = load float, ptr [[IMAG_ADDR]], align 4
153 // 64BITLE-NEXT: [[RETVAL_REALP:%.*]] = getelementptr inbounds { float, float }, ptr [[RETVAL]], i32 0, i32 0
154 // 64BITLE-NEXT: [[RETVAL_IMAGP:%.*]] = getelementptr inbounds { float, float }, ptr [[RETVAL]], i32 0, i32 1
155 // 64BITLE-NEXT: store float [[TMP0]], ptr [[RETVAL_REALP]], align 4
156 // 64BITLE-NEXT: store float [[TMP1]], ptr [[RETVAL_IMAGP]], align 4
157 // 64BITLE-NEXT: [[TMP2:%.*]] = load { float, float }, ptr [[RETVAL]], align 4
158 // 64BITLE-NEXT: ret { float, float } [[TMP2]]
160 // 64BITAIX-LABEL: @testcmplxf(
161 // 64BITAIX-NEXT: entry:
162 // 64BITAIX-NEXT: [[RETVAL:%.*]] = alloca { float, float }, align 4
163 // 64BITAIX-NEXT: [[REAL_ADDR:%.*]] = alloca float, align 4
164 // 64BITAIX-NEXT: [[IMAG_ADDR:%.*]] = alloca float, align 4
165 // 64BITAIX-NEXT: store float [[REAL:%.*]], ptr [[REAL_ADDR]], align 4
166 // 64BITAIX-NEXT: store float [[IMAG:%.*]], ptr [[IMAG_ADDR]], align 4
167 // 64BITAIX-NEXT: [[TMP0:%.*]] = load float, ptr [[REAL_ADDR]], align 4
168 // 64BITAIX-NEXT: [[TMP1:%.*]] = load float, ptr [[IMAG_ADDR]], align 4
169 // 64BITAIX-NEXT: [[RETVAL_REALP:%.*]] = getelementptr inbounds { float, float }, ptr [[RETVAL]], i32 0, i32 0
170 // 64BITAIX-NEXT: [[RETVAL_IMAGP:%.*]] = getelementptr inbounds { float, float }, ptr [[RETVAL]], i32 0, i32 1
171 // 64BITAIX-NEXT: store float [[TMP0]], ptr [[RETVAL_REALP]], align 4
172 // 64BITAIX-NEXT: store float [[TMP1]], ptr [[RETVAL_IMAGP]], align 4
173 // 64BITAIX-NEXT: [[TMP2:%.*]] = load { float, float }, ptr [[RETVAL]], align 4
174 // 64BITAIX-NEXT: ret { float, float } [[TMP2]]
176 // 32BIT-LABEL: @testcmplxf(
177 // 32BIT-NEXT: entry:
178 // 32BIT-NEXT: [[REAL_ADDR:%.*]] = alloca float, align 4
179 // 32BIT-NEXT: [[IMAG_ADDR:%.*]] = alloca float, align 4
180 // 32BIT-NEXT: store float [[REAL:%.*]], ptr [[REAL_ADDR]], align 4
181 // 32BIT-NEXT: store float [[IMAG:%.*]], ptr [[IMAG_ADDR]], align 4
182 // 32BIT-NEXT: [[TMP0:%.*]] = load float, ptr [[REAL_ADDR]], align 4
183 // 32BIT-NEXT: [[TMP1:%.*]] = load float, ptr [[IMAG_ADDR]], align 4
184 // 32BIT-NEXT: [[AGG_RESULT_REALP:%.*]] = getelementptr inbounds { float, float }, ptr [[AGG_RESULT:%.*]], i32 0, i32 0
185 // 32BIT-NEXT: [[AGG_RESULT_IMAGP:%.*]] = getelementptr inbounds { float, float }, ptr [[AGG_RESULT]], i32 0, i32 1
186 // 32BIT-NEXT: store float [[TMP0]], ptr [[AGG_RESULT_REALP]], align 4
187 // 32BIT-NEXT: store float [[TMP1]], ptr [[AGG_RESULT_IMAGP]], align 4
188 // 32BIT-NEXT: [[AGG_RESULT_REALP1:%.*]] = getelementptr inbounds { float, float }, ptr [[AGG_RESULT]], i32 0, i32 0
189 // 32BIT-NEXT: [[AGG_RESULT_REAL:%.*]] = load float, ptr [[AGG_RESULT_REALP1]], align 4
190 // 32BIT-NEXT: [[AGG_RESULT_IMAGP2:%.*]] = getelementptr inbounds { float, float }, ptr [[AGG_RESULT]], i32 0, i32 1
191 // 32BIT-NEXT: [[AGG_RESULT_IMAG:%.*]] = load float, ptr [[AGG_RESULT_IMAGP2]], align 4
192 // 32BIT-NEXT: [[AGG_RESULT_REALP3:%.*]] = getelementptr inbounds { float, float }, ptr [[AGG_RESULT]], i32 0, i32 0
193 // 32BIT-NEXT: [[AGG_RESULT_IMAGP4:%.*]] = getelementptr inbounds { float, float }, ptr [[AGG_RESULT]], i32 0, i32 1
194 // 32BIT-NEXT: store float [[AGG_RESULT_REAL]], ptr [[AGG_RESULT_REALP3]], align 4
195 // 32BIT-NEXT: store float [[AGG_RESULT_IMAG]], ptr [[AGG_RESULT_IMAGP4]], align 4
196 // 32BIT-NEXT: ret void
198 // 32BITLE-LABEL: @testcmplxf(
199 // 32BITLE-NEXT: entry:
200 // 32BITLE-NEXT: [[REAL_ADDR:%.*]] = alloca float, align 4
201 // 32BITLE-NEXT: [[IMAG_ADDR:%.*]] = alloca float, align 4
202 // 32BITLE-NEXT: store float [[REAL:%.*]], ptr [[REAL_ADDR]], align 4
203 // 32BITLE-NEXT: store float [[IMAG:%.*]], ptr [[IMAG_ADDR]], align 4
204 // 32BITLE-NEXT: [[TMP0:%.*]] = load float, ptr [[REAL_ADDR]], align 4
205 // 32BITLE-NEXT: [[TMP1:%.*]] = load float, ptr [[IMAG_ADDR]], align 4
206 // 32BITLE-NEXT: [[AGG_RESULT_REALP:%.*]] = getelementptr inbounds { float, float }, ptr [[AGG_RESULT:%.*]], i32 0, i32 0
207 // 32BITLE-NEXT: [[AGG_RESULT_IMAGP:%.*]] = getelementptr inbounds { float, float }, ptr [[AGG_RESULT]], i32 0, i32 1
208 // 32BITLE-NEXT: store float [[TMP0]], ptr [[AGG_RESULT_REALP]], align 4
209 // 32BITLE-NEXT: store float [[TMP1]], ptr [[AGG_RESULT_IMAGP]], align 4
210 // 32BITLE-NEXT: [[AGG_RESULT_REALP1:%.*]] = getelementptr inbounds { float, float }, ptr [[AGG_RESULT]], i32 0, i32 0
211 // 32BITLE-NEXT: [[AGG_RESULT_REAL:%.*]] = load float, ptr [[AGG_RESULT_REALP1]], align 4
212 // 32BITLE-NEXT: [[AGG_RESULT_IMAGP2:%.*]] = getelementptr inbounds { float, float }, ptr [[AGG_RESULT]], i32 0, i32 1
213 // 32BITLE-NEXT: [[AGG_RESULT_IMAG:%.*]] = load float, ptr [[AGG_RESULT_IMAGP2]], align 4
214 // 32BITLE-NEXT: [[AGG_RESULT_REALP3:%.*]] = getelementptr inbounds { float, float }, ptr [[AGG_RESULT]], i32 0, i32 0
215 // 32BITLE-NEXT: [[AGG_RESULT_IMAGP4:%.*]] = getelementptr inbounds { float, float }, ptr [[AGG_RESULT]], i32 0, i32 1
216 // 32BITLE-NEXT: store float [[AGG_RESULT_REAL]], ptr [[AGG_RESULT_REALP3]], align 4
217 // 32BITLE-NEXT: store float [[AGG_RESULT_IMAG]], ptr [[AGG_RESULT_IMAGP4]], align 4
218 // 32BITLE-NEXT: ret void
220 // 32BITAIX-LABEL: @testcmplxf(
221 // 32BITAIX-NEXT: entry:
222 // 32BITAIX-NEXT: [[RETVAL:%.*]] = alloca { float, float }, align 4
223 // 32BITAIX-NEXT: [[REAL_ADDR:%.*]] = alloca float, align 4
224 // 32BITAIX-NEXT: [[IMAG_ADDR:%.*]] = alloca float, align 4
225 // 32BITAIX-NEXT: store float [[REAL:%.*]], ptr [[REAL_ADDR]], align 4
226 // 32BITAIX-NEXT: store float [[IMAG:%.*]], ptr [[IMAG_ADDR]], align 4
227 // 32BITAIX-NEXT: [[TMP0:%.*]] = load float, ptr [[REAL_ADDR]], align 4
228 // 32BITAIX-NEXT: [[TMP1:%.*]] = load float, ptr [[IMAG_ADDR]], align 4
229 // 32BITAIX-NEXT: [[RETVAL_REALP:%.*]] = getelementptr inbounds { float, float }, ptr [[RETVAL]], i32 0, i32 0
230 // 32BITAIX-NEXT: [[RETVAL_IMAGP:%.*]] = getelementptr inbounds { float, float }, ptr [[RETVAL]], i32 0, i32 1
231 // 32BITAIX-NEXT: store float [[TMP0]], ptr [[RETVAL_REALP]], align 4
232 // 32BITAIX-NEXT: store float [[TMP1]], ptr [[RETVAL_IMAGP]], align 4
233 // 32BITAIX-NEXT: [[TMP2:%.*]] = load { float, float }, ptr [[RETVAL]], align 4
234 // 32BITAIX-NEXT: ret { float, float } [[TMP2]]
236 float _Complex
testcmplxf(float real
, float imag
) {
237 return __cmplxf(real
, imag
);
240 // 64BIT-LABEL: @test_xl_cmplxl(
241 // 64BIT-NEXT: entry:
242 // 64BIT-NEXT: [[RETVAL:%.*]] = alloca { ppc_fp128, ppc_fp128 }, align 16
243 // 64BIT-NEXT: [[LDA_ADDR:%.*]] = alloca ppc_fp128, align 16
244 // 64BIT-NEXT: [[LDB_ADDR:%.*]] = alloca ppc_fp128, align 16
245 // 64BIT-NEXT: store ppc_fp128 [[LDA:%.*]], ptr [[LDA_ADDR]], align 16
246 // 64BIT-NEXT: store ppc_fp128 [[LDB:%.*]], ptr [[LDB_ADDR]], align 16
247 // 64BIT-NEXT: [[TMP0:%.*]] = load ppc_fp128, ptr [[LDA_ADDR]], align 16
248 // 64BIT-NEXT: [[TMP1:%.*]] = load ppc_fp128, ptr [[LDB_ADDR]], align 16
249 // 64BIT-NEXT: [[RETVAL_REALP:%.*]] = getelementptr inbounds { ppc_fp128, ppc_fp128 }, ptr [[RETVAL]], i32 0, i32 0
250 // 64BIT-NEXT: [[RETVAL_IMAGP:%.*]] = getelementptr inbounds { ppc_fp128, ppc_fp128 }, ptr [[RETVAL]], i32 0, i32 1
251 // 64BIT-NEXT: store ppc_fp128 [[TMP0]], ptr [[RETVAL_REALP]], align 16
252 // 64BIT-NEXT: store ppc_fp128 [[TMP1]], ptr [[RETVAL_IMAGP]], align 16
253 // 64BIT-NEXT: [[TMP2:%.*]] = load { ppc_fp128, ppc_fp128 }, ptr [[RETVAL]], align 16
254 // 64BIT-NEXT: ret { ppc_fp128, ppc_fp128 } [[TMP2]]
256 // 64BITLE-LABEL: @test_xl_cmplxl(
257 // 64BITLE-NEXT: entry:
258 // 64BITLE-NEXT: [[RETVAL:%.*]] = alloca { ppc_fp128, ppc_fp128 }, align 16
259 // 64BITLE-NEXT: [[LDA_ADDR:%.*]] = alloca ppc_fp128, align 16
260 // 64BITLE-NEXT: [[LDB_ADDR:%.*]] = alloca ppc_fp128, align 16
261 // 64BITLE-NEXT: store ppc_fp128 [[LDA:%.*]], ptr [[LDA_ADDR]], align 16
262 // 64BITLE-NEXT: store ppc_fp128 [[LDB:%.*]], ptr [[LDB_ADDR]], align 16
263 // 64BITLE-NEXT: [[TMP0:%.*]] = load ppc_fp128, ptr [[LDA_ADDR]], align 16
264 // 64BITLE-NEXT: [[TMP1:%.*]] = load ppc_fp128, ptr [[LDB_ADDR]], align 16
265 // 64BITLE-NEXT: [[RETVAL_REALP:%.*]] = getelementptr inbounds { ppc_fp128, ppc_fp128 }, ptr [[RETVAL]], i32 0, i32 0
266 // 64BITLE-NEXT: [[RETVAL_IMAGP:%.*]] = getelementptr inbounds { ppc_fp128, ppc_fp128 }, ptr [[RETVAL]], i32 0, i32 1
267 // 64BITLE-NEXT: store ppc_fp128 [[TMP0]], ptr [[RETVAL_REALP]], align 16
268 // 64BITLE-NEXT: store ppc_fp128 [[TMP1]], ptr [[RETVAL_IMAGP]], align 16
269 // 64BITLE-NEXT: [[TMP2:%.*]] = load { ppc_fp128, ppc_fp128 }, ptr [[RETVAL]], align 16
270 // 64BITLE-NEXT: ret { ppc_fp128, ppc_fp128 } [[TMP2]]
272 // 64BITAIX-LABEL: @test_xl_cmplxl(
273 // 64BITAIX-NEXT: entry:
274 // 64BITAIX-NEXT: [[RETVAL:%.*]] = alloca { double, double }, align 4
275 // 64BITAIX-NEXT: [[LDA_ADDR:%.*]] = alloca double, align 8
276 // 64BITAIX-NEXT: [[LDB_ADDR:%.*]] = alloca double, align 8
277 // 64BITAIX-NEXT: store double [[LDA:%.*]], ptr [[LDA_ADDR]], align 8
278 // 64BITAIX-NEXT: store double [[LDB:%.*]], ptr [[LDB_ADDR]], align 8
279 // 64BITAIX-NEXT: [[TMP0:%.*]] = load double, ptr [[LDA_ADDR]], align 8
280 // 64BITAIX-NEXT: [[TMP1:%.*]] = load double, ptr [[LDB_ADDR]], align 8
281 // 64BITAIX-NEXT: [[RETVAL_REALP:%.*]] = getelementptr inbounds { double, double }, ptr [[RETVAL]], i32 0, i32 0
282 // 64BITAIX-NEXT: [[RETVAL_IMAGP:%.*]] = getelementptr inbounds { double, double }, ptr [[RETVAL]], i32 0, i32 1
283 // 64BITAIX-NEXT: store double [[TMP0]], ptr [[RETVAL_REALP]], align 4
284 // 64BITAIX-NEXT: store double [[TMP1]], ptr [[RETVAL_IMAGP]], align 4
285 // 64BITAIX-NEXT: [[TMP2:%.*]] = load { double, double }, ptr [[RETVAL]], align 4
286 // 64BITAIX-NEXT: ret { double, double } [[TMP2]]
288 // 32BIT-LABEL: @test_xl_cmplxl(
289 // 32BIT-NEXT: entry:
290 // 32BIT-NEXT: [[LDA_ADDR:%.*]] = alloca ppc_fp128, align 16
291 // 32BIT-NEXT: [[LDB_ADDR:%.*]] = alloca ppc_fp128, align 16
292 // 32BIT-NEXT: store ppc_fp128 [[LDA:%.*]], ptr [[LDA_ADDR]], align 16
293 // 32BIT-NEXT: store ppc_fp128 [[LDB:%.*]], ptr [[LDB_ADDR]], align 16
294 // 32BIT-NEXT: [[TMP0:%.*]] = load ppc_fp128, ptr [[LDA_ADDR]], align 16
295 // 32BIT-NEXT: [[TMP1:%.*]] = load ppc_fp128, ptr [[LDB_ADDR]], align 16
296 // 32BIT-NEXT: [[AGG_RESULT_REALP:%.*]] = getelementptr inbounds { ppc_fp128, ppc_fp128 }, ptr [[AGG_RESULT:%.*]], i32 0, i32 0
297 // 32BIT-NEXT: [[AGG_RESULT_IMAGP:%.*]] = getelementptr inbounds { ppc_fp128, ppc_fp128 }, ptr [[AGG_RESULT]], i32 0, i32 1
298 // 32BIT-NEXT: store ppc_fp128 [[TMP0]], ptr [[AGG_RESULT_REALP]], align 16
299 // 32BIT-NEXT: store ppc_fp128 [[TMP1]], ptr [[AGG_RESULT_IMAGP]], align 16
300 // 32BIT-NEXT: [[AGG_RESULT_REALP1:%.*]] = getelementptr inbounds { ppc_fp128, ppc_fp128 }, ptr [[AGG_RESULT]], i32 0, i32 0
301 // 32BIT-NEXT: [[AGG_RESULT_REAL:%.*]] = load ppc_fp128, ptr [[AGG_RESULT_REALP1]], align 16
302 // 32BIT-NEXT: [[AGG_RESULT_IMAGP2:%.*]] = getelementptr inbounds { ppc_fp128, ppc_fp128 }, ptr [[AGG_RESULT]], i32 0, i32 1
303 // 32BIT-NEXT: [[AGG_RESULT_IMAG:%.*]] = load ppc_fp128, ptr [[AGG_RESULT_IMAGP2]], align 16
304 // 32BIT-NEXT: [[AGG_RESULT_REALP3:%.*]] = getelementptr inbounds { ppc_fp128, ppc_fp128 }, ptr [[AGG_RESULT]], i32 0, i32 0
305 // 32BIT-NEXT: [[AGG_RESULT_IMAGP4:%.*]] = getelementptr inbounds { ppc_fp128, ppc_fp128 }, ptr [[AGG_RESULT]], i32 0, i32 1
306 // 32BIT-NEXT: store ppc_fp128 [[AGG_RESULT_REAL]], ptr [[AGG_RESULT_REALP3]], align 16
307 // 32BIT-NEXT: store ppc_fp128 [[AGG_RESULT_IMAG]], ptr [[AGG_RESULT_IMAGP4]], align 16
308 // 32BIT-NEXT: ret void
310 // 32BITLE-LABEL: @test_xl_cmplxl(
311 // 32BITLE-NEXT: entry:
312 // 32BITLE-NEXT: [[LDA_ADDR:%.*]] = alloca ppc_fp128, align 16
313 // 32BITLE-NEXT: [[LDB_ADDR:%.*]] = alloca ppc_fp128, align 16
314 // 32BITLE-NEXT: store ppc_fp128 [[LDA:%.*]], ptr [[LDA_ADDR]], align 16
315 // 32BITLE-NEXT: store ppc_fp128 [[LDB:%.*]], ptr [[LDB_ADDR]], align 16
316 // 32BITLE-NEXT: [[TMP0:%.*]] = load ppc_fp128, ptr [[LDA_ADDR]], align 16
317 // 32BITLE-NEXT: [[TMP1:%.*]] = load ppc_fp128, ptr [[LDB_ADDR]], align 16
318 // 32BITLE-NEXT: [[AGG_RESULT_REALP:%.*]] = getelementptr inbounds { ppc_fp128, ppc_fp128 }, ptr [[AGG_RESULT:%.*]], i32 0, i32 0
319 // 32BITLE-NEXT: [[AGG_RESULT_IMAGP:%.*]] = getelementptr inbounds { ppc_fp128, ppc_fp128 }, ptr [[AGG_RESULT]], i32 0, i32 1
320 // 32BITLE-NEXT: store ppc_fp128 [[TMP0]], ptr [[AGG_RESULT_REALP]], align 16
321 // 32BITLE-NEXT: store ppc_fp128 [[TMP1]], ptr [[AGG_RESULT_IMAGP]], align 16
322 // 32BITLE-NEXT: [[AGG_RESULT_REALP1:%.*]] = getelementptr inbounds { ppc_fp128, ppc_fp128 }, ptr [[AGG_RESULT]], i32 0, i32 0
323 // 32BITLE-NEXT: [[AGG_RESULT_REAL:%.*]] = load ppc_fp128, ptr [[AGG_RESULT_REALP1]], align 16
324 // 32BITLE-NEXT: [[AGG_RESULT_IMAGP2:%.*]] = getelementptr inbounds { ppc_fp128, ppc_fp128 }, ptr [[AGG_RESULT]], i32 0, i32 1
325 // 32BITLE-NEXT: [[AGG_RESULT_IMAG:%.*]] = load ppc_fp128, ptr [[AGG_RESULT_IMAGP2]], align 16
326 // 32BITLE-NEXT: [[AGG_RESULT_REALP3:%.*]] = getelementptr inbounds { ppc_fp128, ppc_fp128 }, ptr [[AGG_RESULT]], i32 0, i32 0
327 // 32BITLE-NEXT: [[AGG_RESULT_IMAGP4:%.*]] = getelementptr inbounds { ppc_fp128, ppc_fp128 }, ptr [[AGG_RESULT]], i32 0, i32 1
328 // 32BITLE-NEXT: store ppc_fp128 [[AGG_RESULT_REAL]], ptr [[AGG_RESULT_REALP3]], align 16
329 // 32BITLE-NEXT: store ppc_fp128 [[AGG_RESULT_IMAG]], ptr [[AGG_RESULT_IMAGP4]], align 16
330 // 32BITLE-NEXT: ret void
332 // 32BITAIX-LABEL: @test_xl_cmplxl(
333 // 32BITAIX-NEXT: entry:
334 // 32BITAIX-NEXT: [[RETVAL:%.*]] = alloca { double, double }, align 4
335 // 32BITAIX-NEXT: [[LDA_ADDR:%.*]] = alloca double, align 8
336 // 32BITAIX-NEXT: [[LDB_ADDR:%.*]] = alloca double, align 8
337 // 32BITAIX-NEXT: store double [[LDA:%.*]], ptr [[LDA_ADDR]], align 8
338 // 32BITAIX-NEXT: store double [[LDB:%.*]], ptr [[LDB_ADDR]], align 8
339 // 32BITAIX-NEXT: [[TMP0:%.*]] = load double, ptr [[LDA_ADDR]], align 8
340 // 32BITAIX-NEXT: [[TMP1:%.*]] = load double, ptr [[LDB_ADDR]], align 8
341 // 32BITAIX-NEXT: [[RETVAL_REALP:%.*]] = getelementptr inbounds { double, double }, ptr [[RETVAL]], i32 0, i32 0
342 // 32BITAIX-NEXT: [[RETVAL_IMAGP:%.*]] = getelementptr inbounds { double, double }, ptr [[RETVAL]], i32 0, i32 1
343 // 32BITAIX-NEXT: store double [[TMP0]], ptr [[RETVAL_REALP]], align 4
344 // 32BITAIX-NEXT: store double [[TMP1]], ptr [[RETVAL_IMAGP]], align 4
345 // 32BITAIX-NEXT: [[TMP2:%.*]] = load { double, double }, ptr [[RETVAL]], align 4
346 // 32BITAIX-NEXT: ret { double, double } [[TMP2]]
348 long double _Complex
test_xl_cmplxl(long double lda
, long double ldb
) {
349 return __cmplxl(lda
, ldb
);