| 1 |
/* { dg-do run { target { powerpc*-*-* } } } */ |
| 2 |
/* { dg-require-effective-target lp64 } */ |
| 3 |
/* { dg-require-effective-target p9vector_hw } */ |
| 4 |
/* { dg-options "-mdejagnu-cpu=power9" } */ |
| 5 |
|
| 6 |
/* This test should succeed only on 64-bit configurations. */ |
| 7 |
#include <altivec.h> |
| 8 |
#include <stdlib.h> |
| 9 |
|
| 10 |
__ieee128 |
| 11 |
insert_exponent (__ieee128 *significand_p, |
| 12 |
unsigned long long int *exponent_p) |
| 13 |
{ |
| 14 |
__ieee128 significand = *significand_p; |
| 15 |
unsigned long long int exponent = *exponent_p; |
| 16 |
|
| 17 |
return scalar_insert_exp (significand, exponent); |
| 18 |
} |
| 19 |
|
| 20 |
#define BIAS_FOR_QUAD_EXP 16383 |
| 21 |
|
| 22 |
int |
| 23 |
main () |
| 24 |
{ |
| 25 |
/* most-significant bit @13, shift it to position 113 */ |
| 26 |
unsigned __int128 significand_1 = ((unsigned __int128) 0x1100) << 100; |
| 27 |
unsigned __int128 significand_2 = ((unsigned __int128) 0x1101) << 100; |
| 28 |
unsigned long long int exponent_1 = 126 + BIAS_FOR_QUAD_EXP; |
| 29 |
unsigned long long int exponent_2 = 124 + BIAS_FOR_QUAD_EXP; |
| 30 |
|
| 31 |
__ieee128 *significand_1_ptr = (__ieee128 *) &significand_1; |
| 32 |
__ieee128 *significand_2_ptr = (__ieee128 *) &significand_2; |
| 33 |
|
| 34 |
__ieee128 x = (__ieee128) (((__int128) 0x1100LL) << 114); |
| 35 |
__ieee128 z = (__ieee128) (((__int128) 0x1101LL) << 112); |
| 36 |
|
| 37 |
if (insert_exponent (significand_1_ptr, &exponent_1) != x) |
| 38 |
abort (); |
| 39 |
if (insert_exponent (significand_2_ptr, &exponent_2) != z) |
| 40 |
abort (); |
| 41 |
return 0; |
| 42 |
} |