Debian Codegraph @

gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-sig-7.c

raw
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 unsigned __int128
11 get_significand (__ieee128 *p)
12 {
13 __ieee128 source = *p;
14
15 return scalar_extract_sig (source);
16 }
17
18 int
19 main ()
20 {
21 __ieee128 x = (__ieee128) (((__int128) 0x1100LL) << 114);
22 __ieee128 z = (__ieee128) (((__int128) 0x1101LL) << 112);
23
24 /* 113 bits in the significand */
25 /* our constant mantissas have 13 bits */
26
27 unsigned __int128 first_anticipated_result = ((__int128) 0x1100LL) << 100;
28 unsigned __int128 second_anticipated_result = ((__int128) 0x1101LL) << 100;
29
30 if (get_significand (&x) != first_anticipated_result)
31 abort ();
32 if (get_significand (&z) != second_anticipated_result)
33 abort ();
34 return 0;
35 }