32e44e55810cc75a27c3e7d18e55d707db11a34e
[gcc.git] / gcc / config / sparc / visintrin.h
1 /* Copyright (C) 2011 Free Software Foundation, Inc.
2
3 This file is part of GCC.
4
5 GCC is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3, or (at your option)
8 any later version.
9
10 GCC is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 Under Section 7 of GPL version 3, you are granted additional
16 permissions described in the GCC Runtime Library Exception, version
17 3.1, as published by the Free Software Foundation.
18
19 You should have received a copy of the GNU General Public License and
20 a copy of the GCC Runtime Library Exception along with this program;
21 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
22 <http://www.gnu.org/licenses/>. */
23
24 #ifndef _VISINTRIN_H_INCLUDED
25 #define _VISINTRIN_H_INCLUDED
26
27 typedef int __v2si __attribute__ ((__vector_size__ (8)));
28 typedef int __v1si __attribute__ ((__vector_size__ (4)));
29 typedef short __v4hi __attribute__ ((__vector_size__ (8)));
30 typedef short __v2hi __attribute__ ((__vector_size__ (4)));
31 typedef unsigned char __v8qi __attribute__ ((__vector_size__ (8)));
32 typedef unsigned char __v4qi __attribute__ ((__vector_size__ (4)));
33 typedef int __i64 __attribute__ ((__mode__ (DI)));
34
35 extern __inline void
36 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
37 __vis_write_gsr (__i64 __A)
38 {
39 __builtin_vis_write_gsr (__A);
40 }
41
42 extern __inline __i64
43 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
44 __vis_read_gsr (void)
45 {
46 return __builtin_vis_read_gsr ();
47 }
48
49 extern __inline void *
50 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
51 __vis_alignaddr (void *__A, long __B)
52 {
53 return __builtin_vis_alignaddr (__A, __B);
54 }
55
56 extern __inline void *
57 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
58 __vis_alignaddrl (void *__A, long __B)
59 {
60 return __builtin_vis_alignaddrl (__A, __B);
61 }
62
63 extern __inline __i64
64 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
65 __vis_faligndatadi (__i64 __A, __i64 __B)
66 {
67 return __builtin_vis_faligndatadi (__A, __B);
68 }
69
70 extern __inline __v2si
71 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
72 __vis_faligndatav2si (__v2si __A, __v2si __B)
73 {
74 return __builtin_vis_faligndatav2si (__A, __B);
75 }
76
77 extern __inline __v4hi
78 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
79 __vis_faligndatav4hi (__v4hi __A, __v4hi __B)
80 {
81 return __builtin_vis_faligndatav4hi (__A, __B);
82 }
83
84 extern __inline __v8qi
85 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
86 __vis_faligndatav8qi (__v8qi __A, __v8qi __B)
87 {
88 return __builtin_vis_faligndatav8qi (__A, __B);
89 }
90
91 extern __inline __v4hi
92 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
93 __vis_fexpand (__v4qi __A)
94 {
95 return __builtin_vis_fexpand (__A);
96 }
97
98 extern __inline __v4hi
99 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
100 __vis_fmul8x16 (__v4qi __A, __v4hi __B)
101 {
102 return __builtin_vis_fmul8x16 (__A, __B);
103 }
104
105 extern __inline __v4hi
106 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
107 __vis_fmul8x16au (__v4qi __A, __v2hi __B)
108 {
109 return __builtin_vis_fmul8x16au (__A, __B);
110 }
111
112 extern __inline __v4hi
113 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
114 __vis_fmul8x16al (__v4qi __A, __v2hi __B)
115 {
116 return __builtin_vis_fmul8x16al (__A, __B);
117 }
118
119 extern __inline __v4hi
120 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
121 __vis_fmul8sux16 (__v8qi __A, __v4hi __B)
122 {
123 return __builtin_vis_fmul8sux16 (__A, __B);
124 }
125
126 extern __inline __v4hi
127 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
128 __vis_fmul8ulx16 (__v8qi __A, __v4hi __B)
129 {
130 return __builtin_vis_fmul8ulx16 (__A, __B);
131 }
132
133 extern __inline __v2si
134 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
135 __vis_fmuld8sux16 (__v4qi __A, __v2hi __B)
136 {
137 return __builtin_vis_fmuld8sux16 (__A, __B);
138 }
139
140 extern __inline __v2si
141 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
142 __vis_fmuld8ulx16 (__v4qi __A, __v2hi __B)
143 {
144 return __builtin_vis_fmuld8ulx16 (__A, __B);
145 }
146
147 extern __inline __v4qi
148 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
149 __vis_fpack16 (__v4hi __A)
150 {
151 return __builtin_vis_fpack16 (__A);
152 }
153
154 extern __inline __v8qi
155 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
156 __vis_fpack32 (__v2si __A, __v8qi __B)
157 {
158 return __builtin_vis_fpack32 (__A, __B);
159 }
160
161 extern __inline __v2hi
162 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
163 __vis_fpackfix (__v2si __A)
164 {
165 return __builtin_vis_fpackfix (__A);
166 }
167
168 extern __inline __v8qi
169 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
170 __vis_fpmerge (__v4qi __A, __v4qi __B)
171 {
172 return __builtin_vis_fpmerge (__A, __B);
173 }
174
175 extern __inline __i64
176 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
177 __vis_pdist (__v8qi __A, __v8qi __B, __i64 __C)
178 {
179 return __builtin_vis_pdist (__A, __B, __C);
180 }
181
182 extern __inline long
183 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
184 __vis_edge8 (void *__A, void *__B)
185 {
186 return __builtin_vis_edge8 (__A, __B);
187 }
188
189 extern __inline long
190 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
191 __vis_edge8l (void *__A, void *__B)
192 {
193 return __builtin_vis_edge8l (__A, __B);
194 }
195
196 extern __inline long
197 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
198 __vis_edge16 (void *__A, void *__B)
199 {
200 return __builtin_vis_edge16 (__A, __B);
201 }
202
203 extern __inline long
204 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
205 __vis_edge16l (void *__A, void *__B)
206 {
207 return __builtin_vis_edge16l (__A, __B);
208 }
209
210 extern __inline long
211 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
212 __vis_edge32 (void *__A, void *__B)
213 {
214 return __builtin_vis_edge32 (__A, __B);
215 }
216
217 extern __inline long
218 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
219 __vis_edge32l (void *__A, void *__B)
220 {
221 return __builtin_vis_edge32l (__A, __B);
222 }
223
224 extern __inline long
225 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
226 __vis_fcmple16 (__v4hi __A, __v4hi __B)
227 {
228 return __builtin_vis_fcmple16 (__A, __B);
229 }
230
231 extern __inline long
232 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
233 __vis_fcmple32 (__v2si __A, __v2si __B)
234 {
235 return __builtin_vis_fcmple32 (__A, __B);
236 }
237
238 extern __inline long
239 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
240 __vis_fcmpne16 (__v4hi __A, __v4hi __B)
241 {
242 return __builtin_vis_fcmpne16 (__A, __B);
243 }
244
245 extern __inline long
246 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
247 __vis_fcmpne32 (__v2si __A, __v2si __B)
248 {
249 return __builtin_vis_fcmpne32 (__A, __B);
250 }
251
252 extern __inline long
253 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
254 __vis_fcmpgt16 (__v4hi __A, __v4hi __B)
255 {
256 return __builtin_vis_fcmpgt16 (__A, __B);
257 }
258
259 extern __inline long
260 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
261 __vis_fcmpgt32 (__v2si __A, __v2si __B)
262 {
263 return __builtin_vis_fcmpgt32 (__A, __B);
264 }
265
266 extern __inline long
267 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
268 __vis_fcmpeq16 (__v4hi __A, __v4hi __B)
269 {
270 return __builtin_vis_fcmpeq16 (__A, __B);
271 }
272
273 extern __inline long
274 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
275 __vis_fcmpeq32 (__v2si __A, __v2si __B)
276 {
277 return __builtin_vis_fcmpeq32 (__A, __B);
278 }
279
280 extern __inline __v4hi
281 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
282 __vis_fpadd16 (__v4hi __A, __v4hi __B)
283 {
284 return __builtin_vis_fpadd16 (__A, __B);
285 }
286
287 extern __inline __v2hi
288 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
289 __vis_fpadd16s (__v2hi __A, __v2hi __B)
290 {
291 return __builtin_vis_fpadd16s (__A, __B);
292 }
293
294 extern __inline __v2si
295 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
296 __vis_fpadd32 (__v2si __A, __v2si __B)
297 {
298 return __builtin_vis_fpadd32 (__A, __B);
299 }
300
301 extern __inline __v1si
302 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
303 __vis_fpadd32s (__v1si __A, __v1si __B)
304 {
305 return __builtin_vis_fpadd32s (__A, __B);
306 }
307
308 extern __inline __v4hi
309 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
310 __vis_fpsub16 (__v4hi __A, __v4hi __B)
311 {
312 return __builtin_vis_fpsub16 (__A, __B);
313 }
314
315 extern __inline __v2hi
316 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
317 __vis_fpsub16s (__v2hi __A, __v2hi __B)
318 {
319 return __builtin_vis_fpsub16s (__A, __B);
320 }
321
322 extern __inline __v2si
323 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
324 __vis_fpsub32 (__v2si __A, __v2si __B)
325 {
326 return __builtin_vis_fpsub32 (__A, __B);
327 }
328
329 extern __inline __v1si
330 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
331 __vis_fpsub32s (__v1si __A, __v1si __B)
332 {
333 return __builtin_vis_fpsub32s (__A, __B);
334 }
335
336 extern __inline long
337 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
338 __vis_array8 (long __A, long __B)
339 {
340 return __builtin_vis_array8 (__A, __B);
341 }
342
343 extern __inline long
344 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
345 __vis_array16 (long __A, long __B)
346 {
347 return __builtin_vis_array16 (__A, __B);
348 }
349
350 extern __inline long
351 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
352 __vis_array32 (long __A, long __B)
353 {
354 return __builtin_vis_array32 (__A, __B);
355 }
356
357 extern __inline long
358 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
359 __vis_bmask (long __A, long __B)
360 {
361 return __builtin_vis_bmask (__A, __B);
362 }
363
364 extern __inline __i64
365 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
366 __vis_bshuffledi (__i64 __A, __i64 __B)
367 {
368 return __builtin_vis_bshuffledi (__A, __B);
369 }
370
371 extern __inline __v2si
372 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
373 __vis_bshufflev2si (__v2si __A, __v2si __B)
374 {
375 return __builtin_vis_bshufflev2si (__A, __B);
376 }
377
378 extern __inline __v4hi
379 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
380 __vis_bshufflev4hi (__v4hi __A, __v4hi __B)
381 {
382 return __builtin_vis_bshufflev4hi (__A, __B);
383 }
384
385 extern __inline __v8qi
386 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
387 __vis_bshufflev8qi (__v8qi __A, __v8qi __B)
388 {
389 return __builtin_vis_bshufflev8qi (__A, __B);
390 }
391
392 extern __inline long
393 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
394 __vis_edge8n (void *__A, void *__B)
395 {
396 return __builtin_vis_edge8n (__A, __B);
397 }
398
399 extern __inline long
400 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
401 __vis_edge8ln (void *__A, void *__B)
402 {
403 return __builtin_vis_edge8ln (__A, __B);
404 }
405
406 extern __inline long
407 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
408 __vis_edge16n (void *__A, void *__B)
409 {
410 return __builtin_vis_edge16n (__A, __B);
411 }
412
413 extern __inline long
414 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
415 __vis_edge16ln (void *__A, void *__B)
416 {
417 return __builtin_vis_edge16ln (__A, __B);
418 }
419
420 extern __inline long
421 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
422 __vis_edge32n (void *__A, void *__B)
423 {
424 return __builtin_vis_edge32n (__A, __B);
425 }
426
427 extern __inline long
428 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
429 __vis_edge32ln (void *__A, void *__B)
430 {
431 return __builtin_vis_edge32ln (__A, __B);
432 }
433
434 extern __inline void
435 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
436 __vis_cmask8 (long __A)
437 {
438 return __builtin_vis_cmask8 (__A);
439 }
440
441 extern __inline void
442 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
443 __vis_cmask16 (long __A)
444 {
445 return __builtin_vis_cmask16 (__A);
446 }
447
448 extern __inline void
449 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
450 __vis_cmask32 (long __A)
451 {
452 return __builtin_vis_cmask32 (__A);
453 }
454
455 extern __inline __v4hi
456 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
457 __vis_fchksm16 (__v4hi __A, __v4hi __B)
458 {
459 return __builtin_vis_fchksm16 (__A, __B);
460 }
461
462 extern __inline __v4hi
463 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
464 __vis_fsll16 (__v4hi __A, __v4hi __B)
465 {
466 return __builtin_vis_fsll16 (__A, __B);
467 }
468
469 extern __inline __v4hi
470 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
471 __vis_fslas16 (__v4hi __A, __v4hi __B)
472 {
473 return __builtin_vis_fslas16 (__A, __B);
474 }
475
476 extern __inline __v4hi
477 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
478 __vis_fsrl16 (__v4hi __A, __v4hi __B)
479 {
480 return __builtin_vis_fsrl16 (__A, __B);
481 }
482
483 extern __inline __v4hi
484 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
485 __vis_fsra16 (__v4hi __A, __v4hi __B)
486 {
487 return __builtin_vis_fsra16 (__A, __B);
488 }
489
490 extern __inline __v2si
491 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
492 __vis_fsll32 (__v2si __A, __v2si __B)
493 {
494 return __builtin_vis_fsll32 (__A, __B);
495 }
496
497 extern __inline __v2si
498 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
499 __vis_fslas32 (__v2si __A, __v2si __B)
500 {
501 return __builtin_vis_fslas32 (__A, __B);
502 }
503
504 extern __inline __v2si
505 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
506 __vis_fsrl32 (__v2si __A, __v2si __B)
507 {
508 return __builtin_vis_fsrl32 (__A, __B);
509 }
510
511 extern __inline __v2si
512 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
513 __vis_fsra32 (__v2si __A, __v2si __B)
514 {
515 return __builtin_vis_fsra32 (__A, __B);
516 }
517
518 extern __inline long
519 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
520 __vis_pdistn (__v8qi __A, __v8qi __B)
521 {
522 return __builtin_vis_pdistn (__A, __B);
523 }
524
525 extern __inline __v4hi
526 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
527 __vis_fmean16 (__v4hi __A, __v4hi __B)
528 {
529 return __builtin_vis_fmean16 (__A, __B);
530 }
531
532 extern __inline __i64
533 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
534 __vis_fpadd64 (__i64 __A, __i64 __B)
535 {
536 return __builtin_vis_fpadd64 (__A, __B);
537 }
538
539 extern __inline __i64
540 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
541 __vis_fpsub64 (__i64 __A, __i64 __B)
542 {
543 return __builtin_vis_fpsub64 (__A, __B);
544 }
545
546 extern __inline __v4hi
547 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
548 __vis_fpadds16 (__v4hi __A, __v4hi __B)
549 {
550 return __builtin_vis_fpadds16 (__A, __B);
551 }
552
553 extern __inline __v2hi
554 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
555 __vis_fpadds16s (__v2hi __A, __v2hi __B)
556 {
557 return __builtin_vis_fpadds16s (__A, __B);
558 }
559
560 extern __inline __v4hi
561 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
562 __vis_fpsubs16 (__v4hi __A, __v4hi __B)
563 {
564 return __builtin_vis_fpsubs16 (__A, __B);
565 }
566
567 extern __inline __v2hi
568 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
569 __vis_fpsubs16s (__v2hi __A, __v2hi __B)
570 {
571 return __builtin_vis_fpsubs16s (__A, __B);
572 }
573
574 extern __inline __v2si
575 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
576 __vis_fpadds32 (__v2si __A, __v2si __B)
577 {
578 return __builtin_vis_fpadds32 (__A, __B);
579 }
580
581 extern __inline __v1si
582 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
583 __vis_fpadds32s (__v1si __A, __v1si __B)
584 {
585 return __builtin_vis_fpadds32s (__A, __B);
586 }
587
588 extern __inline __v2si
589 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
590 __vis_fpsubs32 (__v2si __A, __v2si __B)
591 {
592 return __builtin_vis_fpsubs32 (__A, __B);
593 }
594
595 extern __inline __v1si
596 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
597 __vis_fpsubs32s (__v1si __A, __v1si __B)
598 {
599 return __builtin_vis_fpsubs32s (__A, __B);
600 }
601
602 extern __inline long
603 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
604 __vis_fucmple8 (__v8qi __A, __v8qi __B)
605 {
606 return __builtin_vis_fucmple8 (__A, __B);
607 }
608
609 extern __inline long
610 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
611 __vis_fucmpne8 (__v8qi __A, __v8qi __B)
612 {
613 return __builtin_vis_fucmpne8 (__A, __B);
614 }
615
616 extern __inline long
617 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
618 __vis_fucmpgt8 (__v8qi __A, __v8qi __B)
619 {
620 return __builtin_vis_fucmpgt8 (__A, __B);
621 }
622
623 extern __inline long
624 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
625 __vis_fucmpeq8 (__v8qi __A, __v8qi __B)
626 {
627 return __builtin_vis_fucmpeq8 (__A, __B);
628 }
629
630 #endif /* _VISINTRIN_H_INCLUDED */