1//===--- BuiltinsPPC.def - PowerPC Builtin function database ----*- C++ -*-===//
2//
3//                     The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file defines the PowerPC-specific builtin function database.  Users of
11// this file must define the BUILTIN macro to make use of this information.
12//
13//===----------------------------------------------------------------------===//
14
15// FIXME: this needs to be the full list supported by GCC.  Right now, I'm just
16// adding stuff on demand.
17
18// The format of this database matches clang/Basic/Builtins.def.
19
20// This is just a placeholder, the types and attributes are wrong.
21BUILTIN(__builtin_altivec_vaddcuw, "V4UiV4UiV4Ui", "")
22
23BUILTIN(__builtin_altivec_vaddsbs, "V16ScV16ScV16Sc", "")
24BUILTIN(__builtin_altivec_vaddubs, "V16UcV16UcV16Uc", "")
25BUILTIN(__builtin_altivec_vaddshs, "V8SsV8SsV8Ss", "")
26BUILTIN(__builtin_altivec_vadduhs, "V8UsV8UsV8Us", "")
27BUILTIN(__builtin_altivec_vaddsws, "V4SiV4SiV4Si", "")
28BUILTIN(__builtin_altivec_vadduws, "V4UiV4UiV4Ui", "")
29
30BUILTIN(__builtin_altivec_vsubsbs, "V16ScV16ScV16Sc", "")
31BUILTIN(__builtin_altivec_vsububs, "V16UcV16UcV16Uc", "")
32BUILTIN(__builtin_altivec_vsubshs, "V8SsV8SsV8Ss", "")
33BUILTIN(__builtin_altivec_vsubuhs, "V8UsV8UsV8Us", "")
34BUILTIN(__builtin_altivec_vsubsws, "V4SiV4SiV4Si", "")
35BUILTIN(__builtin_altivec_vsubuws, "V4UiV4UiV4Ui", "")
36
37BUILTIN(__builtin_altivec_vavgsb, "V16ScV16ScV16Sc", "")
38BUILTIN(__builtin_altivec_vavgub, "V16UcV16UcV16Uc", "")
39BUILTIN(__builtin_altivec_vavgsh, "V8SsV8SsV8Ss", "")
40BUILTIN(__builtin_altivec_vavguh, "V8UsV8UsV8Us", "")
41BUILTIN(__builtin_altivec_vavgsw, "V4SiV4SiV4Si", "")
42BUILTIN(__builtin_altivec_vavguw, "V4UiV4UiV4Ui", "")
43
44BUILTIN(__builtin_altivec_vrfip, "V4fV4f", "")
45
46BUILTIN(__builtin_altivec_vcfsx, "V4fV4ii", "")
47BUILTIN(__builtin_altivec_vcfux, "V4fV4ii", "")
48BUILTIN(__builtin_altivec_vctsxs, "V4SiV4fi", "")
49BUILTIN(__builtin_altivec_vctuxs, "V4UiV4fi", "")
50
51BUILTIN(__builtin_altivec_dss, "vUi", "")
52BUILTIN(__builtin_altivec_dssall, "v", "")
53BUILTIN(__builtin_altivec_dst, "vvC*iUi", "")
54BUILTIN(__builtin_altivec_dstt, "vvC*iUi", "")
55BUILTIN(__builtin_altivec_dstst, "vvC*iUi", "")
56BUILTIN(__builtin_altivec_dststt, "vvC*iUi", "")
57
58BUILTIN(__builtin_altivec_vexptefp, "V4fV4f", "")
59
60BUILTIN(__builtin_altivec_vrfim, "V4fV4f", "")
61
62BUILTIN(__builtin_altivec_lvx, "V4iivC*", "")
63BUILTIN(__builtin_altivec_lvxl, "V4iivC*", "")
64BUILTIN(__builtin_altivec_lvebx, "V16civC*", "")
65BUILTIN(__builtin_altivec_lvehx, "V8sivC*", "")
66BUILTIN(__builtin_altivec_lvewx, "V4iivC*", "")
67
68BUILTIN(__builtin_altivec_vlogefp, "V4fV4f", "")
69
70BUILTIN(__builtin_altivec_lvsl, "V16cUcvC*", "")
71BUILTIN(__builtin_altivec_lvsr, "V16cUcvC*", "")
72
73BUILTIN(__builtin_altivec_vmaddfp, "V4fV4fV4fV4f", "")
74BUILTIN(__builtin_altivec_vmhaddshs, "V8sV8sV8sV8s", "")
75BUILTIN(__builtin_altivec_vmhraddshs, "V8sV8sV8sV8s", "")
76
77BUILTIN(__builtin_altivec_vmsumubm, "V4UiV16UcV16UcV4Ui", "")
78BUILTIN(__builtin_altivec_vmsummbm, "V4SiV16ScV16UcV4Si", "")
79BUILTIN(__builtin_altivec_vmsumuhm, "V4UiV8UsV8UsV4Ui", "")
80BUILTIN(__builtin_altivec_vmsumshm, "V4SiV8SsV8SsV4Si", "")
81BUILTIN(__builtin_altivec_vmsumuhs, "V4UiV8UsV8UsV4Ui", "")
82BUILTIN(__builtin_altivec_vmsumshs, "V4SiV8SsV8SsV4Si", "")
83
84BUILTIN(__builtin_altivec_vmuleub, "V8UsV16UcV16Uc", "")
85BUILTIN(__builtin_altivec_vmulesb, "V8SsV16ScV16Sc", "")
86BUILTIN(__builtin_altivec_vmuleuh, "V4UiV8UsV8Us", "")
87BUILTIN(__builtin_altivec_vmulesh, "V4SiV8SsV8Ss", "")
88BUILTIN(__builtin_altivec_vmuleuw, "V2ULLiV4UiV4Ui", "")
89BUILTIN(__builtin_altivec_vmulesw, "V2SLLiV4SiV4Si", "")
90BUILTIN(__builtin_altivec_vmuloub, "V8UsV16UcV16Uc", "")
91BUILTIN(__builtin_altivec_vmulosb, "V8SsV16ScV16Sc", "")
92BUILTIN(__builtin_altivec_vmulouh, "V4UiV8UsV8Us", "")
93BUILTIN(__builtin_altivec_vmulosh, "V4SiV8SsV8Ss", "")
94BUILTIN(__builtin_altivec_vmulouw, "V2ULLiV4UiV4Ui", "")
95BUILTIN(__builtin_altivec_vmulosw, "V2SLLiV4SiV4Si", "")
96
97BUILTIN(__builtin_altivec_vnmsubfp, "V4fV4fV4fV4f", "")
98
99BUILTIN(__builtin_altivec_vpkpx, "V8sV4UiV4Ui", "")
100BUILTIN(__builtin_altivec_vpkuhus, "V16UcV8UsV8Us", "")
101BUILTIN(__builtin_altivec_vpkshss, "V16ScV8SsV8Ss", "")
102BUILTIN(__builtin_altivec_vpkuwus, "V8UsV4UiV4Ui", "")
103BUILTIN(__builtin_altivec_vpkswss, "V8SsV4SiV4Si", "")
104BUILTIN(__builtin_altivec_vpkshus, "V16UcV8SsV8Ss", "")
105BUILTIN(__builtin_altivec_vpkswus, "V8UsV4SiV4Si", "")
106
107BUILTIN(__builtin_altivec_vperm_4si, "V4iV4iV4iV16Uc", "")
108
109BUILTIN(__builtin_altivec_stvx, "vV4iiv*", "")
110BUILTIN(__builtin_altivec_stvxl, "vV4iiv*", "")
111BUILTIN(__builtin_altivec_stvebx, "vV16civ*", "")
112BUILTIN(__builtin_altivec_stvehx, "vV8siv*", "")
113BUILTIN(__builtin_altivec_stvewx, "vV4iiv*", "")
114
115BUILTIN(__builtin_altivec_vcmpbfp, "V4iV4fV4f", "")
116
117BUILTIN(__builtin_altivec_vcmpgefp, "V4iV4fV4f", "")
118
119BUILTIN(__builtin_altivec_vcmpequb, "V16cV16cV16c", "")
120BUILTIN(__builtin_altivec_vcmpequh, "V8sV8sV8s", "")
121BUILTIN(__builtin_altivec_vcmpequw, "V4iV4iV4i", "")
122BUILTIN(__builtin_altivec_vcmpequd, "V2LLiV2LLiV2LLi", "")
123BUILTIN(__builtin_altivec_vcmpeqfp, "V4iV4fV4f", "")
124
125BUILTIN(__builtin_altivec_vcmpgtsb, "V16cV16ScV16Sc", "")
126BUILTIN(__builtin_altivec_vcmpgtub, "V16cV16UcV16Uc", "")
127BUILTIN(__builtin_altivec_vcmpgtsh, "V8sV8SsV8Ss", "")
128BUILTIN(__builtin_altivec_vcmpgtuh, "V8sV8UsV8Us", "")
129BUILTIN(__builtin_altivec_vcmpgtsw, "V4iV4SiV4Si", "")
130BUILTIN(__builtin_altivec_vcmpgtuw, "V4iV4UiV4Ui", "")
131BUILTIN(__builtin_altivec_vcmpgtsd, "V2LLiV2LLiV2LLi", "")
132BUILTIN(__builtin_altivec_vcmpgtud, "V2LLiV2ULLiV2ULLi", "")
133BUILTIN(__builtin_altivec_vcmpgtfp, "V4iV4fV4f", "")
134
135BUILTIN(__builtin_altivec_vmaxsb, "V16ScV16ScV16Sc", "")
136BUILTIN(__builtin_altivec_vmaxub, "V16UcV16UcV16Uc", "")
137BUILTIN(__builtin_altivec_vmaxsh, "V8SsV8SsV8Ss", "")
138BUILTIN(__builtin_altivec_vmaxuh, "V8UsV8UsV8Us", "")
139BUILTIN(__builtin_altivec_vmaxsw, "V4SiV4SiV4Si", "")
140BUILTIN(__builtin_altivec_vmaxuw, "V4UiV4UiV4Ui", "")
141BUILTIN(__builtin_altivec_vmaxsd, "V2LLiV2LLiV2LLi", "")
142BUILTIN(__builtin_altivec_vmaxud, "V2ULLiV2ULLiV2ULLi", "")
143BUILTIN(__builtin_altivec_vmaxfp, "V4fV4fV4f", "")
144
145BUILTIN(__builtin_altivec_mfvscr, "V8Us", "")
146
147BUILTIN(__builtin_altivec_vminsb, "V16ScV16ScV16Sc", "")
148BUILTIN(__builtin_altivec_vminub, "V16UcV16UcV16Uc", "")
149BUILTIN(__builtin_altivec_vminsh, "V8SsV8SsV8Ss", "")
150BUILTIN(__builtin_altivec_vminuh, "V8UsV8UsV8Us", "")
151BUILTIN(__builtin_altivec_vminsw, "V4SiV4SiV4Si", "")
152BUILTIN(__builtin_altivec_vminuw, "V4UiV4UiV4Ui", "")
153BUILTIN(__builtin_altivec_vminsd, "V2LLiV2LLiV2LLi", "")
154BUILTIN(__builtin_altivec_vminud, "V2ULLiV2ULLiV2ULLi", "")
155BUILTIN(__builtin_altivec_vminfp, "V4fV4fV4f", "")
156
157BUILTIN(__builtin_altivec_mtvscr, "vV4i", "")
158
159BUILTIN(__builtin_altivec_vrefp, "V4fV4f", "")
160
161BUILTIN(__builtin_altivec_vrlb, "V16cV16cV16Uc", "")
162BUILTIN(__builtin_altivec_vrlh, "V8sV8sV8Us", "")
163BUILTIN(__builtin_altivec_vrlw, "V4iV4iV4Ui", "")
164BUILTIN(__builtin_altivec_vrld, "V2LLiV2LLiV2ULLi", "")
165
166BUILTIN(__builtin_altivec_vsel_4si, "V4iV4iV4iV4Ui", "")
167
168BUILTIN(__builtin_altivec_vsl, "V4iV4iV4i", "")
169BUILTIN(__builtin_altivec_vslo, "V4iV4iV4i", "")
170
171BUILTIN(__builtin_altivec_vsrab, "V16cV16cV16Uc", "")
172BUILTIN(__builtin_altivec_vsrah, "V8sV8sV8Us", "")
173BUILTIN(__builtin_altivec_vsraw, "V4iV4iV4Ui", "")
174
175BUILTIN(__builtin_altivec_vsr, "V4iV4iV4i", "")
176BUILTIN(__builtin_altivec_vsro, "V4iV4iV4i", "")
177
178BUILTIN(__builtin_altivec_vrfin, "V4fV4f", "")
179
180BUILTIN(__builtin_altivec_vrsqrtefp, "V4fV4f", "")
181
182BUILTIN(__builtin_altivec_vsubcuw, "V4UiV4UiV4Ui", "")
183
184BUILTIN(__builtin_altivec_vsum4sbs, "V4SiV16ScV4Si", "")
185BUILTIN(__builtin_altivec_vsum4ubs, "V4UiV16UcV4Ui", "")
186BUILTIN(__builtin_altivec_vsum4shs, "V4SiV8SsV4Si", "")
187
188BUILTIN(__builtin_altivec_vsum2sws, "V4SiV4SiV4Si", "")
189
190BUILTIN(__builtin_altivec_vsumsws, "V4SiV4SiV4Si", "")
191
192BUILTIN(__builtin_altivec_vrfiz, "V4fV4f", "")
193
194BUILTIN(__builtin_altivec_vupkhsb, "V8sV16c", "")
195BUILTIN(__builtin_altivec_vupkhpx, "V4UiV8s", "")
196BUILTIN(__builtin_altivec_vupkhsh, "V4iV8s", "")
197
198BUILTIN(__builtin_altivec_vupklsb, "V8sV16c", "")
199BUILTIN(__builtin_altivec_vupklpx, "V4UiV8s", "")
200BUILTIN(__builtin_altivec_vupklsh, "V4iV8s", "")
201
202BUILTIN(__builtin_altivec_vcmpbfp_p, "iiV4fV4f", "")
203
204BUILTIN(__builtin_altivec_vcmpgefp_p, "iiV4fV4f", "")
205
206BUILTIN(__builtin_altivec_vcmpequb_p, "iiV16cV16c", "")
207BUILTIN(__builtin_altivec_vcmpequh_p, "iiV8sV8s", "")
208BUILTIN(__builtin_altivec_vcmpequw_p, "iiV4iV4i", "")
209BUILTIN(__builtin_altivec_vcmpequd_p, "iiV2LLiV2LLi", "")
210BUILTIN(__builtin_altivec_vcmpeqfp_p, "iiV4fV4f", "")
211
212BUILTIN(__builtin_altivec_vcmpgtsb_p, "iiV16ScV16Sc", "")
213BUILTIN(__builtin_altivec_vcmpgtub_p, "iiV16UcV16Uc", "")
214BUILTIN(__builtin_altivec_vcmpgtsh_p, "iiV8SsV8Ss", "")
215BUILTIN(__builtin_altivec_vcmpgtuh_p, "iiV8UsV8Us", "")
216BUILTIN(__builtin_altivec_vcmpgtsw_p, "iiV4SiV4Si", "")
217BUILTIN(__builtin_altivec_vcmpgtuw_p, "iiV4UiV4Ui", "")
218BUILTIN(__builtin_altivec_vcmpgtsd_p, "iiV2LLiV2LLi", "")
219BUILTIN(__builtin_altivec_vcmpgtud_p, "iiV2ULLiV2ULLi", "")
220BUILTIN(__builtin_altivec_vcmpgtfp_p, "iiV4fV4f", "")
221
222// P8 Crypto built-ins.
223BUILTIN(__builtin_altivec_crypto_vsbox, "V2ULLiV2ULLi", "")
224BUILTIN(__builtin_altivec_crypto_vpermxor, "V16UcV16UcV16UcV16Uc", "")
225BUILTIN(__builtin_altivec_crypto_vshasigmaw, "V4UiV4UiIiIi", "")
226BUILTIN(__builtin_altivec_crypto_vshasigmad, "V2ULLiV2ULLiIiIi", "")
227BUILTIN(__builtin_altivec_crypto_vcipher, "V2ULLiV2ULLiV2ULLi", "")
228BUILTIN(__builtin_altivec_crypto_vcipherlast, "V2ULLiV2ULLiV2ULLi", "")
229BUILTIN(__builtin_altivec_crypto_vncipher, "V2ULLiV2ULLiV2ULLi", "")
230BUILTIN(__builtin_altivec_crypto_vncipherlast, "V2ULLiV2ULLiV2ULLi", "")
231BUILTIN(__builtin_altivec_crypto_vpmsumb, "V16UcV16UcV16Uc", "")
232BUILTIN(__builtin_altivec_crypto_vpmsumh, "V8UsV8UsV8Us", "")
233BUILTIN(__builtin_altivec_crypto_vpmsumw, "V4UiV4UiV4Ui", "")
234BUILTIN(__builtin_altivec_crypto_vpmsumd, "V2ULLiV2ULLiV2ULLi", "")
235
236// VSX built-ins.
237
238BUILTIN(__builtin_vsx_lxvd2x, "V2divC*", "")
239BUILTIN(__builtin_vsx_lxvw4x, "V4iivC*", "")
240
241BUILTIN(__builtin_vsx_stxvd2x, "vV2div*", "")
242BUILTIN(__builtin_vsx_stxvw4x, "vV4iiv*", "")
243
244BUILTIN(__builtin_vsx_xvmaxdp, "V2dV2dV2d", "")
245BUILTIN(__builtin_vsx_xvmaxsp, "V4fV4fV4f", "")
246BUILTIN(__builtin_vsx_xsmaxdp, "ddd", "")
247
248BUILTIN(__builtin_vsx_xvmindp, "V2dV2dV2d", "")
249BUILTIN(__builtin_vsx_xvminsp, "V4fV4fV4f", "")
250BUILTIN(__builtin_vsx_xsmindp, "ddd", "")
251
252BUILTIN(__builtin_vsx_xvdivdp, "V2dV2dV2d", "")
253BUILTIN(__builtin_vsx_xvdivsp, "V4fV4fV4f", "")
254
255// HTM builtins
256BUILTIN(__builtin_tbegin, "UiUIi", "")
257BUILTIN(__builtin_tend, "UiUIi", "")
258
259BUILTIN(__builtin_tabort, "UiUi", "")
260BUILTIN(__builtin_tabortdc, "UiUiUiUi", "")
261BUILTIN(__builtin_tabortdci, "UiUiUii", "")
262BUILTIN(__builtin_tabortwc, "UiUiUiUi", "")
263BUILTIN(__builtin_tabortwci, "UiUiUii", "")
264
265BUILTIN(__builtin_tcheck, "Ui", "")
266BUILTIN(__builtin_treclaim, "UiUi", "")
267BUILTIN(__builtin_trechkpt, "Ui", "")
268BUILTIN(__builtin_tsr, "UiUi", "")
269
270BUILTIN(__builtin_tendall, "Ui", "")
271BUILTIN(__builtin_tresume, "Ui", "")
272BUILTIN(__builtin_tsuspend, "Ui", "")
273
274BUILTIN(__builtin_get_texasr, "LUi", "c")
275BUILTIN(__builtin_get_texasru, "LUi", "c")
276BUILTIN(__builtin_get_tfhar, "LUi", "c")
277BUILTIN(__builtin_get_tfiar, "LUi", "c")
278
279BUILTIN(__builtin_set_texasr, "vLUi", "c")
280BUILTIN(__builtin_set_texasru, "vLUi", "c")
281BUILTIN(__builtin_set_tfhar, "vLUi", "c")
282BUILTIN(__builtin_set_tfiar, "vLUi", "c")
283
284BUILTIN(__builtin_ttest, "LUi", "")
285
286// Scalar built-ins
287BUILTIN(__builtin_divwe, "SiSiSi", "")
288BUILTIN(__builtin_divweu, "UiUiUi", "")
289BUILTIN(__builtin_divde, "SLLiSLLiSLLi", "")
290BUILTIN(__builtin_divdeu, "ULLiULLiULLi", "")
291BUILTIN(__builtin_bpermd, "SLLiSLLiSLLi", "")
292
293// FIXME: Obviously incomplete.
294
295#undef BUILTIN
296