PR target/80969 - Fix ICE with -mabi=ms -mavx512f, reduce wasted space when realignin...
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / pr31167.c
blob43d9f848bdfadb07dedc30b6b033d2b649ce759b
1 /* { dg-do compile } */
2 /* { dg-require-effective-target int128 } */
3 /* { dg-options "-O" } */
5 typedef int int32_t;
7 int32_t round32hi (const __int128_t arg)
9 const int SHIFT = 96;
10 const int mshift = 96;
11 const __int128_t M = (~(__int128_t) 0) << mshift;
12 const __int128_t L = (~M) + 1;
13 const __int128_t L1 = ((__int128_t) L) >> 1;
14 const __int128_t Mlo = ((__int128_t) (~M)) >> 1;
15 __int128_t vv = arg & M;
17 if ((arg & (L1)) && ((arg & Mlo) || (arg & L)))
18 vv += L;
20 return (int32_t) (vv >> SHIFT);