| 1 |
/* { dg-do compile { target lp64 } } */ |
| 2 |
/* { dg-skip-if "" { powerpc*-*-darwin* } } */ |
| 3 |
/* { dg-options "-mdejagnu-cpu=power9 -mvsx -O2" } */ |
| 4 |
/* { dg-require-effective-target int128 } */ |
| 5 |
/* { dg-require-effective-target powerpc_vsx } */ |
| 6 |
|
| 7 |
#include <altivec.h> |
| 8 |
|
| 9 |
vector int |
| 10 |
parity_v4si_1s (vector int a) |
| 11 |
{ |
| 12 |
return vec_vprtyb (a); |
| 13 |
} |
| 14 |
|
| 15 |
vector int |
| 16 |
parity_v4si_2s (vector int a) |
| 17 |
{ |
| 18 |
return vec_vprtybw (a); |
| 19 |
} |
| 20 |
|
| 21 |
vector unsigned int |
| 22 |
parity_v4si_1u (vector unsigned int a) |
| 23 |
{ |
| 24 |
return vec_vprtyb (a); |
| 25 |
} |
| 26 |
|
| 27 |
vector unsigned int |
| 28 |
parity_v4si_2u (vector unsigned int a) |
| 29 |
{ |
| 30 |
return vec_vprtybw (a); |
| 31 |
} |
| 32 |
|
| 33 |
vector long long |
| 34 |
parity_v2di_1s (vector long long a) |
| 35 |
{ |
| 36 |
return vec_vprtyb (a); |
| 37 |
} |
| 38 |
|
| 39 |
vector long long |
| 40 |
parity_v2di_2s (vector long long a) |
| 41 |
{ |
| 42 |
return vec_vprtybd (a); |
| 43 |
} |
| 44 |
|
| 45 |
vector unsigned long long |
| 46 |
parity_v2di_1u (vector unsigned long long a) |
| 47 |
{ |
| 48 |
return vec_vprtyb (a); |
| 49 |
} |
| 50 |
|
| 51 |
vector unsigned long long |
| 52 |
parity_v2di_2u (vector unsigned long long a) |
| 53 |
{ |
| 54 |
return vec_vprtybd (a); |
| 55 |
} |
| 56 |
|
| 57 |
vector __int128_t |
| 58 |
parity_v1ti_1s (vector __int128_t a) |
| 59 |
{ |
| 60 |
return vec_vprtyb (a); |
| 61 |
} |
| 62 |
|
| 63 |
vector __int128_t |
| 64 |
parity_v1ti_2s (vector __int128_t a) |
| 65 |
{ |
| 66 |
return vec_vprtybq (a); |
| 67 |
} |
| 68 |
|
| 69 |
__int128_t |
| 70 |
parity_ti_3s (__int128_t a) |
| 71 |
{ |
| 72 |
return vec_vprtyb (a); |
| 73 |
} |
| 74 |
|
| 75 |
__int128_t |
| 76 |
parity_ti_4s (__int128_t a) |
| 77 |
{ |
| 78 |
return vec_vprtybq (a); |
| 79 |
} |
| 80 |
|
| 81 |
vector __uint128_t |
| 82 |
parity_v1ti_1u (vector __uint128_t a) |
| 83 |
{ |
| 84 |
return vec_vprtyb (a); |
| 85 |
} |
| 86 |
|
| 87 |
vector __uint128_t |
| 88 |
parity_v1ti_2u (vector __uint128_t a) |
| 89 |
{ |
| 90 |
return vec_vprtybq (a); |
| 91 |
} |
| 92 |
|
| 93 |
__uint128_t |
| 94 |
parity_ti_3u (__uint128_t a) |
| 95 |
{ |
| 96 |
return vec_vprtyb (a); |
| 97 |
} |
| 98 |
|
| 99 |
__uint128_t |
| 100 |
parity_ti_4u (__uint128_t a) |
| 101 |
{ |
| 102 |
return vec_vprtybq (a); |
| 103 |
} |
| 104 |
|
| 105 |
/* { dg-final { scan-assembler "vprtybd" } } */ |
| 106 |
/* { dg-final { scan-assembler "vprtybq" } } */ |
| 107 |
/* { dg-final { scan-assembler "vprtybw" } } */ |
| 108 |
/* { dg-final { scan-assembler-not "vpopcntb" } } */ |