gcc/testsuite/ChangeLog:
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / builtins-3-p8.c
blobbc1c85082036556a9d065d113265e65efb8271d0
1 /* { dg-do compile } */
2 /* { dg-require-effective-target powerpc_p8vector_ok } */
3 /* { dg-options "-mcpu=power8" } */
5 #include <altivec.h>
7 vector bool long long
8 test_eq_long_long (vector bool long long x, vector bool long long y)
10 return vec_cmpeq (x, y);
13 vector float
14 test_pack_float (vector double x, vector double y)
16 return vec_pack (x, y);
19 vector signed int
20 test_vsi_packs_vsll_vsll (vector signed long long x,
21 vector signed long long y)
23 return vec_packs (x, y);
26 vector unsigned int
27 test_vui_packs_vull_vull (vector unsigned long long x,
28 vector unsigned long long y)
30 return vec_packs (x, y);
33 vector unsigned char
34 test_unsigned_char_popcnt_signed_char (vector signed char x)
36 return vec_popcnt (x);
39 vector unsigned char
40 test_unsigned_char_popcnt_unsigned_char (vector unsigned char x)
42 return vec_popcnt (x);
45 vector unsigned short
46 test_unsigned_short_popcnt_signed_short (vector short x)
48 return vec_popcnt (x);
51 vector unsigned short
52 test_unsigned_short_popcnt_unsigned_short (vector unsigned short x)
54 return vec_popcnt (x);
57 vector unsigned int
58 test_unsigned_int_popcnt_signed_int (vector int x)
60 return vec_popcnt (x);
63 vector unsigned int
64 test_unsigned_int_popcnt_unsigned_int (vector unsigned x)
66 return vec_popcnt (x);
69 vector unsigned long long
70 test_unsigned_long_lont_popcnt_signed_long (vector long long x)
72 return vec_popcnt (x);
75 vector unsigned long long
76 test_unsigned_long_long_popcnt_unsigned_long (vector unsigned long long x)
78 return vec_popcnt (x);
81 vector signed short
82 test_vss_mradds_vss_vss (vector signed short x, vector signed short y,
83 vector signed short z)
85 return vec_mradds (x, y, z);
88 vector signed long long
89 test_vsll_mule_vsi_vsi (vector signed int x, vector signed int y)
91 return vec_mule (x, y);
94 vector unsigned long long
95 test_vull_mule_vui_vui (vector unsigned int x, vector unsigned int y)
97 return vec_mule (x, y);
100 vector signed long long
101 test_vsll_mulo_vsi_vsi (vector signed int x, vector signed int y)
103 return vec_mulo (x, y);
106 vector unsigned long long
107 test_vull_mulo_vui_vui (vector unsigned int x, vector unsigned int y)
109 return vec_mulo (x, y);
112 /* Expected test results:
114 test_eq_long_long 1 vcmpequd inst
115 test_pack_float 1 vpkudum inst
116 test_vsi_packs_vsll_vsll 1 vpksdss
117 test_vui_packs_vull_vull 1 vpkudus
118 test_unsigned_char_popcnt_signed_char 1 vpopcntb
119 test_unsigned_char_popcnt_unsigned_char 1 vpopcntb
120 test_unsigned_short_popcnt_signed_short 1 vpopcnth
121 test_unsigned_short_popcnt_unsigned_short 1 vpopcnth
122 test_unsigned_int_popcnt_signed_int 2 vpopcntw
123 test_unsigned_int_popcnt_unsigned_int 1 vpopcntd
124 test_unsigned_long_long_popcnt_unsigned_long 1 vpopcntd
125 test_vss_mradds_vss_vsss 1 vmhraddshs
126 test_vsll_mulo_vsi_vsi 1 vmulosw
127 test_vull_mulo_vui_vui 1 vmulouw
128 test_vsll_mule_vsi_vsi 1 vmulesw
129 test_vull_mule_vui_vui 1 vmuleuw
132 /* { dg-final { scan-assembler-times "vcmpequd" 1 } } */
133 /* { dg-final { scan-assembler-times "vpkudum" 1 } } */
134 /* { dg-final { scan-assembler-times "vpksdss" 1 } } */
135 /* { dg-final { scan-assembler-times "vpkudus" 1 } } */
136 /* { dg-final { scan-assembler-times "vpopcntb" 2 } } */
137 /* { dg-final { scan-assembler-times "vpopcnth" 2 } } */
138 /* { dg-final { scan-assembler-times "vpopcntw" 2 } } */
139 /* { dg-final { scan-assembler-times "vpopcntd" 2 } } */
140 /* { dg-final { scan-assembler-times "vmhraddshs" 1 } } */
141 /* { dg-final { scan-assembler-times "vmulosw" 1 } } */
142 /* { dg-final { scan-assembler-times "vmulouw" 1 } } */
143 /* { dg-final { scan-assembler-times "vmulesw" 1 } } */
144 /* { dg-final { scan-assembler-times "vmuleuw" 1 } } */