| 1 |
#ifdef __UINT64_TYPE__ |
| 2 |
typedef __UINT64_TYPE__ uint64_t; |
| 3 |
#else |
| 4 |
typedef unsigned long long uint64_t; |
| 5 |
#endif |
| 6 |
|
| 7 |
#ifndef __SIZEOF_INT128__ |
| 8 |
#define __int128 long long |
| 9 |
#endif |
| 10 |
|
| 11 |
/* Some version of bswap optimization would ICE when analyzing a mask constant |
| 12 |
too big for an uint64_t variable (PR210931). */ |
| 13 |
|
| 14 |
__attribute__ ((noinline, noclone)) uint64_t |
| 15 |
uint128_central_bitsi_ior (unsigned __int128 in1, uint64_t in2) |
| 16 |
{ |
| 17 |
__int128 mask = (__int128)0xffff << 56; |
| 18 |
return ((in1 & mask) >> 56) | in2; |
| 19 |
} |
| 20 |
|
| 21 |
int |
| 22 |
main(int argc, char **argv) |
| 23 |
{ |
| 24 |
__int128 in = 1; |
| 25 |
#ifdef __SIZEOF_INT128__ |
| 26 |
in <<= 64; |
| 27 |
#endif |
| 28 |
if (sizeof (uint64_t) * __CHAR_BIT__ != 64) |
| 29 |
return 0; |
| 30 |
if (sizeof (unsigned __int128) * __CHAR_BIT__ != 128) |
| 31 |
return 0; |
| 32 |
if (uint128_central_bitsi_ior (in, 2) != 0x102) |
| 33 |
__builtin_abort (); |
| 34 |
return 0; |
| 35 |
} |