2017-08-28 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / cell_builtin-3.c
blob6f808611346a070cccee69f9bd1c245609afa861
1 /* { dg-do compile { target { powerpc*-*-* } } } */
2 /* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
3 /* { dg-require-effective-target powerpc_altivec_ok } */
4 /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=cell" } } */
5 /* { dg-options "-O2 -maltivec -mcpu=cell" } */
6 /* { dg-final { scan-assembler-times "lvrx" 19 } } */
8 #include <altivec.h>
10 typedef __vector signed char vsc;
11 typedef __vector signed short vss;
12 typedef __vector signed int vsi;
13 typedef __vector unsigned char vuc;
14 typedef __vector unsigned short vus;
15 typedef __vector unsigned int vui;
16 typedef __vector bool char vbc;
17 typedef __vector bool short vbs;
18 typedef __vector bool int vbi;
19 typedef __vector float vsf;
20 typedef __vector pixel vp;
21 typedef signed char sc;
22 typedef signed short ss;
23 typedef signed int si;
24 typedef signed long sl;
25 typedef unsigned char uc;
26 typedef unsigned short us;
27 typedef unsigned int ui;
28 typedef unsigned long ul;
29 typedef float sf;
31 vsc lc3(long a, void *p) { return __builtin_altivec_lvrx (a,p); }
32 vsf lrx01(long a, vsf *p) { return __builtin_vec_lvrx (a,p); }
33 vsf lrx02(long a, sf *p) { return __builtin_vec_lvrx (a,p); }
34 vbi lrx03(long a, vbi *p) { return __builtin_vec_lvrx (a,p); }
35 vsi lrx04(long a, vsi *p) { return __builtin_vec_lvrx (a,p); }
36 vsi lrx05(long a, si *p) { return __builtin_vec_lvrx (a,p); }
37 vui lrx06(long a, vui *p) { return __builtin_vec_lvrx (a,p); }
38 vui lrx07(long a, ui *p) { return __builtin_vec_lvrx (a,p); }
39 vbs lrx08(long a, vbs *p) { return __builtin_vec_lvrx (a,p); }
40 vp lrx09(long a, vp *p) { return __builtin_vec_lvrx (a,p); }
41 vss lrx10(long a, vss *p) { return __builtin_vec_lvrx (a,p); }
42 vss lrx11(long a, ss *p) { return __builtin_vec_lvrx (a,p); }
43 vus lrx12(long a, vus *p) { return __builtin_vec_lvrx (a,p); }
44 vus lrx13(long a, us *p) { return __builtin_vec_lvrx (a,p); }
45 vbc lrx14(long a, vbc *p) { return __builtin_vec_lvrx (a,p); }
46 vsc lrx15(long a, vsc *p) { return __builtin_vec_lvrx (a,p); }
47 vsc lrx16(long a, sc *p) { return __builtin_vec_lvrx (a,p); }
48 vuc lrx17(long a, vuc *p) { return __builtin_vec_lvrx (a,p); }
49 vuc lrx18(long a, uc *p) { return __builtin_vec_lvrx (a,p); }