| 1 |
/* { dg-do compile { target lp64 } } */ |
| 2 |
/* { dg-options "-mdejagnu-cpu=power9 -mvsx -O2" } */ |
| 3 |
/* { dg-require-effective-target powerpc_vsx } */ |
| 4 |
|
| 5 |
#include <altivec.h> |
| 6 |
|
| 7 |
/* Verify P9 vec_revb builtin generates the XXBR{Q,D,W,H} instructions. This |
| 8 |
test only tests the vector types that need a 64-bit environment. */ |
| 9 |
|
| 10 |
vector long |
| 11 |
rev_long (vector long a) |
| 12 |
{ |
| 13 |
return vec_revb (a); /* XXBRD. */ |
| 14 |
} |
| 15 |
|
| 16 |
vector unsigned long |
| 17 |
rev_ulong (vector unsigned long a) |
| 18 |
{ |
| 19 |
return vec_revb (a); /* XXBRD. */ |
| 20 |
} |
| 21 |
|
| 22 |
vector long long |
| 23 |
rev_long_long (vector long long a) |
| 24 |
{ |
| 25 |
return vec_revb (a); /* XXBRD. */ |
| 26 |
} |
| 27 |
|
| 28 |
vector bool long long |
| 29 |
rev_bool_long_long (vector bool long long a) |
| 30 |
{ |
| 31 |
return vec_revb (a); /* XXBRD. */ |
| 32 |
} |
| 33 |
|
| 34 |
vector unsigned long long |
| 35 |
rev_ulong_ulong (vector unsigned long long a) |
| 36 |
{ |
| 37 |
return vec_revb (a); /* XXBRD. */ |
| 38 |
} |
| 39 |
|
| 40 |
vector __int128_t |
| 41 |
rev_int128 (vector __int128_t a) |
| 42 |
{ |
| 43 |
return vec_revb (a); /* XXBRQ. */ |
| 44 |
} |
| 45 |
|
| 46 |
vector __uint128_t |
| 47 |
rev_uint128 (vector __uint128_t a) |
| 48 |
{ |
| 49 |
return vec_revb (a); /* XXBRQ. */ |
| 50 |
} |
| 51 |
|
| 52 |
/* { dg-final { scan-assembler-times "xxbrd" 5 } } */ |
| 53 |
/* { dg-final { scan-assembler-times "xxbrq" 2 } } */ |