1 /* Copyright (C) 2011 Free Software Foundation, Inc.
3 This file is part of GCC.
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)
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.
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.
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/>. */
24 #ifndef _VISINTRIN_H_INCLUDED
25 #define _VISINTRIN_H_INCLUDED
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
)));
36 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
37 __vis_write_gsr (__i64 __A
)
39 __builtin_vis_write_gsr (__A
);
43 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
46 return __builtin_vis_read_gsr ();
49 extern __inline
void *
50 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
51 __vis_alignaddr (void *__A
, long __B
)
53 return __builtin_vis_alignaddr (__A
, __B
);
56 extern __inline
void *
57 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
58 __vis_alignaddrl (void *__A
, long __B
)
60 return __builtin_vis_alignaddrl (__A
, __B
);
64 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
65 __vis_faligndatadi (__i64 __A
, __i64 __B
)
67 return __builtin_vis_faligndatadi (__A
, __B
);
70 extern __inline __v2si
71 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
72 __vis_faligndatav2si (__v2si __A
, __v2si __B
)
74 return __builtin_vis_faligndatav2si (__A
, __B
);
77 extern __inline __v4hi
78 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
79 __vis_faligndatav4hi (__v4hi __A
, __v4hi __B
)
81 return __builtin_vis_faligndatav4hi (__A
, __B
);
84 extern __inline __v8qi
85 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
86 __vis_faligndatav8qi (__v8qi __A
, __v8qi __B
)
88 return __builtin_vis_faligndatav8qi (__A
, __B
);
91 extern __inline __v4hi
92 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
93 __vis_fexpand (__v4qi __A
)
95 return __builtin_vis_fexpand (__A
);
98 extern __inline __v4hi
99 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
100 __vis_fmul8x16 (__v4qi __A
, __v4hi __B
)
102 return __builtin_vis_fmul8x16 (__A
, __B
);
105 extern __inline __v4hi
106 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
107 __vis_fmul8x16au (__v4qi __A
, __v2hi __B
)
109 return __builtin_vis_fmul8x16au (__A
, __B
);
112 extern __inline __v4hi
113 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
114 __vis_fmul8x16al (__v4qi __A
, __v2hi __B
)
116 return __builtin_vis_fmul8x16al (__A
, __B
);
119 extern __inline __v4hi
120 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
121 __vis_fmul8sux16 (__v8qi __A
, __v4hi __B
)
123 return __builtin_vis_fmul8sux16 (__A
, __B
);
126 extern __inline __v4hi
127 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
128 __vis_fmul8ulx16 (__v8qi __A
, __v4hi __B
)
130 return __builtin_vis_fmul8ulx16 (__A
, __B
);
133 extern __inline __v2si
134 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
135 __vis_fmuld8sux16 (__v4qi __A
, __v2hi __B
)
137 return __builtin_vis_fmuld8sux16 (__A
, __B
);
140 extern __inline __v2si
141 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
142 __vis_fmuld8ulx16 (__v4qi __A
, __v2hi __B
)
144 return __builtin_vis_fmuld8ulx16 (__A
, __B
);
147 extern __inline __v4qi
148 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
149 __vis_fpack16 (__v4hi __A
)
151 return __builtin_vis_fpack16 (__A
);
154 extern __inline __v8qi
155 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
156 __vis_fpack32 (__v2si __A
, __v8qi __B
)
158 return __builtin_vis_fpack32 (__A
, __B
);
161 extern __inline __v2hi
162 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
163 __vis_fpackfix (__v2si __A
)
165 return __builtin_vis_fpackfix (__A
);
168 extern __inline __v8qi
169 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
170 __vis_fpmerge (__v4qi __A
, __v4qi __B
)
172 return __builtin_vis_fpmerge (__A
, __B
);
175 extern __inline __i64
176 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
177 __vis_pdist (__v8qi __A
, __v8qi __B
, __i64 __C
)
179 return __builtin_vis_pdist (__A
, __B
, __C
);
183 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
184 __vis_edge8 (void *__A
, void *__B
)
186 return __builtin_vis_edge8 (__A
, __B
);
190 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
191 __vis_edge8l (void *__A
, void *__B
)
193 return __builtin_vis_edge8l (__A
, __B
);
197 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
198 __vis_edge16 (void *__A
, void *__B
)
200 return __builtin_vis_edge16 (__A
, __B
);
204 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
205 __vis_edge16l (void *__A
, void *__B
)
207 return __builtin_vis_edge16l (__A
, __B
);
211 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
212 __vis_edge32 (void *__A
, void *__B
)
214 return __builtin_vis_edge32 (__A
, __B
);
218 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
219 __vis_edge32l (void *__A
, void *__B
)
221 return __builtin_vis_edge32l (__A
, __B
);
225 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
226 __vis_fcmple16 (__v4hi __A
, __v4hi __B
)
228 return __builtin_vis_fcmple16 (__A
, __B
);
232 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
233 __vis_fcmple32 (__v2si __A
, __v2si __B
)
235 return __builtin_vis_fcmple32 (__A
, __B
);
239 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
240 __vis_fcmpne16 (__v4hi __A
, __v4hi __B
)
242 return __builtin_vis_fcmpne16 (__A
, __B
);
246 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
247 __vis_fcmpne32 (__v2si __A
, __v2si __B
)
249 return __builtin_vis_fcmpne32 (__A
, __B
);
253 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
254 __vis_fcmpgt16 (__v4hi __A
, __v4hi __B
)
256 return __builtin_vis_fcmpgt16 (__A
, __B
);
260 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
261 __vis_fcmpgt32 (__v2si __A
, __v2si __B
)
263 return __builtin_vis_fcmpgt32 (__A
, __B
);
267 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
268 __vis_fcmpeq16 (__v4hi __A
, __v4hi __B
)
270 return __builtin_vis_fcmpeq16 (__A
, __B
);
274 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
275 __vis_fcmpeq32 (__v2si __A
, __v2si __B
)
277 return __builtin_vis_fcmpeq32 (__A
, __B
);
280 extern __inline __v4hi
281 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
282 __vis_fpadd16 (__v4hi __A
, __v4hi __B
)
284 return __builtin_vis_fpadd16 (__A
, __B
);
287 extern __inline __v2hi
288 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
289 __vis_fpadd16s (__v2hi __A
, __v2hi __B
)
291 return __builtin_vis_fpadd16s (__A
, __B
);
294 extern __inline __v2si
295 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
296 __vis_fpadd32 (__v2si __A
, __v2si __B
)
298 return __builtin_vis_fpadd32 (__A
, __B
);
301 extern __inline __v1si
302 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
303 __vis_fpadd32s (__v1si __A
, __v1si __B
)
305 return __builtin_vis_fpadd32s (__A
, __B
);
308 extern __inline __v4hi
309 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
310 __vis_fpsub16 (__v4hi __A
, __v4hi __B
)
312 return __builtin_vis_fpsub16 (__A
, __B
);
315 extern __inline __v2hi
316 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
317 __vis_fpsub16s (__v2hi __A
, __v2hi __B
)
319 return __builtin_vis_fpsub16s (__A
, __B
);
322 extern __inline __v2si
323 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
324 __vis_fpsub32 (__v2si __A
, __v2si __B
)
326 return __builtin_vis_fpsub32 (__A
, __B
);
329 extern __inline __v1si
330 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
331 __vis_fpsub32s (__v1si __A
, __v1si __B
)
333 return __builtin_vis_fpsub32s (__A
, __B
);
337 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
338 __vis_array8 (long __A
, long __B
)
340 return __builtin_vis_array8 (__A
, __B
);
344 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
345 __vis_array16 (long __A
, long __B
)
347 return __builtin_vis_array16 (__A
, __B
);
351 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
352 __vis_array32 (long __A
, long __B
)
354 return __builtin_vis_array32 (__A
, __B
);
358 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
359 __vis_bmask (long __A
, long __B
)
361 return __builtin_vis_bmask (__A
, __B
);
364 extern __inline __i64
365 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
366 __vis_bshuffledi (__i64 __A
, __i64 __B
)
368 return __builtin_vis_bshuffledi (__A
, __B
);
371 extern __inline __v2si
372 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
373 __vis_bshufflev2si (__v2si __A
, __v2si __B
)
375 return __builtin_vis_bshufflev2si (__A
, __B
);
378 extern __inline __v4hi
379 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
380 __vis_bshufflev4hi (__v4hi __A
, __v4hi __B
)
382 return __builtin_vis_bshufflev4hi (__A
, __B
);
385 extern __inline __v8qi
386 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
387 __vis_bshufflev8qi (__v8qi __A
, __v8qi __B
)
389 return __builtin_vis_bshufflev8qi (__A
, __B
);
393 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
394 __vis_edge8n (void *__A
, void *__B
)
396 return __builtin_vis_edge8n (__A
, __B
);
400 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
401 __vis_edge8ln (void *__A
, void *__B
)
403 return __builtin_vis_edge8ln (__A
, __B
);
407 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
408 __vis_edge16n (void *__A
, void *__B
)
410 return __builtin_vis_edge16n (__A
, __B
);
414 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
415 __vis_edge16ln (void *__A
, void *__B
)
417 return __builtin_vis_edge16ln (__A
, __B
);
421 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
422 __vis_edge32n (void *__A
, void *__B
)
424 return __builtin_vis_edge32n (__A
, __B
);
428 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
429 __vis_edge32ln (void *__A
, void *__B
)
431 return __builtin_vis_edge32ln (__A
, __B
);
435 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
436 __vis_cmask8 (long __A
)
438 return __builtin_vis_cmask8 (__A
);
442 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
443 __vis_cmask16 (long __A
)
445 return __builtin_vis_cmask16 (__A
);
449 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
450 __vis_cmask32 (long __A
)
452 return __builtin_vis_cmask32 (__A
);
455 extern __inline __v4hi
456 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
457 __vis_fchksm16 (__v4hi __A
, __v4hi __B
)
459 return __builtin_vis_fchksm16 (__A
, __B
);
462 extern __inline __v4hi
463 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
464 __vis_fsll16 (__v4hi __A
, __v4hi __B
)
466 return __builtin_vis_fsll16 (__A
, __B
);
469 extern __inline __v4hi
470 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
471 __vis_fslas16 (__v4hi __A
, __v4hi __B
)
473 return __builtin_vis_fslas16 (__A
, __B
);
476 extern __inline __v4hi
477 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
478 __vis_fsrl16 (__v4hi __A
, __v4hi __B
)
480 return __builtin_vis_fsrl16 (__A
, __B
);
483 extern __inline __v4hi
484 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
485 __vis_fsra16 (__v4hi __A
, __v4hi __B
)
487 return __builtin_vis_fsra16 (__A
, __B
);
490 extern __inline __v2si
491 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
492 __vis_fsll32 (__v2si __A
, __v2si __B
)
494 return __builtin_vis_fsll32 (__A
, __B
);
497 extern __inline __v2si
498 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
499 __vis_fslas32 (__v2si __A
, __v2si __B
)
501 return __builtin_vis_fslas32 (__A
, __B
);
504 extern __inline __v2si
505 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
506 __vis_fsrl32 (__v2si __A
, __v2si __B
)
508 return __builtin_vis_fsrl32 (__A
, __B
);
511 extern __inline __v2si
512 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
513 __vis_fsra32 (__v2si __A
, __v2si __B
)
515 return __builtin_vis_fsra32 (__A
, __B
);
519 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
520 __vis_pdistn (__v8qi __A
, __v8qi __B
)
522 return __builtin_vis_pdistn (__A
, __B
);
525 extern __inline __v4hi
526 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
527 __vis_fmean16 (__v4hi __A
, __v4hi __B
)
529 return __builtin_vis_fmean16 (__A
, __B
);
532 extern __inline __i64
533 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
534 __vis_fpadd64 (__i64 __A
, __i64 __B
)
536 return __builtin_vis_fpadd64 (__A
, __B
);
539 extern __inline __i64
540 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
541 __vis_fpsub64 (__i64 __A
, __i64 __B
)
543 return __builtin_vis_fpsub64 (__A
, __B
);
546 extern __inline __v4hi
547 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
548 __vis_fpadds16 (__v4hi __A
, __v4hi __B
)
550 return __builtin_vis_fpadds16 (__A
, __B
);
553 extern __inline __v2hi
554 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
555 __vis_fpadds16s (__v2hi __A
, __v2hi __B
)
557 return __builtin_vis_fpadds16s (__A
, __B
);
560 extern __inline __v4hi
561 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
562 __vis_fpsubs16 (__v4hi __A
, __v4hi __B
)
564 return __builtin_vis_fpsubs16 (__A
, __B
);
567 extern __inline __v2hi
568 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
569 __vis_fpsubs16s (__v2hi __A
, __v2hi __B
)
571 return __builtin_vis_fpsubs16s (__A
, __B
);
574 extern __inline __v2si
575 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
576 __vis_fpadds32 (__v2si __A
, __v2si __B
)
578 return __builtin_vis_fpadds32 (__A
, __B
);
581 extern __inline __v1si
582 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
583 __vis_fpadds32s (__v1si __A
, __v1si __B
)
585 return __builtin_vis_fpadds32s (__A
, __B
);
588 extern __inline __v2si
589 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
590 __vis_fpsubs32 (__v2si __A
, __v2si __B
)
592 return __builtin_vis_fpsubs32 (__A
, __B
);
595 extern __inline __v1si
596 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
597 __vis_fpsubs32s (__v1si __A
, __v1si __B
)
599 return __builtin_vis_fpsubs32s (__A
, __B
);
603 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
604 __vis_fucmple8 (__v8qi __A
, __v8qi __B
)
606 return __builtin_vis_fucmple8 (__A
, __B
);
610 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
611 __vis_fucmpne8 (__v8qi __A
, __v8qi __B
)
613 return __builtin_vis_fucmpne8 (__A
, __B
);
617 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
618 __vis_fucmpgt8 (__v8qi __A
, __v8qi __B
)
620 return __builtin_vis_fucmpgt8 (__A
, __B
);
624 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
625 __vis_fucmpeq8 (__v8qi __A
, __v8qi __B
)
627 return __builtin_vis_fucmpeq8 (__A
, __B
);
630 extern __inline
float
631 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
632 __vis_fhadds (float __A
, float __B
)
634 return __builtin_vis_fhadds (__A
, __B
);
637 extern __inline
double
638 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
639 __vis_fhaddd (double __A
, double __B
)
641 return __builtin_vis_fhaddd (__A
, __B
);
644 extern __inline
float
645 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
646 __vis_fhsubs (float __A
, float __B
)
648 return __builtin_vis_fhsubs (__A
, __B
);
651 extern __inline
double
652 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
653 __vis_fhsubd (double __A
, double __B
)
655 return __builtin_vis_fhsubd (__A
, __B
);
658 extern __inline
float
659 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
660 __vis_fnhadds (float __A
, float __B
)
662 return __builtin_vis_fnhadds (__A
, __B
);
665 extern __inline
double
666 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
667 __vis_fnhaddd (double __A
, double __B
)
669 return __builtin_vis_fnhaddd (__A
, __B
);
672 extern __inline __i64
673 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
674 __vis_umulxhi (__i64 __A
, __i64 __B
)
676 return __builtin_vis_umulxhi (__A
, __B
);
679 extern __inline __i64
680 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
681 __vis_xmulx (__i64 __A
, __i64 __B
)
683 return __builtin_vis_xmulx (__A
, __B
);
686 extern __inline __i64
687 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
688 __vis_xmulxhi (__i64 __A
, __i64 __B
)
690 return __builtin_vis_xmulxhi (__A
, __B
);
693 #endif /* _VISINTRIN_H_INCLUDED */