[15/12] Add further _BitInt <-> floating point tests [PR102989]

Message ID ZPYzJ03Dh62ug596@tucnak
State Unresolved
Headers
Series None |

Checks

Context Check Description
snail/gcc-patch-check warning Git am fail log

Commit Message

Jakub Jelinek Sept. 4, 2023, 7:42 p.m. UTC
  Hi!

I've posted the adjusted patches already on Saturday, here is just
the testsuite additions.

On Fri, Sep 01, 2023 at 09:48:22PM +0000, Joseph Myers wrote:
> 1. Test overflowing conversions to integers (including from inf or NaN) 
> raise FE_INVALID.  (Note: it's not specified in the standard whether 
> inexact conversions to integers raise FE_INEXACT or not, so testing that 
> seems less important.)

This is in gcc.dg/bitint-28.c (FE_INVALID) and gcc.dg/bitint-29.c
(FE_INEXACT) for binary and dfp/bitint-8.c new tests.

> 2. Test conversions from integers to floating point raise FE_INEXACT when 
> inexact, together with FE_OVERFLOW when overflowing (while exact 
> conversions don't raise exceptions).

This is in gcc.dg/bitint-30.c new test.

> 3. Test conversions from integers to floating point respect the rounding 
> mode.

This is in gcc.dg/bitint-31.c new test.

> 4. Test converting floating-point values in the range (-1.0, 0.0] to both 
> unsigned and signed _BitInt; I didn't see such tests for binary floating 
> types, only for decimal types, and the decimal tests didn't include tests 
> of negative zero itself as the value converted to _BitInt.

This is done as incremental changes to existing tests.

> 5. Test conversions of noncanonical BID zero to integers (these tests 
> would be specific to BID).  See below for a bug in this area.

This is done in dfp/bitint-7.c test.

Tested on x86_64-linux.

2023-09-04  Jakub Jelinek  <jakub@redhat.com>

	PR c/102989
	* gcc.dg/torture/bitint-21.c (main): Add tests for -1 for signed only,
	-1 + epsilon, another (-1, 0) range value and -0.
	* gcc.dg/torture/bitint-22.c (main): Likewise.
	* gcc.dg/bitint-28.c: New test.
	* gcc.dg/bitint-29.c: New test.
	* gcc.dg/bitint-30.c: New test.
	* gcc.dg/bitint-31.c: New test.
	* gcc.dg/dfp/bitint-1.c (main): Add tests for -1 for signed only,
	-1 + epsilon and -0.
	* gcc.dg/dfp/bitint-2.c (main): Likewise.
	* gcc.dg/dfp/bitint-3.c (main): Likewise.
	* gcc.dg/dfp/bitint-7.c: New test.
	* gcc.dg/dfp/bitint-8.c: New test.


	Jakub
  

Patch

--- gcc/testsuite/gcc.dg/torture/bitint-21.c.jj	2023-09-04 09:45:47.071866931 +0200
+++ gcc/testsuite/gcc.dg/torture/bitint-21.c	2023-09-04 10:15:25.741715123 +0200
@@ -98,91 +98,91 @@  main ()
 #if __FLT_MANT_DIG__ == 24
 #if __BITINT_MAXWIDTH__ >= 135
   static float flt_135[] = {
-    0.25f, 0.0f, 1.0f, -42.0f, 16777215.25f,
+    -1.0f, -0.96875f, -0.5f, -0.0f, 0.25f, 0.0f, 1.0f, -42.0f, 16777215.25f,
     -50855501824.5f, 39580962846540824576.0f,
     -122147759335346835551823516808712814592.0f,
     -85070591730234615865843651857942052864.0f
   };
   static _BitInt(135) fltr_135[] = {
-    0wb, 0wb, 1wb, -42wb, 16777215wb,
+    -1wb, 0wb, 0wb, 0wb, 0wb, 0wb, 1wb, -42wb, 16777215wb,
     -50855501824wb, 39580962846540824576wb,
     -122147759335346835551823516808712814592wb,
     -85070591730234615865843651857942052864wb
   };
-  for (int i = 0; i < 9; ++i)
+  for (int i = 0; i < 13; ++i)
     if (testflt_135 (flt_135[i]) != fltr_135[i])
       __builtin_abort ();
   static float fltu_135[] = {
-    0.125f, 0.0f, 1.0f, 42.59375f, 16777215.75f,
+    -0.9375f, -0.25f, -0.0f, 0.125f, 0.0f, 1.0f, 42.59375f, 16777215.75f,
     397530272.5f, 1557145973265213792232550652968960.0f,
     69722182498815269047577928656018735104.0f
   };
   static unsigned _BitInt(135) fltur_135[] = {
-    0uwb, 0uwb, 1uwb, 42uwb, 16777216uwb,
+    0uwb, 0uwb, 0uwb, 0uwb, 0uwb, 1uwb, 42uwb, 16777216uwb,
     397530272uwb, 1557145973265213792232550652968960uwb,
     69722182498815269047577928656018735104uwb
   };
-  for (int i = 0; i < 8; ++i)
+  for (int i = 0; i < 11; ++i)
     if (testfltu_135 (fltu_135[i]) != fltur_135[i])
       __builtin_abort ();
 #endif
 #if __BITINT_MAXWIDTH__ >= 192
   static float flt_192[] = {
-    0.625f, 0.0f, 1.0f, -42.0f, 16777215.25f,
+    -0.984375f, -0.75f, -0.0f, 0.625f, 0.0f, 1.0f, -42.0f, 16777215.25f,
     -166724322197504.5f, 7557890186859550768856301568.0f,
     6614377725485260848635133905887821824.0f,
     -85070591730234615865843651857942052864.0f
   };
   static _BitInt(192) fltr_192[] = {
-    0wb, 0wb, 1wb, -42wb, 16777215wb,
+    0wb, 0wb, 0wb, 0wb, 0wb, 1wb, -42wb, 16777215wb,
     -166724322197504wb, 7557890186859550768856301568wb,
     6614377725485260848635133905887821824wb,
     -85070591730234615865843651857942052864wb
   };
-  for (int i = 0; i < 9; ++i)
+  for (int i = 0; i < 12; ++i)
     if (testflt_192 (flt_192[i]) != fltr_192[i])
       __builtin_abort ();
   static float fltu_192[] = {
-    __FLT_MIN__, 0.0f, 1.0f, 42.125f, 16777216.75f,
-    2197600337920.75f, 4591683053408742366929307227985543168.0f,
+    -0.9921875f, -0.125f, -0.0f, __FLT_MIN__, 0.0f, 1.0f, 42.125f,
+    16777216.75f, 2197600337920.75f, 4591683053408742366929307227985543168.0f,
     89668786387864080590151097276117811200.0f
   };
   static unsigned _BitInt(192) fltur_192[] = {
-    0uwb, 0uwb, 1uwb, 42uwb, 16777216uwb,
+    0uwb, 0uwb, 0uwb, 0uwb, 0uwb, 1uwb, 42uwb, 16777216uwb,
     2197600337920uwb, 4591683053408742366929307227985543168uwb,
     89668786387864080590151097276117811200uwb
   };
-  for (int i = 0; i < 8; ++i)
+  for (int i = 0; i < 11; ++i)
     if (testfltu_192 (fltu_192[i]) != fltur_192[i])
       __builtin_abort ();
 #endif
 #if __BITINT_MAXWIDTH__ >= 575
   static float flt_575[] = {
-    0.0001f, 0.0f, 1.0f, -28.0f, 16777214.75f,
+    -0.99609375f, -0.0625f, -0.0f, 0.0001f, 0.0f, 1.0f, -28.0f, 16777214.75f,
     -1321998852554752.5f, 3447217350995641328695097279119360.0f,
     -153684583933125564944797950598195445760.0f,
     -6614377725485260848635133905887821824.0f
   };
   static _BitInt(575) fltr_575[] = {
-    0wb, 0wb, 1wb, -28wb, 16777215wb,
+    0wb, 0wb, 0wb, 0wb, 0wb, 1wb, -28wb, 16777215wb,
     -1321998852554752wb, 3447217350995641328695097279119360wb,
     -153684583933125564944797950598195445760wb,
     -6614377725485260848635133905887821824wb
   };
-  for (int i = 0; i < 9; ++i)
+  for (int i = 0; i < 12; ++i)
     if (testflt_575 (flt_575[i]) != fltr_575[i])
       __builtin_abort ();
   static float fltu_575[] = {
-    4.0f * __FLT_MIN__, 0.0f, 1.0f, 38.125f, 16777210.75f,
-    450604433408.75f, 49420393052787309452540595771398946816.0f,
+    -0.9921875f, -0.125f, -0.0f, 4.0f * __FLT_MIN__, 0.0f, 1.0f, 38.125f,
+    16777210.75f, 450604433408.75f, 49420393052787309452540595771398946816.0f,
     144076816645080570490809349637635309568.0f
   };
   static unsigned _BitInt(575) fltur_575[] = {
-    0uwb, 0uwb, 1uwb, 38uwb, 16777211uwb,
+    0uwb, 0uwb, 0uwb, 0uwb, 0uwb, 1uwb, 38uwb, 16777211uwb,
     450604433408uwb, 49420393052787309452540595771398946816uwb,
     144076816645080570490809349637635309568uwb
   };
-  for (int i = 0; i < 8; ++i)
+  for (int i = 0; i < 11; ++i)
     if (testfltu_575 (fltu_575[i]) != fltur_575[i])
       __builtin_abort ();
 #endif
@@ -190,91 +190,91 @@  main ()
 #if __DBL_MANT_DIG__ == 53
 #if __BITINT_MAXWIDTH__ >= 135
   static double dbl_135[] = {
-    0.25, 0.0, 1.0, -42.0, 4294967295.25,
+    -0.998046875, -0.5, -0.0, 0.25, 0.0, 1.0, -42.0, 4294967295.25,
     -600381955574889.5, 31830517255028909053694705664.0,
     -18738990071541038357046558935673124945920.0,
     -21778071482940061661655974875633165533184.0
   };
   static _BitInt(135) dblr_135[] = {
-    0wb, 0wb, 1wb, -42wb, 4294967295wb,
+    0wb, 0wb, 0wb, 0wb, 0wb, 1wb, -42wb, 4294967295wb,
     -600381955574889wb, 31830517255028909053694705664wb,
     -18738990071541038357046558935673124945920wb,
     -21778071482940061661655974875633165533183wb - 1wb
   };
-  for (int i = 0; i < 9; ++i)
+  for (int i = 0; i < 12; ++i)
     if (testdbl_135 (dbl_135[i]) != dblr_135[i])
       __builtin_abort ();
   static double dblu_135[] = {
-    0.125, 0.0, 1.0, 42.59375, 4294967295.75,
+    -0.9990234375, -0.25, -0.0, 0.125, 0.0, 1.0, 42.59375, 4294967295.75,
     1379919377114330.5, 1887176628826898072984354816.0,
     28122698032432725461429202074509590396928.0
   };
   static unsigned _BitInt(135) dblur_135[] = {
-    0uwb, 0uwb, 1uwb, 42uwb, 4294967295uwb,
+    0uwb, 0uwb, 0uwb, 0uwb, 0uwb, 1uwb, 42uwb, 4294967295uwb,
     1379919377114330uwb, 1887176628826898072984354816uwb,
     28122698032432725461429202074509590396928uwb
   };
-  for (int i = 0; i < 8; ++i)
+  for (int i = 0; i < 11; ++i)
     if (testdblu_135 (dblu_135[i]) != dblur_135[i])
       __builtin_abort ();
 #endif
 #if __BITINT_MAXWIDTH__ >= 192
   static double dbl_192[] = {
-    0.625, 0.0, 1.0, -42.0, 4294967295.25,
+    -0.99951171875, -0.75, -0.0, 0.625, 0.0, 1.0, -42.0, 4294967295.25,
     -334692618508390720.5, 7241713824636372052614321786924022698463985664.0,
     1051470826442514757151114043324296190023320100185399361536.0,
     -3138550867693340381917894711603833208051177722232017256448.0
   };
   static _BitInt(192) dblr_192[] = {
-    0wb, 0wb, 1wb, -42wb, 4294967295wb,
+    0wb, 0wb, 0wb, 0wb, 0wb, 1wb, -42wb, 4294967295wb,
     -334692618508390720wb, 7241713824636372052614321786924022698463985664wb,
     1051470826442514757151114043324296190023320100185399361536wb,
     -3138550867693340381917894711603833208051177722232017256447wb - 1wb
   };
-  for (int i = 0; i < 9; ++i)
+  for (int i = 0; i < 12; ++i)
     if (testdbl_192 (dbl_192[i]) != dblr_192[i])
       __builtin_abort ();
   static double dblu_192[] = {
-    __DBL_MIN__, 0.0, 1.0, 42.125, 4294967296.75,
+    -0.999755859375, -0.25, -0.0, __DBL_MIN__, 0.0, 1.0, 42.125, 4294967296.75,
     85543274084479312.75, 1452517026416706854711122198528.0,
     4878159368183578289135952951143197426988727705359645409280.0
   };
   static unsigned _BitInt(192) dblur_192[] = {
-    0uwb, 0uwb, 1uwb, 42uwb, 4294967296uwb,
+    0uwb, 0uwb, 0uwb, 0uwb, 0uwb, 1uwb, 42uwb, 4294967296uwb,
     85543274084479312uwb, 1452517026416706854711122198528uwb,
     4878159368183578289135952951143197426988727705359645409280uwb
   };
-  for (int i = 0; i < 8; ++i)
+  for (int i = 0; i < 11; ++i)
     if (testdblu_192 (dblu_192[i]) != dblur_192[i])
       __builtin_abort ();
 #endif
 #if __BITINT_MAXWIDTH__ >= 575
   static double dbl_575[] = {
-    0.0001, 0.0, 1.0, -28.0, 4294967294.75,
+    -1.0, -0.9998779296875, -0.125, -0.0, 0.0001, 0.0, 1.0, -28.0, 4294967294.75,
     -37518052491018912.5, 103740344328578397848785318842252129922803939603530145015162908477052192630505472.0,
     -60264112735379285992549557294906950572505306720710356591257742566415478531569283626542380634430345616295459560427283714375540825055746407845009719778430303250931745441185792.0,
     -61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174784.0
   };
   static _BitInt(575) dblr_575[] = {
-    0wb, 0wb, 1wb, -28wb, 4294967294wb,
+    -1wb, 0wb, 0wb, 0wb, 0wb, 0wb, 1wb, -28wb, 4294967294wb,
     -37518052491018912wb, 103740344328578397848785318842252129922803939603530145015162908477052192630505472wb,
     -60264112735379285992549557294906950572505306720710356591257742566415478531569283626542380634430345616295459560427283714375540825055746407845009719778430303250931745441185792wb,
     -61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174783wb - 1wb
   };
-  for (int i = 0; i < 9; ++i)
+  for (int i = 0; i < 13; ++i)
     if (testdbl_575 (dbl_575[i]) != dblr_575[i])
       __builtin_abort ();
   static double dblu_575[] = {
-    4.0 * __DBL_MIN__, 0.0, 1.0, 38.125, 4294967297.75,
+    -0.99993896484375, -0.0625, -0.0, 4.0 * __DBL_MIN__, 0.0, 1.0, 38.125, 4294967297.75,
     138240328005104064.75, 1588129215384992270224118343146332410113351482118715170651778867930903010675691494429363974899842924150784.0,
     106390366882040443685518677989907085524608028099417390750037507495093586319031581000179209552004867195248003952212636389496136628539779816025838629984567658036669448510767104.0
   };
   static unsigned _BitInt(575) dblur_575[] = {
-    0uwb, 0uwb, 1uwb, 38uwb, 4294967297uwb,
+    0uwb, 0uwb, 0uwb, 0uwb, 0uwb, 1uwb, 38uwb, 4294967297uwb,
     138240328005104064uwb, 1588129215384992270224118343146332410113351482118715170651778867930903010675691494429363974899842924150784uwb,
     106390366882040443685518677989907085524608028099417390750037507495093586319031581000179209552004867195248003952212636389496136628539779816025838629984567658036669448510767104uwb
   };
-  for (int i = 0; i < 8; ++i)
+  for (int i = 0; i < 11; ++i)
     if (testdblu_575 (dblu_575[i]) != dblur_575[i])
       __builtin_abort ();
 #endif
--- gcc/testsuite/gcc.dg/torture/bitint-22.c.jj	2023-09-04 09:45:47.072866916 +0200
+++ gcc/testsuite/gcc.dg/torture/bitint-22.c	2023-09-04 10:36:59.467479044 +0200
@@ -98,91 +98,91 @@  main ()
 #if __LDBL_MANT_DIG__ == 64
 #if __BITINT_MAXWIDTH__ >= 135
   static long double ldbl_135[] = {
-    0.25L, 0.0L, 1.0L, -42.0L, 4294967295.25L,
+    -0.96875L, -0.25L, -0.0L, 0.25L, 0.0L, 1.0L, -42.0L, 4294967295.25L,
     -8790480341948727187.25L, 27274375615880435204096.0L,
     -14925443517338257613013233930892304449536.0L,
     -21778071482940061661655974875633165533184.0L
   };
   static _BitInt(135) ldblr_135[] = {
-    0wb, 0wb, 1wb, -42wb, 4294967295wb,
+    0wb, 0wb, 0wb, 0wb, 0wb, 1wb, -42wb, 4294967295wb,
     -8790480341948727187wb, 27274375615880435204096wb,
     -14925443517338257613013233930892304449536wb,
     -21778071482940061661655974875633165533183wb - 1wb
   };
-  for (int i = 0; i < 9; ++i)
+  for (int i = 0; i < 12; ++i)
     if (testldbl_135 (ldbl_135[i]) != ldblr_135[i])
       __builtin_abort ();
   static long double ldblu_135[] = {
-    0.125L, 0.0L, 1.0L, 42.59375L, 4294967295.75L,
+    -0.9921875L, -0.75L, -0.0L, 0.125L, 0.0L, 1.0L, 42.59375L, 4294967295.75L,
     176563931524327024.5L, 33864941055480177570480471932928.0L,
     25454535165593017203571842988709209178112.0L
   };
   static unsigned _BitInt(135) ldblur_135[] = {
-    0uwb, 0uwb, 1uwb, 42uwb, 4294967295uwb,
+    0uwb, 0uwb, 0uwb, 0uwb, 0uwb, 1uwb, 42uwb, 4294967295uwb,
     176563931524327024uwb, 33864941055480177570480471932928uwb,
     25454535165593017203571842988709209178112uwb
   };
-  for (int i = 0; i < 8; ++i)
+  for (int i = 0; i < 11; ++i)
     if (testldblu_135 (ldblu_135[i]) != ldblur_135[i])
       __builtin_abort ();
 #endif
 #if __BITINT_MAXWIDTH__ >= 192
   static long double ldbl_192[] = {
-    0.625L, 0.0L, 1.0L, -42.0L, 4294967295.25L,
+    -1.0L, -0.998046875L, -0.5L, -0.0L, 0.625L, 0.0L, 1.0L, -42.0L, 4294967295.25L,
     -5824742198306330891.5L, 440458331210868742661519441920.0L,
     1835666805014205039814897225189119947560942436848001613824.0L,
     -3138550867693340381917894711603833208051177722232017256448.0L
   };
   static _BitInt(192) ldblr_192[] = {
-    0wb, 0wb, 1wb, -42wb, 4294967295wb,
+    -1wb, 0wb, 0wb, 0wb, 0wb, 0wb, 1wb, -42wb, 4294967295wb,
     -5824742198306330891wb, 440458331210868742661519441920wb,
     1835666805014205039814897225189119947560942436848001613824wb,
     -3138550867693340381917894711603833208051177722232017256447wb - 1wb
   };
-  for (int i = 0; i < 9; ++i)
+  for (int i = 0; i < 13; ++i)
     if (testldbl_192 (ldbl_192[i]) != ldblr_192[i])
       __builtin_abort ();
   static long double ldblu_192[] = {
-    __LDBL_MIN__, 0.0L, 1.0L, 42.125L, 4294967296.75L,
+    -0.99951171875L, -0.125L, -0.0L, __LDBL_MIN__, 0.0L, 1.0L, 42.125L, 4294967296.75L,
     2076918887405157419.75L, 20675944534182826922963677915852149395069559898112.0L,
     5501434424609388038261967254007295028886638351806353113088.0L
   };
   static unsigned _BitInt(192) ldblur_192[] = {
-    0uwb, 0uwb, 1uwb, 42uwb, 4294967296uwb,
+    0uwb, 0uwb, 0uwb, 0uwb, 0uwb, 1uwb, 42uwb, 4294967296uwb,
     2076918887405157419uwb, 20675944534182826922963677915852149395069559898112uwb,
     5501434424609388038261967254007295028886638351806353113088uwb
   };
-  for (int i = 0; i < 8; ++i)
+  for (int i = 0; i < 11; ++i)
     if (testldblu_192 (ldblu_192[i]) != ldblur_192[i])
       __builtin_abort ();
 #endif
 #if __BITINT_MAXWIDTH__ >= 575
   static long double ldbl_575[] = {
-    0.0001L, 0.0L, 1.0L, -28.0L, 4294967294.75L,
+    -1.00048828125L, -0.999755859375L, -0.0625L, -0.0L, 0.0001L, 0.0L, 1.0L, -28.0L, 4294967294.75L,
     -3665832965020207456.5L, 163698889538251840454153874702336.0L,
     32915174451748642699300864037265677114762093753017270154115822402734463611341115095984060833654391570465670441530007982951775959694729040694137686724336684263404019031998464.0L,
     -61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174784.0L
   };
   static _BitInt(575) ldblr_575[] = {
-    0wb, 0wb, 1wb, -28wb, 4294967294wb,
+    -1wb, 0wb, 0wb, 0wb, 0wb, 0wb, 1wb, -28wb, 4294967294wb,
     -3665832965020207456wb, 163698889538251840454153874702336wb,
     32915174451748642699300864037265677114762093753017270154115822402734463611341115095984060833654391570465670441530007982951775959694729040694137686724336684263404019031998464wb,
     -61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174783wb - 1wb
   };
-  for (int i = 0; i < 9; ++i)
+  for (int i = 0; i < 13; ++i)
     if (testldbl_575 (ldbl_575[i]) != ldblr_575[i])
       __builtin_abort ();
   static long double ldblu_575[] = {
-    4.0L * __LDBL_MIN__, 0.0L, 1.0L, 38.125L, 4294967297.75L,
+    -0.9998779296875L, -0.5L, -0.0L, 4.0L * __LDBL_MIN__, 0.0L, 1.0L, 38.125L, 4294967297.75L,
     1378703406647015633.75L, 611519358004879551476944320883148018860550235384446976.0L,
     115943866857281393364910134541262519802574312323472821552898049002204954780753923929784955305825114286696121504922573067409422635510048274769753298552619702526028834918105088.0L
   };
   static unsigned _BitInt(575) ldblur_575[] = {
-    0uwb, 0uwb, 1uwb, 38uwb, 4294967297uwb,
+    0uwb, 0uwb, 0uwb, 0uwb, 0uwb, 1uwb, 38uwb, 4294967297uwb,
     1378703406647015633uwb, 611519358004879551476944320883148018860550235384446976uwb,
     115943866857281393364910134541262519802574312323472821552898049002204954780753923929784955305825114286696121504922573067409422635510048274769753298552619702526028834918105088uwb
   };
-  for (int i = 0; i < 8; ++i)
+  for (int i = 0; i < 11; ++i)
     if (testldblu_575 (ldblu_575[i]) != ldblur_575[i])
       __builtin_abort ();
 #endif
@@ -190,91 +190,93 @@  main ()
 #if __FLT128_MANT_DIG__ == 113
 #if __BITINT_MAXWIDTH__ >= 135
   static _Float128 flt128_135[] = {
-    0.25F128, 0.0F128, 1.0F128, -42.0F128, 4294967295.25F128,
+    -1.0F128, -0.999969482421875F128, -0.5F128, -0.0F128, 0.25F128, 0.0F128,
+    1.0F128, -42.0F128, 4294967295.25F128,
     -622114258022893415468272077014949.5F128, 6846686534183872435237780851340978176.0F128,
     -18109992041001989671440396535501724581888.0F128,
     -21778071482940061661655974875633165533184.0F128
   };
   static _BitInt(135) flt128r_135[] = {
-    0wb, 0wb, 1wb, -42wb, 4294967295wb,
+    -1wb, 0wb, 0wb, 0wb, 0wb, 0wb, 1wb, -42wb, 4294967295wb,
     -622114258022893415468272077014949wb, 6846686534183872435237780851340978176wb,
     -18109992041001989671440396535501724581888wb,
     -21778071482940061661655974875633165533183wb - 1wb
   };
-  for (int i = 0; i < 9; ++i)
+  for (int i = 0; i < 13; ++i)
     if (testflt128_135 (flt128_135[i]) != flt128r_135[i])
       __builtin_abort ();
   static _Float128 flt128u_135[] = {
-    0.125F128, 0.0F128, 1.0F128, 42.59375F128, 4294967295.75F128,
+    -0.9999847412109375F128, -0.25F128, -0.0F128, 0.125F128, 0.0F128, 1.0F128,
+    42.59375F128, 4294967295.75F128,
     3866883549893778868343627501393297.5F128, 1884508847679496004639718578196282112.0F128,
     40418154190724512480670668005754087145472.0F128
   };
   static unsigned _BitInt(135) flt128ur_135[] = {
-    0uwb, 0uwb, 1uwb, 42uwb, 4294967295uwb,
+    0uwb, 0uwb, 0uwb, 0uwb, 0uwb, 1uwb, 42uwb, 4294967295uwb,
     3866883549893778868343627501393297uwb, 1884508847679496004639718578196282112uwb,
     40418154190724512480670668005754087145472uwb
   };
-  for (int i = 0; i < 8; ++i)
+  for (int i = 0; i < 11; ++i)
     if (testflt128u_135 (flt128u_135[i]) != flt128ur_135[i])
       __builtin_abort ();
 #endif
 #if __BITINT_MAXWIDTH__ >= 192
   static _Float128 flt128_192[] = {
-    0.625F128, 0.0F128, 1.0F128, -42.0F128, 4294967295.25F128,
+    -0.99999237060546875F128, -0.75F128, -0.0F128, 0.625F128, 0.0F128, 1.0F128, -42.0F128, 4294967295.25F128,
     -2985198467222342042164811285508981.5F128, 431282768955649236431442335280406747022360576.0F128,
     1589969577168452878096502186670522088231011726426596442112.0F128,
     -3138550867693340381917894711603833208051177722232017256448.0F128
   };
   static _BitInt(192) flt128r_192[] = {
-    0wb, 0wb, 1wb, -42wb, 4294967295wb,
+    0wb, 0wb, 0wb, 0wb, 0wb, 1wb, -42wb, 4294967295wb,
     -2985198467222342042164811285508981wb, 431282768955649236431442335280406747022360576wb,
     1589969577168452878096502186670522088231011726426596442112wb,
     -3138550867693340381917894711603833208051177722232017256447wb - 1wb
   };
-  for (int i = 0; i < 9; ++i)
+  for (int i = 0; i < 12; ++i)
     if (testflt128_192 (flt128_192[i]) != flt128r_192[i])
       __builtin_abort ();
   static _Float128 flt128u_192[] = {
-    __FLT128_MIN__, 0.0F128, 1.0F128, 42.125F128, 4294967296.75F128,
+    -0.999996185302734375F128, -0.0625F128, -0.0F128, __FLT128_MIN__, 0.0F128, 1.0F128, 42.125F128, 4294967296.75F128,
     1198221816583045676753413578483973.75F128, 321058543109670204450967161534914741927936.0F128,
     4124250833671183507048495617931376186682553019928355536896.0F128
   };
   static unsigned _BitInt(192) flt128ur_192[] = {
-    0uwb, 0uwb, 1uwb, 42uwb, 4294967296uwb,
+    0uwb, 0uwb, 0uwb, 0uwb, 0uwb, 1uwb, 42uwb, 4294967296uwb,
     1198221816583045676753413578483973uwb, 321058543109670204450967161534914741927936uwb,
     4124250833671183507048495617931376186682553019928355536896uwb
   };
-  for (int i = 0; i < 8; ++i)
+  for (int i = 0; i < 11; ++i)
     if (testflt128u_192 (flt128u_192[i]) != flt128ur_192[i])
       __builtin_abort ();
 #endif
 #if __BITINT_MAXWIDTH__ >= 575
   static _Float128 flt128_575[] = {
-    0.0001F128, 0.0F128, 1.0F128, -28.0F128, 4294967294.75F128,
+    -1.0000019073486328125F128, -0.9999980926513671875F128, -0.125F128, -0.0F128, 0.0001F128, 0.0F128, 1.0F128, -28.0F128, 4294967294.75F128,
     -4434536963340205213805292449887836.5F128, 7798956314177801818163892326325236647148010864640.0F128,
     -48379475169482975928082617475070980956970510451882414558095669485086407691242420689411465910847147042640064381848760072045866350077715681395831023828798188292450661613699072.0F128,
     -61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174784.0F128
   };
   static _BitInt(575) flt128r_575[] = {
-    0wb, 0wb, 1wb, -28wb, 4294967294wb,
+    -1wb, 0wb, 0wb, 0wb, 0wb, 0wb, 1wb, -28wb, 4294967294wb,
     -4434536963340205213805292449887836wb, 7798956314177801818163892326325236647148010864640wb,
     -48379475169482975928082617475070980956970510451882414558095669485086407691242420689411465910847147042640064381848760072045866350077715681395831023828798188292450661613699072wb,
     -61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174783wb - 1wb
   };
-  for (int i = 0; i < 9; ++i)
+  for (int i = 0; i < 13; ++i)
     if (testflt128_575 (flt128_575[i]) != flt128r_575[i])
       __builtin_abort ();
   static _Float128 flt128u_575[] = {
-    4.0F128 * __FLT128_MIN__, 0.0F128, 1.0F128, 38.125F128, 4294967297.75F128,
+    -0.99999904632568359375F128, -0.75F128, -0.0F128, 4.0F128 * __FLT128_MIN__, 0.0F128, 1.0F128, 38.125F128, 4294967297.75F128,
     1286565442597535616086070715374552.75F128, 2888274376848382435313359223769917404575136171432777745913780227423600640.0F128,
     101012352069182509789055890148950528106809264092697629422634347377509770791198015780931797016594366657511165718215124632216959526129296364564413818230848005073384975475146752.0F128
   };
   static unsigned _BitInt(575) flt128ur_575[] = {
-    0uwb, 0uwb, 1uwb, 38uwb, 4294967297uwb,
+    0uwb, 0uwb, 0uwb, 0uwb, 0uwb, 1uwb, 38uwb, 4294967297uwb,
     1286565442597535616086070715374552uwb, 2888274376848382435313359223769917404575136171432777745913780227423600640uwb,
     101012352069182509789055890148950528106809264092697629422634347377509770791198015780931797016594366657511165718215124632216959526129296364564413818230848005073384975475146752uwb
   };
-  for (int i = 0; i < 8; ++i)
+  for (int i = 0; i < 11; ++i)
     if (testflt128u_575 (flt128u_575[i]) != flt128ur_575[i])
       __builtin_abort ();
 #endif
--- gcc/testsuite/gcc.dg/bitint-28.c.jj	2023-09-04 12:52:07.607635862 +0200
+++ gcc/testsuite/gcc.dg/bitint-28.c	2023-09-04 14:44:43.240152428 +0200
@@ -0,0 +1,401 @@ 
+/* PR c/102989 */
+/* { dg-do run } */
+/* { dg-require-effective-target fenv_exceptions } */
+/* { dg-options "-std=c2x" } */
+/* { dg-add-options ieee } */
+
+#include <fenv.h>
+
+#if __FLT_MANT_DIG__ == 24
+#if __BITINT_MAXWIDTH__ >= 135
+__attribute__((noipa)) _BitInt(135)
+testflt_135 (float d)
+{
+  return d;
+}
+
+__attribute__((noipa)) unsigned _BitInt(135)
+testfltu_135 (float d)
+{
+  return d;
+}
+#endif
+
+#if __BITINT_MAXWIDTH__ >= 192
+__attribute__((noipa)) _BitInt(192)
+testflt_192 (float d)
+{
+  return d;
+}
+
+__attribute__((noipa)) unsigned _BitInt(192)
+testfltu_192 (float d)
+{
+  return d;
+}
+#endif
+
+#if __BITINT_MAXWIDTH__ >= 575
+__attribute__((noipa)) _BitInt(575)
+testflt_575 (float d)
+{
+  return d;
+}
+
+__attribute__((noipa)) unsigned _BitInt(575)
+testfltu_575 (float d)
+{
+  return d;
+}
+#endif
+#endif
+
+#if __DBL_MANT_DIG__ == 53
+#if __BITINT_MAXWIDTH__ >= 135
+__attribute__((noipa)) _BitInt(135)
+testdbl_135 (double d)
+{
+  return d;
+}
+
+__attribute__((noipa)) unsigned _BitInt(135)
+testdblu_135 (double d)
+{
+  return d;
+}
+#endif
+
+#if __BITINT_MAXWIDTH__ >= 192
+__attribute__((noipa)) _BitInt(192)
+testdbl_192 (double d)
+{
+  return d;
+}
+
+__attribute__((noipa)) unsigned _BitInt(192)
+testdblu_192 (double d)
+{
+  return d;
+}
+#endif
+
+#if __BITINT_MAXWIDTH__ >= 575
+__attribute__((noipa)) _BitInt(575)
+testdbl_575 (double d)
+{
+  return d;
+}
+
+__attribute__((noipa)) unsigned _BitInt(575)
+testdblu_575 (double d)
+{
+  return d;
+}
+#endif
+#endif
+
+#if __LDBL_MANT_DIG__ == 64
+#if __BITINT_MAXWIDTH__ >= 135
+__attribute__((noipa)) _BitInt(135)
+testldbl_135 (long double d)
+{
+  return d;
+}
+
+__attribute__((noipa)) unsigned _BitInt(135)
+testldblu_135 (long double d)
+{
+  return d;
+}
+#endif
+
+#if __BITINT_MAXWIDTH__ >= 192
+__attribute__((noipa)) _BitInt(192)
+testldbl_192 (long double d)
+{
+  return d;
+}
+
+__attribute__((noipa)) unsigned _BitInt(192)
+testldblu_192 (long double d)
+{
+  return d;
+}
+#endif
+
+#if __BITINT_MAXWIDTH__ >= 575
+__attribute__((noipa)) _BitInt(575)
+testldbl_575 (long double d)
+{
+  return d;
+}
+
+__attribute__((noipa)) unsigned _BitInt(575)
+testldblu_575 (long double d)
+{
+  return d;
+}
+#endif
+#endif
+
+#if __FLT128_MANT_DIG__ == 113
+#if __BITINT_MAXWIDTH__ >= 135
+__attribute__((noipa)) _BitInt(135)
+testflt128_135 (_Float128 d)
+{
+  return d;
+}
+
+__attribute__((noipa)) unsigned _BitInt(135)
+testflt128u_135 (_Float128 d)
+{
+  return d;
+}
+#endif
+
+#if __BITINT_MAXWIDTH__ >= 192
+__attribute__((noipa)) _BitInt(192)
+testflt128_192 (_Float128 d)
+{
+  return d;
+}
+
+__attribute__((noipa)) unsigned _BitInt(192)
+testflt128u_192 (_Float128 d)
+{
+  return d;
+}
+#endif
+
+#if __BITINT_MAXWIDTH__ >= 575
+__attribute__((noipa)) _BitInt(575)
+testflt128_575 (_Float128 d)
+{
+  return d;
+}
+
+__attribute__((noipa)) unsigned _BitInt(575)
+testflt128u_575 (_Float128 d)
+{
+  return d;
+}
+#endif
+#endif
+
+__attribute__((noipa)) void
+check_invalid (int test, int inv)
+{
+  if (!test)
+    __builtin_abort ();
+  if ((!fetestexcept (FE_INVALID)) != (!inv))
+    __builtin_abort ();
+  feclearexcept (FE_INVALID);
+}
+
+int
+main ()
+{
+#if __FLT_MANT_DIG__ == 24
+#if __BITINT_MAXWIDTH__ >= 135
+  check_invalid (testflt_135 (-85070591730234615865843651857942052864.0f) == -85070591730234615865843651857942052864wb, 0);
+  check_invalid (testflt_135 (__builtin_inff ()) == 21778071482940061661655974875633165533183wb, 1);
+  check_invalid (testflt_135 (-__builtin_inff ()) == -21778071482940061661655974875633165533183wb - 1wb, 1);
+  check_invalid (testflt_135 (__builtin_nanf ("")) == 21778071482940061661655974875633165533183wb, 1);
+  check_invalid (testflt_135 (0xffffffp+104f) == 340282346638528859811704183484516925440wb, 0);
+  check_invalid (testflt_135 (-0xffffffp+104f) == -340282346638528859811704183484516925440wb, 0);
+  check_invalid (testfltu_135 (-0.9990234375f) == 0uwb, 0);
+  check_invalid (testfltu_135 (-1.f) == 0uwb, 1);
+  check_invalid (testfltu_135 (__builtin_inff ()) == 43556142965880123323311949751266331066367uwb, 1);
+  check_invalid (testfltu_135 (-__builtin_inff ()) == 0uwb, 1);
+  check_invalid (testfltu_135 (__builtin_nanf ("")) == 43556142965880123323311949751266331066367uwb, 1);
+  check_invalid (testfltu_135 (0xffffffp+104f) == 340282346638528859811704183484516925440uwb, 0);
+#endif
+#if __BITINT_MAXWIDTH__ >= 192
+  check_invalid (testflt_192 (-85070591730234615865843651857942052864.0f) == -85070591730234615865843651857942052864wb, 0);
+  check_invalid (testflt_192 (__builtin_inff ()) == 3138550867693340381917894711603833208051177722232017256447wb, 1);
+  check_invalid (testflt_192 (-__builtin_inff ()) == -3138550867693340381917894711603833208051177722232017256447wb - 1wb, 1);
+  check_invalid (testflt_192 (__builtin_nanf ("")) == 3138550867693340381917894711603833208051177722232017256447wb, 1);
+  check_invalid (testflt_192 (0xffffffp+104f) == 340282346638528859811704183484516925440wb, 0);
+  check_invalid (testflt_192 (-0xffffffp+104f) == -340282346638528859811704183484516925440wb, 0);
+  check_invalid (testfltu_192 (-0.9990234375f) == 0uwb, 0);
+  check_invalid (testfltu_192 (-1.f) == 0uwb, 1);
+  check_invalid (testfltu_192 (__builtin_inff ()) == 6277101735386680763835789423207666416102355444464034512895uwb, 1);
+  check_invalid (testfltu_192 (-__builtin_inff ()) == 0uwb, 1);
+  check_invalid (testfltu_192 (__builtin_nanf ("")) == 6277101735386680763835789423207666416102355444464034512895uwb, 1);
+  check_invalid (testfltu_192 (0xffffffp+104f) == 340282346638528859811704183484516925440uwb, 0);
+#endif
+#if __BITINT_MAXWIDTH__ >= 575
+  check_invalid (testflt_575 (-85070591730234615865843651857942052864.0f) == -85070591730234615865843651857942052864wb, 0);
+  check_invalid (testflt_575 (__builtin_inff ()) == 61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174783wb, 1);
+  check_invalid (testflt_575 (-__builtin_inff ()) == -61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174783wb - 1wb, 1);
+  check_invalid (testflt_575 (__builtin_nanf ("")) == 61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174783wb, 1);
+  check_invalid (testflt_575 (0xffffffp+104f) == 340282346638528859811704183484516925440wb, 0);
+  check_invalid (testflt_575 (-0xffffffp+104f) == -340282346638528859811704183484516925440wb, 0);
+  check_invalid (testfltu_575 (-0.9990234375f) == 0uwb, 0);
+  check_invalid (testfltu_575 (-1.f) == 0uwb, 1);
+  check_invalid (testfltu_575 (__builtin_inff ()) == 123665200736552267030251260509823595017565674550605919957031528046448612553265933585158200530621522494798835713008069669675682517153375604983773077550946583958303386074349567uwb, 1);
+  check_invalid (testfltu_575 (-__builtin_inff ()) == 0uwb, 1);
+  check_invalid (testfltu_575 (__builtin_nanf ("")) == 123665200736552267030251260509823595017565674550605919957031528046448612553265933585158200530621522494798835713008069669675682517153375604983773077550946583958303386074349567uwb, 1);
+  check_invalid (testfltu_575 (0xffffffp+104f) == 340282346638528859811704183484516925440uwb, 0);
+#endif
+#endif
+#if __DBL_MANT_DIG__ == 53
+#if __BITINT_MAXWIDTH__ >= 135
+  check_invalid (testdbl_135 (-85070591730234615865843651857942052864.0) == -85070591730234615865843651857942052864wb, 0);
+  check_invalid (testdbl_135 (__builtin_inf ()) == 21778071482940061661655974875633165533183wb, 1);
+  check_invalid (testdbl_135 (-__builtin_inf ()) == -21778071482940061661655974875633165533183wb - 1wb, 1);
+  check_invalid (testdbl_135 (__builtin_nan ("")) == 21778071482940061661655974875633165533183wb, 1);
+  check_invalid (testdbl_135 (0x1fffffffffffffp+81) == 21778071482940059243804335646374816120832wb, 0);
+  check_invalid (testdbl_135 (0x20000000000000p+81) == 21778071482940061661655974875633165533183wb, 1);
+  check_invalid (testdbl_135 (-0x20000000000000p+81) == -21778071482940061661655974875633165533183wb - 1, 0);
+  check_invalid (testdbl_135 (-0x20000000000002p+81) == -21778071482940061661655974875633165533183wb - 1, 1);
+  check_invalid (testdblu_135 (-0.9990234375) == 0uwb, 0);
+  check_invalid (testdblu_135 (-1.) == 0uwb, 1);
+  check_invalid (testdblu_135 (__builtin_inf ()) == 43556142965880123323311949751266331066367uwb, 1);
+  check_invalid (testdblu_135 (-__builtin_inf ()) == 0uwb, 1);
+  check_invalid (testdblu_135 (__builtin_nan ("")) == 43556142965880123323311949751266331066367uwb, 1);
+  check_invalid (testdblu_135 (0x1fffffffffffffp+82) == 43556142965880118487608671292749632241664uwb, 0);
+  check_invalid (testdblu_135 (0x20000000000000p+82) == 43556142965880123323311949751266331066367uwb, 1);
+#endif
+#if __BITINT_MAXWIDTH__ >= 192
+  check_invalid (testdbl_192 (-85070591730234615865843651857942052864.0) == -85070591730234615865843651857942052864wb, 0);
+  check_invalid (testdbl_192 (__builtin_inf ()) == 3138550867693340381917894711603833208051177722232017256447wb, 1);
+  check_invalid (testdbl_192 (-__builtin_inf ()) == -3138550867693340381917894711603833208051177722232017256447wb - 1wb, 1);
+  check_invalid (testdbl_192 (__builtin_nan ("")) == 3138550867693340381917894711603833208051177722232017256447wb, 1);
+  check_invalid (testdbl_192 (0x1fffffffffffffp+138) == 3138550867693340033468750984562846621555579712101368725504wb, 0);
+  check_invalid (testdbl_192 (0x20000000000000p+138) == 3138550867693340381917894711603833208051177722232017256447wb, 1);
+  check_invalid (testdbl_192 (-0x20000000000000p+138) == -3138550867693340381917894711603833208051177722232017256447wb - 1, 0);
+  check_invalid (testdbl_192 (-0x20000000000002p+138) == -3138550867693340381917894711603833208051177722232017256447wb - 1, 1);
+  check_invalid (testdblu_192 (-0.9990234375) == 0uwb, 0);
+  check_invalid (testdblu_192 (-1.) == 0uwb, 1);
+  check_invalid (testdblu_192 (__builtin_inf ()) == 6277101735386680763835789423207666416102355444464034512895uwb, 1);
+  check_invalid (testdblu_192 (-__builtin_inf ()) == 0uwb, 1);
+  check_invalid (testdblu_192 (__builtin_nan ("")) == 6277101735386680763835789423207666416102355444464034512895uwb, 1);
+  check_invalid (testdblu_192 (0x1fffffffffffffp+139) == 6277101735386680066937501969125693243111159424202737451008uwb, 0);
+  check_invalid (testdblu_192 (0x20000000000000p+139) == 6277101735386680763835789423207666416102355444464034512895uwb, 1);
+#endif
+#if __BITINT_MAXWIDTH__ >= 575
+  check_invalid (testdbl_575 (-85070591730234615865843651857942052864.0) == -85070591730234615865843651857942052864wb, 0);
+  check_invalid (testdbl_575 (__builtin_inf ()) == 61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174783wb, 1);
+  check_invalid (testdbl_575 (-__builtin_inf ()) == -61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174783wb - 1wb, 1);
+  check_invalid (testdbl_575 (__builtin_nan ("")) == 61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174783wb, 1);
+  check_invalid (testdbl_575 (0x1fffffffffffffp+521) == 61832600368276126650327970124302082526882038193909742709080463879918896882169507607035916867654709124839777195049479857541529867095829765369898539058829479405123401922117632wb, 0);
+  check_invalid (testdbl_575 (0x20000000000000p+521) == 61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174783wb, 1);
+  check_invalid (testdbl_575 (-0x20000000000000p+521) == -61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174783wb - 1, 0);
+  check_invalid (testdbl_575 (-0x20000000000002p+521) == -61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174783wb - 1, 1);
+  check_invalid (testdblu_575 (-0.9990234375) == 0uwb, 0);
+  check_invalid (testdblu_575 (-1.) == 0uwb, 1);
+  check_invalid (testdblu_575 (__builtin_inf ()) == 123665200736552267030251260509823595017565674550605919957031528046448612553265933585158200530621522494798835713008069669675682517153375604983773077550946583958303386074349567uwb, 1);
+  check_invalid (testdblu_575 (-__builtin_inf ()) == 0uwb, 1);
+  check_invalid (testdblu_575 (__builtin_nan ("")) == 123665200736552267030251260509823595017565674550605919957031528046448612553265933585158200530621522494798835713008069669675682517153375604983773077550946583958303386074349567uwb, 1);
+  check_invalid (testdblu_575 (0x1fffffffffffffp+522) == 123665200736552253300655940248604165053764076387819485418160927759837793764339015214071833735309418249679554390098959715083059734191659530739797078117658958810246803844235264uwb, 0);
+  check_invalid (testdblu_575 (0x20000000000000p+522) == 123665200736552267030251260509823595017565674550605919957031528046448612553265933585158200530621522494798835713008069669675682517153375604983773077550946583958303386074349567uwb, 1);
+#endif
+#endif
+#if __LDBL_MANT_DIG__ == 64
+#if __BITINT_MAXWIDTH__ >= 135
+  check_invalid (testldbl_135 (-85070591730234615865843651857942052864.0L) == -85070591730234615865843651857942052864wb, 0);
+  check_invalid (testldbl_135 (__builtin_infl ()) == 21778071482940061661655974875633165533183wb, 1);
+  check_invalid (testldbl_135 (-__builtin_infl ()) == -21778071482940061661655974875633165533183wb - 1wb, 1);
+  check_invalid (testldbl_135 (__builtin_nanl ("")) == 21778071482940061661655974875633165533183wb, 1);
+  check_invalid (testldbl_135 (0xffffffffffffffffp+70L) == 21778071482940061660475383254915754229760wb, 0);
+  check_invalid (testldbl_135 (0x10000000000000000p+70L) == 21778071482940061661655974875633165533183wb, 1);
+  check_invalid (testldbl_135 (-0x10000000000000000p+70L) == -21778071482940061661655974875633165533183wb - 1, 0);
+  check_invalid (testldbl_135 (-0x10000000000000002p+70L) == -21778071482940061661655974875633165533183wb - 1, 1);
+  check_invalid (testldblu_135 (-0.9990234375L) == 0uwb, 0);
+  check_invalid (testldblu_135 (-1.L) == 0uwb, 1);
+  check_invalid (testldblu_135 (__builtin_infl ()) == 43556142965880123323311949751266331066367uwb, 1);
+  check_invalid (testldblu_135 (-__builtin_infl ()) == 0uwb, 1);
+  check_invalid (testldblu_135 (__builtin_nanl ("")) == 43556142965880123323311949751266331066367uwb, 1);
+  check_invalid (testldblu_135 (0xffffffffffffffffp+71L) == 43556142965880123320950766509831508459520uwb, 0);
+  check_invalid (testldblu_135 (0x10000000000000000p+71L) == 43556142965880123323311949751266331066367uwb, 1);
+#endif
+#if __BITINT_MAXWIDTH__ >= 192
+  check_invalid (testldbl_192 (-85070591730234615865843651857942052864.0L) == -85070591730234615865843651857942052864wb, 0);
+  check_invalid (testldbl_192 (__builtin_infl ()) == 3138550867693340381917894711603833208051177722232017256447wb, 1);
+  check_invalid (testldbl_192 (-__builtin_infl ()) == -3138550867693340381917894711603833208051177722232017256447wb - 1wb, 1);
+  check_invalid (testldbl_192 (__builtin_nanl ("")) == 3138550867693340381917894711603833208051177722232017256447wb, 1);
+  check_invalid (testldbl_192 (0xffffffffffffffffp+127L) == 3138550867693340381747753528143363976319490418516133150720wb, 0);
+  check_invalid (testldbl_192 (0x10000000000000000p+127L) == 3138550867693340381917894711603833208051177722232017256447wb, 1);
+  check_invalid (testldbl_192 (-0x10000000000000000p+127L) == -3138550867693340381917894711603833208051177722232017256447wb - 1, 0);
+  check_invalid (testldbl_192 (-0x10000000000000002p+127L) == -3138550867693340381917894711603833208051177722232017256447wb - 1, 1);
+  check_invalid (testldblu_192 (-0.9990234375L) == 0uwb, 0);
+  check_invalid (testldblu_192 (-1.L) == 0uwb, 1);
+  check_invalid (testldblu_192 (__builtin_infl ()) == 6277101735386680763835789423207666416102355444464034512895uwb, 1);
+  check_invalid (testldblu_192 (-__builtin_infl ()) == 0uwb, 1);
+  check_invalid (testldblu_192 (__builtin_nanl ("")) == 6277101735386680763835789423207666416102355444464034512895uwb, 1);
+  check_invalid (testldblu_192 (0xffffffffffffffffp+128L) == 6277101735386680763495507056286727952638980837032266301440uwb, 0);
+  check_invalid (testldblu_192 (0x10000000000000000p+128L) == 6277101735386680763835789423207666416102355444464034512895uwb, 1);
+#endif
+#if __BITINT_MAXWIDTH__ >= 575
+  check_invalid (testldbl_575 (-85070591730234615865843651857942052864.0L) == -85070591730234615865843651857942052864wb, 0);
+  check_invalid (testldbl_575 (__builtin_infl ()) == 61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174783wb, 1);
+  check_invalid (testldbl_575 (-__builtin_infl ()) == -61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174783wb - 1wb, 1);
+  check_invalid (testldbl_575 (__builtin_nanl ("")) == 61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174783wb, 1);
+  check_invalid (testldbl_575 (0xffffffffffffffffp+510L) == 61832600368276133511773678272426148233889331025751498446645922568076207932202076431648659257792374503198949281962308977915333294030066289778448068072486649492543280785653760wb, 0);
+  check_invalid (testldbl_575 (0x10000000000000000p+510L) == 61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174783wb, 1);
+  check_invalid (testldbl_575 (-0x10000000000000000p+510L) == -61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174783wb - 1, 0);
+  check_invalid (testldbl_575 (-0x10000000000000002p+510L) == -61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174783wb - 1, 1);
+  check_invalid (testldblu_575 (-0.9990234375L) == 0uwb, 0);
+  check_invalid (testldblu_575 (-1.L) == 0uwb, 1);
+  check_invalid (testldblu_575 (__builtin_infl ()) == 123665200736552267030251260509823595017565674550605919957031528046448612553265933585158200530621522494798835713008069669675682517153375604983773077550946583958303386074349567uwb, 1);
+  check_invalid (testldblu_575 (-__builtin_infl ()) == 0uwb, 1);
+  check_invalid (testldblu_575 (__builtin_nanl ("")) == 123665200736552267030251260509823595017565674550605919957031528046448612553265933585158200530621522494798835713008069669675682517153375604983773077550946583958303386074349567uwb, 1);
+  check_invalid (testldblu_575 (0xffffffffffffffffp+511L) == 123665200736552267023547356544852296467778662051502996893291845136152415864404152863297318515584749006397898563924617955830666588060132579556896136144973298985086561571307520uwb, 0);
+  check_invalid (testldblu_575 (0x10000000000000000p+511L) == 123665200736552267030251260509823595017565674550605919957031528046448612553265933585158200530621522494798835713008069669675682517153375604983773077550946583958303386074349567uwb, 1);
+#endif
+#endif
+#if __FLT128_MANT_DIG__ == 113
+#if __BITINT_MAXWIDTH__ >= 135
+  check_invalid (testflt128_135 (-85070591730234615865843651857942052864.0F128) == -85070591730234615865843651857942052864wb, 0);
+  check_invalid (testflt128_135 (__builtin_inff128 ()) == 21778071482940061661655974875633165533183wb, 1);
+  check_invalid (testflt128_135 (-__builtin_inff128 ()) == -21778071482940061661655974875633165533183wb - 1wb, 1);
+  check_invalid (testflt128_135 (__builtin_nanf128 ("")) == 21778071482940061661655974875633165533183wb, 1);
+  check_invalid (testflt128_135 (0x1ffffffffffffffffffffffffffffp+21F128) == 21778071482940061661655974875633163436032wb, 0);
+  check_invalid (testflt128_135 (0x20000000000000000000000000000p+21F128) == 21778071482940061661655974875633165533183wb, 1);
+  check_invalid (testflt128_135 (-0x20000000000000000000000000000p+21F128) == -21778071482940061661655974875633165533183wb - 1, 0);
+  check_invalid (testflt128_135 (-0x20000000000000000000000000002p+21F128) == -21778071482940061661655974875633165533183wb - 1, 1);
+  check_invalid (testflt128u_135 (-0.9990234375F128) == 0uwb, 0);
+  check_invalid (testflt128u_135 (-1.F128) == 0uwb, 1);
+  check_invalid (testflt128u_135 (__builtin_inff128 ()) == 43556142965880123323311949751266331066367uwb, 1);
+  check_invalid (testflt128u_135 (-__builtin_inff128 ()) == 0uwb, 1);
+  check_invalid (testflt128u_135 (__builtin_nanf128 ("")) == 43556142965880123323311949751266331066367uwb, 1);
+  check_invalid (testflt128u_135 (0x1ffffffffffffffffffffffffffffp+22F128) == 43556142965880123323311949751266326872064uwb, 0);
+  check_invalid (testflt128u_135 (0x20000000000000000000000000000p+22F128) == 43556142965880123323311949751266331066367uwb, 1);
+#endif
+#if __BITINT_MAXWIDTH__ >= 192
+  check_invalid (testflt128_192 (-85070591730234615865843651857942052864.0F128) == -85070591730234615865843651857942052864wb, 0);
+  check_invalid (testflt128_192 (__builtin_inff128 ()) == 3138550867693340381917894711603833208051177722232017256447wb, 1);
+  check_invalid (testflt128_192 (-__builtin_inff128 ()) == -3138550867693340381917894711603833208051177722232017256447wb - 1wb, 1);
+  check_invalid (testflt128_192 (__builtin_nanf128 ("")) == 3138550867693340381917894711603833208051177722232017256447wb, 1);
+  check_invalid (testflt128_192 (0x1ffffffffffffffffffffffffffffp+78F128) == 3138550867693340381917894711603832905819722818574723579904wb, 0);
+  check_invalid (testflt128_192 (0x20000000000000000000000000000p+78F128) == 3138550867693340381917894711603833208051177722232017256447wb, 1);
+  check_invalid (testflt128_192 (-0x20000000000000000000000000000p+78F128) == -3138550867693340381917894711603833208051177722232017256447wb - 1, 0);
+  check_invalid (testflt128_192 (-0x20000000000000000000000000002p+78F128) == -3138550867693340381917894711603833208051177722232017256447wb - 1, 1);
+  check_invalid (testflt128u_192 (-0.9990234375F128) == 0uwb, 0);
+  check_invalid (testflt128u_192 (-1.F128) == 0uwb, 1);
+  check_invalid (testflt128u_192 (__builtin_inff128 ()) == 6277101735386680763835789423207666416102355444464034512895uwb, 1);
+  check_invalid (testflt128u_192 (-__builtin_inff128 ()) == 0uwb, 1);
+  check_invalid (testflt128u_192 (__builtin_nanf128 ("")) == 6277101735386680763835789423207666416102355444464034512895uwb, 1);
+  check_invalid (testflt128u_192 (0x1ffffffffffffffffffffffffffffp+79F128) == 6277101735386680763835789423207665811639445637149447159808uwb, 0);
+  check_invalid (testflt128u_192 (0x20000000000000000000000000000p+79F128) == 6277101735386680763835789423207666416102355444464034512895uwb, 1);
+#endif
+#if __BITINT_MAXWIDTH__ >= 575
+  check_invalid (testflt128_575 (-85070591730234615865843651857942052864.0F128) == -85070591730234615865843651857942052864wb, 0);
+  check_invalid (testflt128_575 (__builtin_inff128 ()) == 61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174783wb, 1);
+  check_invalid (testflt128_575 (-__builtin_inff128 ()) == -61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174783wb - 1wb, 1);
+  check_invalid (testflt128_575 (__builtin_nanf128 ("")) == 61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174783wb, 1);
+  check_invalid (testflt128_575 (0x1ffffffffffffffffffffffffffffp+461F128) == 61832600368276133515125630254911791554520007845691312598455129804691160851602940042069550439343049559602369631548246946680753811425558728725309540242943660463695151425912832wb, 0);
+  check_invalid (testflt128_575 (0x20000000000000000000000000000p+461F128) == 61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174783wb, 1);
+  check_invalid (testflt128_575 (-0x20000000000000000000000000000p+461F128) == -61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174783wb - 1, 0);
+  check_invalid (testflt128_575 (-0x20000000000000000000000000002p+461F128) == -61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174783wb - 1, 1);
+  check_invalid (testflt128u_575 (-0.9990234375F128) == 0uwb, 0);
+  check_invalid (testflt128u_575 (-1.F128) == 0uwb, 1);
+  check_invalid (testflt128u_575 (__builtin_inff128 ()) == 123665200736552267030251260509823595017565674550605919957031528046448612553265933585158200530621522494798835713008069669675682517153375604983773077550946583958303386074349567uwb, 1);
+  check_invalid (testflt128u_575 (-__builtin_inff128 ()) == 0uwb, 1);
+  check_invalid (testflt128u_575 (__builtin_nanf128 ("")) == 123665200736552267030251260509823595017565674550605919957031528046448612553265933585158200530621522494798835713008069669675682517153375604983773077550946583958303386074349567uwb, 1);
+  check_invalid (testflt128u_575 (0x1ffffffffffffffffffffffffffffp+462F128) == 123665200736552267030251260509823583109040015691382625196910259609382321703205880084139100878686099119204739263096493893361507622851117457450619080485887320927390302851825664uwb, 0);
+  check_invalid (testflt128u_575 (0x20000000000000000000000000000p+462F128) == 123665200736552267030251260509823595017565674550605919957031528046448612553265933585158200530621522494798835713008069669675682517153375604983773077550946583958303386074349567uwb, 1);
+#endif
+#endif
+}
--- gcc/testsuite/gcc.dg/bitint-29.c.jj	2023-09-04 14:54:08.440333215 +0200
+++ gcc/testsuite/gcc.dg/bitint-29.c	2023-09-04 15:33:55.882523605 +0200
@@ -0,0 +1,351 @@ 
+/* PR c/102989 */
+/* { dg-do run } */
+/* { dg-require-effective-target fenv_exceptions } */
+/* { dg-options "-std=c2x" } */
+/* { dg-add-options ieee } */
+
+#include <fenv.h>
+
+#if __FLT_MANT_DIG__ == 24
+#if __BITINT_MAXWIDTH__ >= 135
+__attribute__((noipa)) _BitInt(135)
+testflt_135 (float d)
+{
+  return d;
+}
+
+__attribute__((noipa)) unsigned _BitInt(135)
+testfltu_135 (float d)
+{
+  return d;
+}
+#endif
+
+#if __BITINT_MAXWIDTH__ >= 192
+__attribute__((noipa)) _BitInt(192)
+testflt_192 (float d)
+{
+  return d;
+}
+
+__attribute__((noipa)) unsigned _BitInt(192)
+testfltu_192 (float d)
+{
+  return d;
+}
+#endif
+
+#if __BITINT_MAXWIDTH__ >= 575
+__attribute__((noipa)) _BitInt(575)
+testflt_575 (float d)
+{
+  return d;
+}
+
+__attribute__((noipa)) unsigned _BitInt(575)
+testfltu_575 (float d)
+{
+  return d;
+}
+#endif
+#endif
+
+#if __DBL_MANT_DIG__ == 53
+#if __BITINT_MAXWIDTH__ >= 135
+__attribute__((noipa)) _BitInt(135)
+testdbl_135 (double d)
+{
+  return d;
+}
+
+__attribute__((noipa)) unsigned _BitInt(135)
+testdblu_135 (double d)
+{
+  return d;
+}
+#endif
+
+#if __BITINT_MAXWIDTH__ >= 192
+__attribute__((noipa)) _BitInt(192)
+testdbl_192 (double d)
+{
+  return d;
+}
+
+__attribute__((noipa)) unsigned _BitInt(192)
+testdblu_192 (double d)
+{
+  return d;
+}
+#endif
+
+#if __BITINT_MAXWIDTH__ >= 575
+__attribute__((noipa)) _BitInt(575)
+testdbl_575 (double d)
+{
+  return d;
+}
+
+__attribute__((noipa)) unsigned _BitInt(575)
+testdblu_575 (double d)
+{
+  return d;
+}
+#endif
+#endif
+
+#if __LDBL_MANT_DIG__ == 64
+#if __BITINT_MAXWIDTH__ >= 135
+__attribute__((noipa)) _BitInt(135)
+testldbl_135 (long double d)
+{
+  return d;
+}
+
+__attribute__((noipa)) unsigned _BitInt(135)
+testldblu_135 (long double d)
+{
+  return d;
+}
+#endif
+
+#if __BITINT_MAXWIDTH__ >= 192
+__attribute__((noipa)) _BitInt(192)
+testldbl_192 (long double d)
+{
+  return d;
+}
+
+__attribute__((noipa)) unsigned _BitInt(192)
+testldblu_192 (long double d)
+{
+  return d;
+}
+#endif
+
+#if __BITINT_MAXWIDTH__ >= 575
+__attribute__((noipa)) _BitInt(575)
+testldbl_575 (long double d)
+{
+  return d;
+}
+
+__attribute__((noipa)) unsigned _BitInt(575)
+testldblu_575 (long double d)
+{
+  return d;
+}
+#endif
+#endif
+
+#if __FLT128_MANT_DIG__ == 113
+#if __BITINT_MAXWIDTH__ >= 135
+__attribute__((noipa)) _BitInt(135)
+testflt128_135 (_Float128 d)
+{
+  return d;
+}
+
+__attribute__((noipa)) unsigned _BitInt(135)
+testflt128u_135 (_Float128 d)
+{
+  return d;
+}
+#endif
+
+#if __BITINT_MAXWIDTH__ >= 192
+__attribute__((noipa)) _BitInt(192)
+testflt128_192 (_Float128 d)
+{
+  return d;
+}
+
+__attribute__((noipa)) unsigned _BitInt(192)
+testflt128u_192 (_Float128 d)
+{
+  return d;
+}
+#endif
+
+#if __BITINT_MAXWIDTH__ >= 575
+__attribute__((noipa)) _BitInt(575)
+testflt128_575 (_Float128 d)
+{
+  return d;
+}
+
+__attribute__((noipa)) unsigned _BitInt(575)
+testflt128u_575 (_Float128 d)
+{
+  return d;
+}
+#endif
+#endif
+
+__attribute__((noipa)) void
+check_inexact (int test, int inex)
+{
+  if (!test)
+    __builtin_abort ();
+  if ((!fetestexcept (FE_INEXACT)) != (!inex))
+    __builtin_abort ();
+  feclearexcept (FE_INEXACT);
+}
+
+int
+main ()
+{
+#if __FLT_MANT_DIG__ == 24
+#if __BITINT_MAXWIDTH__ >= 135
+  check_inexact (testflt_135 (-85070591730234615865843651857942052864.0f) == -85070591730234615865843651857942052864wb, 0);
+  check_inexact (testflt_135 (0xffffffp+104f) == 340282346638528859811704183484516925440wb, 0);
+  check_inexact (testflt_135 (-0xffffffp+104f) == -340282346638528859811704183484516925440wb, 0);
+  check_inexact (testflt_135 (-0xffffffp-1f) == -8388607wb, 1);
+  check_inexact (testflt_135 (-0.f) == 0wb, 0);
+  check_inexact (testflt_135 (-0.f) == 0wb, 0);
+  check_inexact (testflt_135 (-0.9990234375f) == 0wb, 1);
+  check_inexact (testfltu_135 (0.f) == 0uwb, 0);
+  check_inexact (testfltu_135 (-0.9990234375f) == 0uwb, 1);
+  check_inexact (testfltu_135 (0xffffffp-1f) == 8388607uwb, 1);
+  check_inexact (testfltu_135 (0xffffffp+104f) == 340282346638528859811704183484516925440uwb, 0);
+#endif
+#if __BITINT_MAXWIDTH__ >= 192
+  check_inexact (testflt_192 (-85070591730234615865843651857942052864.0f) == -85070591730234615865843651857942052864wb, 0);
+  check_inexact (testflt_192 (0xffffffp+104f) == 340282346638528859811704183484516925440wb, 0);
+  check_inexact (testflt_192 (-0xffffffp+104f) == -340282346638528859811704183484516925440wb, 0);
+  check_inexact (testflt_192 (-0xffffffp-3f) == -2097151wb, 1);
+  check_inexact (testflt_192 (-0.f) == 0wb, 0);
+  check_inexact (testflt_192 (-0.9990234375f) == 0wb, 1);
+  check_inexact (testfltu_192 (0.f) == 0uwb, 0);
+  check_inexact (testfltu_192 (-0.9990234375f) == 0uwb, 1);
+  check_inexact (testfltu_192 (0xffffffp-3f) == 2097151uwb, 1);
+  check_inexact (testfltu_192 (0xffffffp+104f) == 340282346638528859811704183484516925440uwb, 0);
+#endif
+#if __BITINT_MAXWIDTH__ >= 575
+  check_inexact (testflt_575 (-85070591730234615865843651857942052864.0f) == -85070591730234615865843651857942052864wb, 0);
+  check_inexact (testflt_575 (0xffffffp+104f) == 340282346638528859811704183484516925440wb, 0);
+  check_inexact (testflt_575 (-0xffffffp+104f) == -340282346638528859811704183484516925440wb, 0);
+  check_inexact (testflt_575 (-0xffffffp-5f) == -524287wb, 1);
+  check_inexact (testflt_575 (0.f) == 0wb, 0);
+  check_inexact (testflt_575 (-0.9990234375f) == 0wb, 1);
+  check_inexact (testfltu_575 (-0.f) == 0uwb, 0);
+  check_inexact (testfltu_575 (-0.9990234375f) == 0uwb, 1);
+  check_inexact (testfltu_575 (0xffffffp-5f) == 524287uwb, 1);
+  check_inexact (testfltu_575 (0xffffffp+104f) == 340282346638528859811704183484516925440uwb, 0);
+#endif
+#endif
+#if __DBL_MANT_DIG__ == 53
+#if __BITINT_MAXWIDTH__ >= 135
+  check_inexact (testdbl_135 (-85070591730234615865843651857942052864.0) == -85070591730234615865843651857942052864wb, 0);
+  check_inexact (testdbl_135 (0x1fffffffffffffp+81) == 21778071482940059243804335646374816120832wb, 0);
+  check_inexact (testdbl_135 (-0x20000000000000p+81) == -21778071482940061661655974875633165533183wb - 1, 0);
+  check_inexact (testdbl_135 (-0x1fffffffffffffp-1) == -4503599627370495wb, 1);
+  check_inexact (testdbl_135 (-0.) == 0wb, 0);
+  check_inexact (testdbl_135 (-0.9990234375) == 0wb, 1);
+  check_inexact (testdblu_135 (0.) == 0uwb, 0);
+  check_inexact (testdblu_135 (-0.9990234375) == 0uwb, 1);
+  check_inexact (testdblu_135 (0x1fffffffffffffp-1) == 4503599627370495uwb, 1);
+  check_inexact (testdblu_135 (0x1fffffffffffffp+82) == 43556142965880118487608671292749632241664uwb, 0);
+#endif
+#if __BITINT_MAXWIDTH__ >= 192
+  check_inexact (testdbl_192 (-85070591730234615865843651857942052864.0) == -85070591730234615865843651857942052864wb, 0);
+  check_inexact (testdbl_192 (0x1fffffffffffffp+138) == 3138550867693340033468750984562846621555579712101368725504wb, 0);
+  check_inexact (testdbl_192 (-0x20000000000000p+138) == -3138550867693340381917894711603833208051177722232017256447wb - 1, 0);
+  check_inexact (testdbl_192 (-0x1fffffffffffffp-3) == -1125899906842623wb, 1);
+  check_inexact (testdbl_192 (0.) == 0wb, 0);
+  check_inexact (testdbl_192 (-0.9990234375) == 0wb, 1);
+  check_inexact (testdblu_192 (-0.) == 0uwb, 0);
+  check_inexact (testdblu_192 (-0.9990234375) == 0uwb, 1);
+  check_inexact (testdblu_192 (0x1fffffffffffffp-3) == 1125899906842623uwb, 1);
+  check_inexact (testdblu_192 (0x1fffffffffffffp+139) == 6277101735386680066937501969125693243111159424202737451008uwb, 0);
+#endif
+#if __BITINT_MAXWIDTH__ >= 575
+  check_inexact (testdbl_575 (-85070591730234615865843651857942052864.0) == -85070591730234615865843651857942052864wb, 0);
+  check_inexact (testdbl_575 (0x1fffffffffffffp+521) == 61832600368276126650327970124302082526882038193909742709080463879918896882169507607035916867654709124839777195049479857541529867095829765369898539058829479405123401922117632wb, 0);
+  check_inexact (testdbl_575 (-0x20000000000000p+521) == -61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174783wb - 1, 0);
+  check_inexact (testdbl_575 (-0x1fffffffffffffp-5) == -281474976710655wb, 1);
+  check_inexact (testdbl_575 (-0.) == 0wb, 0);
+  check_inexact (testdbl_575 (-0.9990234375) == 0wb, 1);
+  check_inexact (testdblu_575 (0.) == 0uwb, 0);
+  check_inexact (testdblu_575 (-0.9990234375) == 0uwb, 1);
+  check_inexact (testdblu_575 (0x1fffffffffffffp-5) == 281474976710655uwb, 1);
+  check_inexact (testdblu_575 (0x1fffffffffffffp+522) == 123665200736552253300655940248604165053764076387819485418160927759837793764339015214071833735309418249679554390098959715083059734191659530739797078117658958810246803844235264uwb, 0);
+#endif
+#endif
+#if __LDBL_MANT_DIG__ == 64
+#if __BITINT_MAXWIDTH__ >= 135
+  check_inexact (testldbl_135 (-85070591730234615865843651857942052864.0L) == -85070591730234615865843651857942052864wb, 0);
+  check_inexact (testldbl_135 (0xffffffffffffffffp+70L) == 21778071482940061660475383254915754229760wb, 0);
+  check_inexact (testldbl_135 (-0x10000000000000000p+70L) == -21778071482940061661655974875633165533183wb - 1, 0);
+  check_inexact (testldbl_135 (-0xffffffffffffffffp-1L) == -9223372036854775807wb, 1);
+  check_inexact (testldbl_135 (-0.L) == 0wb, 0);
+  check_inexact (testldbl_135 (-0.9990234375L) == 0wb, 1);
+  check_inexact (testldblu_135 (0.L) == 0uwb, 0);
+  check_inexact (testldblu_135 (-0.9990234375L) == 0uwb, 1);
+  check_inexact (testldblu_135 (0xffffffffffffffffp-1L) == 9223372036854775807uwb, 1);
+  check_inexact (testldblu_135 (0xffffffffffffffffp+71L) == 43556142965880123320950766509831508459520uwb, 0);
+#endif
+#if __BITINT_MAXWIDTH__ >= 192
+  check_inexact (testldbl_192 (-85070591730234615865843651857942052864.0L) == -85070591730234615865843651857942052864wb, 0);
+  check_inexact (testldbl_192 (0xffffffffffffffffp+127L) == 3138550867693340381747753528143363976319490418516133150720wb, 0);
+  check_inexact (testldbl_192 (-0x10000000000000000p+127L) == -3138550867693340381917894711603833208051177722232017256447wb - 1, 0);
+  check_inexact (testldbl_192 (-0xffffffffffffffffp-2L) == -4611686018427387903wb, 1);
+  check_inexact (testldbl_192 (0.L) == 0wb, 0);
+  check_inexact (testldbl_192 (-0.9990234375L) == 0wb, 1);
+  check_inexact (testldblu_192 (-0.L) == 0uwb, 0);
+  check_inexact (testldblu_192 (-0.9990234375L) == 0uwb, 1);
+  check_inexact (testldblu_192 (0xffffffffffffffffp-2L) == 4611686018427387903uwb, 1);
+  check_inexact (testldblu_192 (0xffffffffffffffffp+128L) == 6277101735386680763495507056286727952638980837032266301440uwb, 0);
+#endif
+#if __BITINT_MAXWIDTH__ >= 575
+  check_inexact (testldbl_575 (-85070591730234615865843651857942052864.0L) == -85070591730234615865843651857942052864wb, 0);
+  check_inexact (testldbl_575 (0xffffffffffffffffp+510L) == 61832600368276133511773678272426148233889331025751498446645922568076207932202076431648659257792374503198949281962308977915333294030066289778448068072486649492543280785653760wb, 0);
+  check_inexact (testldbl_575 (-0x10000000000000000p+510L) == -61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174783wb - 1, 0);
+  check_inexact (testldbl_575 (-0xffffffffffffffffp-4L) == -1152921504606846975wb, 1);
+  check_inexact (testldbl_575 (0.L) == 0wb, 0);
+  check_inexact (testldbl_575 (-0.9990234375L) == 0wb, 1);
+  check_inexact (testldblu_575 (-0.L) == 0uwb, 0);
+  check_inexact (testldblu_575 (-0.9990234375L) == 0uwb, 1);
+  check_inexact (testldblu_575 (0xffffffffffffffffp-4L) == 1152921504606846975uwb, 1);
+  check_inexact (testldblu_575 (0xffffffffffffffffp+511L) == 123665200736552267023547356544852296467778662051502996893291845136152415864404152863297318515584749006397898563924617955830666588060132579556896136144973298985086561571307520uwb, 0);
+#endif
+#endif
+#if __FLT128_MANT_DIG__ == 113
+#if __BITINT_MAXWIDTH__ >= 135
+  check_inexact (testflt128_135 (-85070591730234615865843651857942052864.0F128) == -85070591730234615865843651857942052864wb, 0);
+  check_inexact (testflt128_135 (0x1ffffffffffffffffffffffffffffp+21F128) == 21778071482940061661655974875633163436032wb, 0);
+  check_inexact (testflt128_135 (-0x20000000000000000000000000000p+21F128) == -21778071482940061661655974875633165533183wb - 1, 0);
+  check_inexact (testflt128_135 (-0x1ffffffffffffffffffffffffffffp-1F128) == -5192296858534827628530496329220095wb, 1);
+  check_inexact (testflt128_135 (-0.F128) == 0wb, 0);
+  check_inexact (testflt128_135 (-0.9990234375F128) == 0wb, 1);
+  check_inexact (testflt128u_135 (0.F128) == 0uwb, 0);
+  check_inexact (testflt128u_135 (-0.9990234375F128) == 0uwb, 1);
+  check_inexact (testflt128u_135 (0x1ffffffffffffffffffffffffffffp-1F128) == 5192296858534827628530496329220095uwb, 1);
+  check_inexact (testflt128u_135 (0x1ffffffffffffffffffffffffffffp+22F128) == 43556142965880123323311949751266326872064uwb, 0);
+#endif
+#if __BITINT_MAXWIDTH__ >= 192
+  check_inexact (testflt128_192 (-85070591730234615865843651857942052864.0F128) == -85070591730234615865843651857942052864wb, 0);
+  check_inexact (testflt128_192 (0x1ffffffffffffffffffffffffffffp+78F128) == 3138550867693340381917894711603832905819722818574723579904wb, 0);
+  check_inexact (testflt128_192 (-0x20000000000000000000000000000p+78F128) == -3138550867693340381917894711603833208051177722232017256447wb - 1, 0);
+  check_inexact (testflt128_192 (-0x1ffffffffffffffffffffffffffffp-4F128) == -649037107316853453566312041152511wb, 1);
+  check_inexact (testflt128_192 (-0.F128) == 0wb, 0);
+  check_inexact (testflt128_192 (-0.9990234375F128) == 0wb, 1);
+  check_inexact (testflt128u_192 (0.F128) == 0uwb, 0);
+  check_inexact (testflt128u_192 (-0.9990234375F128) == 0uwb, 1);
+  check_inexact (testflt128u_192 (0x1ffffffffffffffffffffffffffffp-4F128) == 649037107316853453566312041152511uwb, 1);
+  check_inexact (testflt128u_192 (0x1ffffffffffffffffffffffffffffp+79F128) == 6277101735386680763835789423207665811639445637149447159808uwb, 0);
+#endif
+#if __BITINT_MAXWIDTH__ >= 575
+  check_inexact (testflt128_575 (-85070591730234615865843651857942052864.0F128) == -85070591730234615865843651857942052864wb, 0);
+  check_inexact (testflt128_575 (0x1ffffffffffffffffffffffffffffp+461F128) == 61832600368276133515125630254911791554520007845691312598455129804691160851602940042069550439343049559602369631548246946680753811425558728725309540242943660463695151425912832wb, 0);
+  check_inexact (testflt128_575 (-0x20000000000000000000000000000p+461F128) == -61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174783wb - 1, 0);
+  check_inexact (testflt128_575 (-0x1ffffffffffffffffffffffffffffp-8F128) == -40564819207303340847894502572031wb, 1);
+  check_inexact (testflt128_575 (0.F128) == 0wb, 0);
+  check_inexact (testflt128_575 (-0.9990234375F128) == 0wb, 1);
+  check_inexact (testflt128u_575 (-0.F128) == 0uwb, 0);
+  check_inexact (testflt128u_575 (-0.9990234375F128) == 0uwb, 1);
+  check_inexact (testflt128u_575 (0x1ffffffffffffffffffffffffffffp-8F128) == 40564819207303340847894502572031uwb, 1);
+  check_inexact (testflt128u_575 (0x1ffffffffffffffffffffffffffffp+462F128) == 123665200736552267030251260509823583109040015691382625196910259609382321703205880084139100878686099119204739263096493893361507622851117457450619080485887320927390302851825664uwb, 0);
+#endif
+#endif
+}
--- gcc/testsuite/gcc.dg/bitint-30.c.jj	2023-09-04 16:57:40.503703479 +0200
+++ gcc/testsuite/gcc.dg/bitint-30.c	2023-09-04 19:21:32.680004331 +0200
@@ -0,0 +1,470 @@ 
+/* PR c/102989 */
+/* { dg-do run } */
+/* { dg-require-effective-target fenv_exceptions } */
+/* { dg-options "-std=c2x" } */
+/* { dg-add-options ieee } */
+
+#include <fenv.h>
+
+#if __FLT_MANT_DIG__ == 24
+#if __BITINT_MAXWIDTH__ >= 135
+__attribute__((noipa)) float
+testflt_135 (_BitInt(135) b)
+{
+  return b;
+}
+
+__attribute__((noipa)) float
+testfltu_135 (unsigned _BitInt(135) b)
+{
+  return b;
+}
+#endif
+
+#if __BITINT_MAXWIDTH__ >= 192
+__attribute__((noipa)) float
+testflt_192 (_BitInt(192) b)
+{
+  return b;
+}
+
+__attribute__((noipa)) float
+testfltu_192 (unsigned _BitInt(192) b)
+{
+  return b;
+}
+#endif
+
+#if __BITINT_MAXWIDTH__ >= 575
+__attribute__((noipa)) float
+testflt_575 (_BitInt(575) b)
+{
+  return b;
+}
+
+__attribute__((noipa)) float
+testfltu_575 (unsigned _BitInt(575) b)
+{
+  return b;
+}
+#endif
+#endif
+
+#if __DBL_MANT_DIG__ == 53
+#if __BITINT_MAXWIDTH__ >= 135
+__attribute__((noipa)) double
+testdbl_135 (_BitInt(135) b)
+{
+  return b;
+}
+
+__attribute__((noipa)) double
+testdblu_135 (unsigned _BitInt(135) b)
+{
+  return b;
+}
+#endif
+
+#if __BITINT_MAXWIDTH__ >= 192
+__attribute__((noipa)) double
+testdbl_192 (_BitInt(192) b)
+{
+  return b;
+}
+
+__attribute__((noipa)) double
+testdblu_192 (unsigned _BitInt(192) b)
+{
+  return b;
+}
+#endif
+
+#if __BITINT_MAXWIDTH__ >= 575
+__attribute__((noipa)) double
+testdbl_575 (_BitInt(575) b)
+{
+  return b;
+}
+
+__attribute__((noipa)) double
+testdblu_575 (unsigned _BitInt(575) b)
+{
+  return b;
+}
+#endif
+#endif
+
+#if __LDBL_MANT_DIG__ == 64
+#if __BITINT_MAXWIDTH__ >= 135
+__attribute__((noipa)) long double
+testldbl_135 (_BitInt(135) b)
+{
+  return b;
+}
+
+__attribute__((noipa)) long double
+testldblu_135 (unsigned _BitInt(135) b)
+{
+  return b;
+}
+#endif
+
+#if __BITINT_MAXWIDTH__ >= 192
+__attribute__((noipa)) long double
+testldbl_192 (_BitInt(192) b)
+{
+  return b;
+}
+
+__attribute__((noipa)) long double
+testldblu_192 (unsigned _BitInt(192) b)
+{
+  return b;
+}
+#endif
+
+#if __BITINT_MAXWIDTH__ >= 575
+__attribute__((noipa)) long double
+testldbl_575 (_BitInt(575) b)
+{
+  return b;
+}
+
+__attribute__((noipa)) long double
+testldblu_575 (unsigned _BitInt(575) b)
+{
+  return b;
+}
+#endif
+#endif
+
+#if __FLT128_MANT_DIG__ == 113
+#if __BITINT_MAXWIDTH__ >= 135
+__attribute__((noipa)) _Float128
+testflt128_135 (_BitInt(135) b)
+{
+  return b;
+}
+
+__attribute__((noipa)) _Float128
+testflt128u_135 (unsigned _BitInt(135) b)
+{
+  return b;
+}
+#endif
+
+#if __BITINT_MAXWIDTH__ >= 192
+__attribute__((noipa)) _Float128
+testflt128_192 (_BitInt(192) b)
+{
+  return b;
+}
+
+__attribute__((noipa)) _Float128
+testflt128u_192 (unsigned _BitInt(192) b)
+{
+  return b;
+}
+#endif
+
+#if __BITINT_MAXWIDTH__ >= 575
+__attribute__((noipa)) _Float128
+testflt128_575 (_BitInt(575) b)
+{
+  return b;
+}
+
+__attribute__((noipa)) _Float128
+testflt128u_575 (unsigned _BitInt(575) b)
+{
+  return b;
+}
+#endif
+#endif
+
+__attribute__((noipa)) void
+check_except (int test, int inex, int ovf)
+{
+  if (!test)
+    __builtin_abort ();
+  if ((!fetestexcept (FE_INEXACT)) != (!inex))
+    __builtin_abort ();
+  if ((!fetestexcept (FE_OVERFLOW)) != (!ovf))
+    __builtin_abort ();
+  feclearexcept (FE_INEXACT | FE_OVERFLOW);
+}
+
+int
+main ()
+{
+#if __FLT_MANT_DIG__ == 24
+#if __BITINT_MAXWIDTH__ >= 135
+  check_except (testflt_135 (151115713941029764726783wb) == 0xfffffep+53f, 1, 0);
+  check_except (testflt_135 (151115713941029764726784wb) == 0xfffffep+53f, 1, 0);
+  check_except (testflt_135 (151115713941029764726785wb) == 0xffffffp+53f, 1, 0);
+  check_except (testflt_135 (151115718444629392097280wb) == 0xffffffp+53f, 0, 0);
+  check_except (testflt_135 (151115722948229019467775wb) == 0xffffffp+53f, 1, 0);
+  check_except (testflt_135 (151115722948229019467776wb) == 0x1000000p+53f, 1, 0);
+  check_except (testflt_135 (151115722948229019467777wb) == 0x1000000p+53f, 1, 0);
+  check_except (testflt_135 (-340282346638528859811704183484516925440wb) == -0xffffffp+104f, 0, 0);
+  check_except (testflt_135 (-340282356779733661637539395458142568447wb) == -0xffffffp+104f, 1, 0);
+  check_except (testflt_135 (-340282356779733661637539395458142568448wb) == -__builtin_inff (), 1, 1);
+  check_except (testflt_135 (-21778071482940061661655974875633165533183wb - 1) == -__builtin_inff (), 1, 1);
+  check_except (testfltu_135 (151115713941029764726783uwb) == 0xfffffep+53f, 1, 0);
+  check_except (testfltu_135 (151115713941029764726784uwb) == 0xfffffep+53f, 1, 0);
+  check_except (testfltu_135 (151115713941029764726785uwb) == 0xffffffp+53f, 1, 0);
+  check_except (testfltu_135 (151115718444629392097280uwb) == 0xffffffp+53f, 0, 0);
+  check_except (testfltu_135 (151115722948229019467775uwb) == 0xffffffp+53f, 1, 0);
+  check_except (testfltu_135 (151115722948229019467776uwb) == 0x1000000p+53f, 1, 0);
+  check_except (testfltu_135 (151115722948229019467777uwb) == 0x1000000p+53f, 1, 0);
+  check_except (testfltu_135 (340282346638528859811704183484516925440uwb) == 0xffffffp+104f, 0, 0);
+  check_except (testfltu_135 (340282356779733661637539395458142568447uwb) == 0xffffffp+104f, 1, 0);
+  check_except (testfltu_135 (340282356779733661637539395458142568448uwb) == __builtin_inff (), 1, 1);
+  check_except (testfltu_135 (43556142965880123323311949751266331066367uwb) == __builtin_inff (), 1, 1);
+#endif
+#if __BITINT_MAXWIDTH__ >= 192
+  check_except (testflt_192 (-10141203895131470501001744613375wb) == -0xfffffep+79f, 1, 0);
+  check_except (testflt_192 (-10141203895131470501001744613376wb) == -0xfffffep+79f, 1, 0);
+  check_except (testflt_192 (-10141203895131470501001744613377wb) == -0xffffffp+79f, 1, 0);
+  check_except (testflt_192 (-10141204197362925404659038289920wb) == -0xffffffp+79f, 0, 0);
+  check_except (testflt_192 (-10141204499594380308316331966463wb) == -0xffffffp+79f, 1, 0);
+  check_except (testflt_192 (-10141204499594380308316331966464wb) == -0x1000000p+79f, 1, 0);
+  check_except (testflt_192 (-10141204499594380308316331966465wb) == -0x1000000p+79f, 1, 0);
+  check_except (testflt_192 (340282346638528859811704183484516925440wb) == 0xffffffp+104f, 0, 0);
+  check_except (testflt_192 (340282356779733661637539395458142568447wb) == 0xffffffp+104f, 1, 0);
+  check_except (testflt_192 (340282356779733661637539395458142568448wb) == __builtin_inff (), 1, 1);
+  check_except (testflt_192 (3138550867693340381917894711603833208051177722232017256447wb) == __builtin_inff (), 1, 1);
+  check_except (testfltu_192 (10141203895131470501001744613375uwb) == 0xfffffep+79f, 1, 0);
+  check_except (testfltu_192 (10141203895131470501001744613376uwb) == 0xfffffep+79f, 1, 0);
+  check_except (testfltu_192 (10141203895131470501001744613377uwb) == 0xffffffp+79f, 1, 0);
+  check_except (testfltu_192 (10141204197362925404659038289920uwb) == 0xffffffp+79f, 0, 0);
+  check_except (testfltu_192 (10141204499594380308316331966463uwb) == 0xffffffp+79f, 1, 0);
+  check_except (testfltu_192 (10141204499594380308316331966464uwb) == 0x1000000p+79f, 1, 0);
+  check_except (testfltu_192 (10141204499594380308316331966465uwb) == 0x1000000p+79f, 1, 0);
+  check_except (testfltu_192 (340282346638528859811704183484516925440uwb) == 0xffffffp+104f, 0, 0);
+  check_except (testfltu_192 (340282356779733661637539395458142568447uwb) == 0xffffffp+104f, 1, 0);
+  check_except (testfltu_192 (340282356779733661637539395458142568448uwb) == __builtin_inff (), 1, 1);
+  check_except (testfltu_192 (6277101735386680763835789423207666416102355444464034512895uwb) == __builtin_inff (), 1, 1);
+#endif
+#if __BITINT_MAXWIDTH__ >= 575
+  check_except (testflt_575 (10633823015541376812058405359715352575wb) == 0xfffffep+99f, 1, 0);
+  check_except (testflt_575 (10633823015541376812058405359715352576wb) == 0xfffffep+99f, 1, 0);
+  check_except (testflt_575 (10633823015541376812058405359715352577wb) == 0xffffffp+99f, 1, 0);
+  check_except (testflt_575 (10633823332454026869115755733891153920wb) == 0xffffffp+99f, 0, 0);
+  check_except (testflt_575 (10633823649366676926173106108066955263wb) == 0xffffffp+99f, 1, 0);
+  check_except (testflt_575 (10633823649366676926173106108066955264wb) == 0x1000000p+99f, 1, 0);
+  check_except (testflt_575 (10633823649366676926173106108066955265wb) == 0x1000000p+99f, 1, 0);
+  check_except (testflt_575 (-340282346638528859811704183484516925440wb) == -0xffffffp+104f, 0, 0);
+  check_except (testflt_575 (-340282356779733661637539395458142568447wb) == -0xffffffp+104f, 1, 0);
+  check_except (testflt_575 (-340282356779733661637539395458142568448wb) == -__builtin_inff (), 1, 1);
+  check_except (testflt_575 (-61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174783wb - 1) == -__builtin_inff (), 1, 1);
+  check_except (testfltu_575 (10633823015541376812058405359715352575uwb) == 0xfffffep+99f, 1, 0);
+  check_except (testfltu_575 (10633823015541376812058405359715352576uwb) == 0xfffffep+99f, 1, 0);
+  check_except (testfltu_575 (10633823015541376812058405359715352577uwb) == 0xffffffp+99f, 1, 0);
+  check_except (testfltu_575 (10633823332454026869115755733891153920uwb) == 0xffffffp+99f, 0, 0);
+  check_except (testfltu_575 (10633823649366676926173106108066955263uwb) == 0xffffffp+99f, 1, 0);
+  check_except (testfltu_575 (10633823649366676926173106108066955264uwb) == 0x1000000p+99f, 1, 0);
+  check_except (testfltu_575 (10633823649366676926173106108066955265uwb) == 0x1000000p+99f, 1, 0);
+  check_except (testfltu_575 (340282346638528859811704183484516925440uwb) == 0xffffffp+104f, 0, 0);
+  check_except (testfltu_575 (340282356779733661637539395458142568447uwb) == 0xffffffp+104f, 1, 0);
+  check_except (testfltu_575 (340282356779733661637539395458142568448uwb) == __builtin_inff (), 1, 1);
+  check_except (testfltu_575 (123665200736552267030251260509823595017565674550605919957031528046448612553265933585158200530621522494798835713008069669675682517153375604983773077550946583958303386074349567uwb) == __builtin_inff (), 1, 1);
+#endif
+#endif
+#if __DBL_MANT_DIG__ == 53
+#if __BITINT_MAXWIDTH__ >= 135
+  check_except (testdbl_135 (-21267647932558650424686050812251602943wb) == -0x1ffffffffffffep+71, 1, 0);
+  check_except (testdbl_135 (-21267647932558650424686050812251602944wb) == -0x1ffffffffffffep+71, 1, 0);
+  check_except (testdbl_135 (-21267647932558650424686050812251602945wb) == -0x1fffffffffffffp+71, 1, 0);
+  check_except (testdbl_135 (-21267647932558651605277671529662906368wb) == -0x1fffffffffffffp+71, 0, 0);
+  check_except (testdbl_135 (-21267647932558652785869292247074209791wb) == -0x1fffffffffffffp+71, 1, 0);
+  check_except (testdbl_135 (-21267647932558652785869292247074209792wb) == -0x20000000000000p+71, 1, 0);
+  check_except (testdbl_135 (-21267647932558652785869292247074209793wb) == -0x20000000000000p+71, 1, 0);
+  check_except (testdbl_135 (21778071482940059243804335646374816120832wb) == 0x1fffffffffffffp+81, 0, 0);
+  check_except (testdbl_135 (21778071482940060452730155261003990827007wb) == 0x1fffffffffffffp+81, 1, 0);
+  check_except (testdbl_135 (21778071482940060452730155261003990827008wb) == 0x20000000000000p+81, 1, 0);
+  check_except (testdbl_135 (21778071482940060452730155261003990827009wb) == 0x20000000000000p+81, 1, 0);
+  check_except (testdbl_135 (21778071482940061661655974875633165533183wb) == 0x20000000000000p+81, 1, 0);
+  check_except (testdblu_135 (21267647932558650424686050812251602943uwb) == 0x1ffffffffffffep+71, 1, 0);
+  check_except (testdblu_135 (21267647932558650424686050812251602944uwb) == 0x1ffffffffffffep+71, 1, 0);
+  check_except (testdblu_135 (21267647932558650424686050812251602945uwb) == 0x1fffffffffffffp+71, 1, 0);
+  check_except (testdblu_135 (21267647932558651605277671529662906368uwb) == 0x1fffffffffffffp+71, 0, 0);
+  check_except (testdblu_135 (21267647932558652785869292247074209791uwb) == 0x1fffffffffffffp+71, 1, 0);
+  check_except (testdblu_135 (21267647932558652785869292247074209792uwb) == 0x20000000000000p+71, 1, 0);
+  check_except (testdblu_135 (21267647932558652785869292247074209793uwb) == 0x20000000000000p+71, 1, 0);
+  check_except (testdblu_135 (43556142965880118487608671292749632241664uwb) == 0x1fffffffffffffp+82, 0, 0);
+  check_except (testdblu_135 (43556142965880120905460310522007981654015uwb) == 0x1fffffffffffffp+82, 1, 0);
+  check_except (testdblu_135 (43556142965880120905460310522007981654016uwb) == 0x20000000000000p+82, 1, 0);
+  check_except (testdblu_135 (43556142965880120905460310522007981654017uwb) == 0x20000000000000p+82, 1, 0);
+  check_except (testdblu_135 (43556142965880123323311949751266331066367uwb) == 0x20000000000000p+82, 1, 0);
+#endif
+#if __BITINT_MAXWIDTH__ >= 192
+  check_except (testdbl_192 (89202980794122477710862401666030147234430975wb) == 0x1ffffffffffffep+93, 1, 0);
+  check_except (testdbl_192 (89202980794122477710862401666030147234430976wb) == 0x1ffffffffffffep+93, 1, 0);
+  check_except (testdbl_192 (89202980794122477710862401666030147234430977wb) == 0x1fffffffffffffp+93, 1, 0);
+  check_except (testdbl_192 (89202980794122482662622558807551246830927872wb) == 0x1fffffffffffffp+93, 0, 0);
+  check_except (testdbl_192 (89202980794122487614382715949072346427424767wb) == 0x1fffffffffffffp+93, 1, 0);
+  check_except (testdbl_192 (89202980794122487614382715949072346427424768wb) == 0x20000000000000p+93, 1, 0);
+  check_except (testdbl_192 (89202980794122487614382715949072346427424769wb) == 0x20000000000000p+93, 1, 0);
+  check_except (testdbl_192 (-3138550867693340033468750984562846621555579712101368725504wb) == -0x1fffffffffffffp+138, 0, 0);
+  check_except (testdbl_192 (-3138550867693340207693322848083339914803378717166692990975wb) == -0x1fffffffffffffp+138, 1, 0);
+  check_except (testdbl_192 (-3138550867693340207693322848083339914803378717166692990976wb) == -0x20000000000000p+138, 1, 0);
+  check_except (testdbl_192 (-3138550867693340207693322848083339914803378717166692990977wb) == -0x20000000000000p+138, 1, 0);
+  check_except (testdbl_192 (-3138550867693340381917894711603833208051177722232017256447wb - 1) == -0x20000000000000p+138, 0, 0);
+  check_except (testdblu_192 (89202980794122477710862401666030147234430975uwb) == 0x1ffffffffffffep+93, 1, 0);
+  check_except (testdblu_192 (89202980794122477710862401666030147234430976uwb) == 0x1ffffffffffffep+93, 1, 0);
+  check_except (testdblu_192 (89202980794122477710862401666030147234430977uwb) == 0x1fffffffffffffp+93, 1, 0);
+  check_except (testdblu_192 (89202980794122482662622558807551246830927872uwb) == 0x1fffffffffffffp+93, 0, 0);
+  check_except (testdblu_192 (89202980794122487614382715949072346427424767uwb) == 0x1fffffffffffffp+93, 1, 0);
+  check_except (testdblu_192 (89202980794122487614382715949072346427424768uwb) == 0x20000000000000p+93, 1, 0);
+  check_except (testdblu_192 (89202980794122487614382715949072346427424769uwb) == 0x20000000000000p+93, 1, 0);
+  check_except (testdblu_192 (6277101735386680066937501969125693243111159424202737451008uwb) == 0x1fffffffffffffp+139, 0, 0);
+  check_except (testdblu_192 (6277101735386680415386645696166679829606757434333385981951uwb) == 0x1fffffffffffffp+139, 1, 0);
+  check_except (testdblu_192 (6277101735386680415386645696166679829606757434333385981952uwb) == 0x20000000000000p+139, 1, 0);
+  check_except (testdblu_192 (6277101735386680415386645696166679829606757434333385981953uwb) == 0x20000000000000p+139, 1, 0);
+  check_except (testdblu_192 (6277101735386680763835789423207666416102355444464034512895uwb) == 0x20000000000000p+139, 1, 0);
+#endif
+#if __BITINT_MAXWIDTH__ >= 575
+  check_except (testdbl_575 (-615656346818663635164482277361060010743329029962521103256875011322006445221646740336801072761830405785423389392895wb) == -0x1ffffffffffffep+325, 1, 0);
+  check_except (testdbl_575 (-615656346818663635164482277361060010743329029962521103256875011322006445221646740336801072761830405785423389392896wb) == -0x1ffffffffffffep+325, 1, 0);
+  check_except (testdbl_575 (-615656346818663635164482277361060010743329029962521103256875011322006445221646740336801072761830405785423389392897wb) == -0x1fffffffffffffp+325, 1, 0);
+  check_except (testdbl_575 (-615656346818663669340274852095621329063676328675354936900147369028450764374312465492316685252079206152816780378112wb) == -0x1fffffffffffffp+325, 0, 0);
+  check_except (testdbl_575 (-615656346818663703516067426830182647384023627388188770543419726734895083526978190647832297742328006520210171363327wb) == -0x1fffffffffffffp+325, 1, 0);
+  check_except (testdbl_575 (-615656346818663703516067426830182647384023627388188770543419726734895083526978190647832297742328006520210171363328wb) == -0x20000000000000p+325, 1, 0);
+  check_except (testdbl_575 (-615656346818663703516067426830182647384023627388188770543419726734895083526978190647832297742328006520210171363329wb) == -0x20000000000000p+325, 1, 0);
+  check_except (testdbl_575 (61832600368276126650327970124302082526882038193909742709080463879918896882169507607035916867654709124839777195049479857541529867095829765369898539058829479405123401922117632wb) == 0x1fffffffffffffp+521, 0, 0);
+  check_except (testdbl_575 (61832600368276130082726800189606940017832437734606351343798113951571601579401237199807508566482735186119597525776757346189685562836258783930892538917151385692137547479646207wb) == 0x1fffffffffffffp+521, 1, 0);
+  check_except (testdbl_575 (61832600368276130082726800189606940017832437734606351343798113951571601579401237199807508566482735186119597525776757346189685562836258783930892538917151385692137547479646208wb) == 0x20000000000000p+521, 1, 0);
+  check_except (testdbl_575 (61832600368276130082726800189606940017832437734606351343798113951571601579401237199807508566482735186119597525776757346189685562836258783930892538917151385692137547479646209wb) == 0x20000000000000p+521, 1, 0);
+  check_except (testdbl_575 (61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174783wb) == 0x20000000000000p+521, 1, 0);
+  check_except (testdblu_575 (615656346818663635164482277361060010743329029962521103256875011322006445221646740336801072761830405785423389392895uwb) == 0x1ffffffffffffep+325, 1, 0);
+  check_except (testdblu_575 (615656346818663635164482277361060010743329029962521103256875011322006445221646740336801072761830405785423389392896uwb) == 0x1ffffffffffffep+325, 1, 0);
+  check_except (testdblu_575 (615656346818663635164482277361060010743329029962521103256875011322006445221646740336801072761830405785423389392897uwb) == 0x1fffffffffffffp+325, 1, 0);
+  check_except (testdblu_575 (615656346818663669340274852095621329063676328675354936900147369028450764374312465492316685252079206152816780378112uwb) == 0x1fffffffffffffp+325, 0, 0);
+  check_except (testdblu_575 (615656346818663703516067426830182647384023627388188770543419726734895083526978190647832297742328006520210171363327uwb) == 0x1fffffffffffffp+325, 1, 0);
+  check_except (testdblu_575 (615656346818663703516067426830182647384023627388188770543419726734895083526978190647832297742328006520210171363328uwb) == 0x20000000000000p+325, 1, 0);
+  check_except (testdblu_575 (615656346818663703516067426830182647384023627388188770543419726734895083526978190647832297742328006520210171363329uwb) == 0x20000000000000p+325, 1, 0);
+  check_except (testdblu_575 (123665200736552253300655940248604165053764076387819485418160927759837793764339015214071833735309418249679554390098959715083059734191659530739797078117658958810246803844235264uwb) == 0x1fffffffffffffp+522, 0, 0);
+  check_except (testdblu_575 (123665200736552260165453600379213880035664875469212702687596227903143203158802474399615017132965470372239195051553514692379371125672517567861785077834302771384275094959292415uwb) == 0x1fffffffffffffp+522, 1, 0);
+  check_except (testdblu_575 (123665200736552260165453600379213880035664875469212702687596227903143203158802474399615017132965470372239195051553514692379371125672517567861785077834302771384275094959292416uwb) == 0x20000000000000p+522, 1, 0);
+  check_except (testdblu_575 (123665200736552260165453600379213880035664875469212702687596227903143203158802474399615017132965470372239195051553514692379371125672517567861785077834302771384275094959292417uwb) == 0x20000000000000p+522, 1, 0);
+  check_except (testdblu_575 (123665200736552267030251260509823595017565674550605919957031528046448612553265933585158200530621522494798835713008069669675682517153375604983773077550946583958303386074349567uwb) == 0x20000000000000p+522, 1, 0);
+#endif
+#endif
+#if __LDBL_MANT_DIG__ == 64
+#if __BITINT_MAXWIDTH__ >= 135
+  check_except (testldbl_135 (-27577662721237071616947187835994111wb) == -0xa9f5e144d113e1c4p+51L, 1, 0);
+  check_except (testldbl_135 (-27577662721237071616947187835994112wb) == -0xa9f5e144d113e1c4p+51L, 1, 0);
+  check_except (testldbl_135 (-27577662721237071616947187835994113wb) == -0xa9f5e144d113e1c5p+51L, 1, 0);
+  check_except (testldbl_135 (-27577662721237071618073087742836736wb) == -0xa9f5e144d113e1c5p+51L, 0, 0);
+  check_except (testldbl_135 (-27577662721237071619198987649679359wb) == -0xa9f5e144d113e1c5p+51L, 1, 0);
+  check_except (testldbl_135 (-27577662721237071619198987649679360wb) == -0xa9f5e144d113e1c6p+51L, 1, 0);
+  check_except (testldbl_135 (-27577662721237071619198987649679361wb) == -0xa9f5e144d113e1c6p+51L, 1, 0);
+  check_except (testldbl_135 (-21778071482940061660475383254915754229760wb) == -0xffffffffffffffffp+70L, 0, 0);
+  check_except (testldbl_135 (-21778071482940061661065679065274459881471wb) == -0xffffffffffffffffp+70L, 1, 0);
+  check_except (testldbl_135 (-21778071482940061661065679065274459881472wb) == -0x10000000000000000p+70L, 1, 0);
+  check_except (testldbl_135 (-21778071482940061661065679065274459881473wb) == -0x10000000000000000p+70L, 1, 0);
+  check_except (testldbl_135 (-21778071482940061661655974875633165533183wb - 1) == -0x10000000000000000p+70L, 0, 0);
+  check_except (testldblu_135 (27577662721237071616947187835994111uwb) == 0xa9f5e144d113e1c4p+51L, 1, 0);
+  check_except (testldblu_135 (27577662721237071616947187835994112uwb) == 0xa9f5e144d113e1c4p+51L, 1, 0);
+  check_except (testldblu_135 (27577662721237071616947187835994113uwb) == 0xa9f5e144d113e1c5p+51L, 1, 0);
+  check_except (testldblu_135 (27577662721237071618073087742836736uwb) == 0xa9f5e144d113e1c5p+51L, 0, 0);
+  check_except (testldblu_135 (27577662721237071619198987649679359uwb) == 0xa9f5e144d113e1c5p+51L, 1, 0);
+  check_except (testldblu_135 (27577662721237071619198987649679360uwb) == 0xa9f5e144d113e1c6p+51L, 1, 0);
+  check_except (testldblu_135 (27577662721237071619198987649679361uwb) == 0xa9f5e144d113e1c6p+51L, 1, 0);
+  check_except (testldblu_135 (43556142965880123320950766509831508459520uwb) == 0xffffffffffffffffp+71L, 0, 0);
+  check_except (testldblu_135 (43556142965880123322131358130548919762943uwb) == 0xffffffffffffffffp+71L, 1, 0);
+  check_except (testldblu_135 (43556142965880123322131358130548919762944uwb) == 0x10000000000000000p+71L, 1, 0);
+  check_except (testldblu_135 (43556142965880123322131358130548919762945uwb) == 0x10000000000000000p+71L, 1, 0);
+  check_except (testldblu_135 (43556142965880123323311949751266331066367uwb) == 0x10000000000000000p+71L, 1, 0);
+#endif
+#if __BITINT_MAXWIDTH__ >= 192
+  check_except (testldbl_192 (96388802158769743653878219701497927252918090596351wb) == 0x83e75ebf94ce024ep+103L, 1, 0);
+  check_except (testldbl_192 (96388802158769743653878219701497927252918090596352wb) == 0x83e75ebf94ce024ep+103L, 1, 0);
+  check_except (testldbl_192 (96388802158769743653878219701497927252918090596353wb) == 0x83e75ebf94ce024fp+103L, 1, 0);
+  check_except (testldbl_192 (96388802158769743658948822102410844858904903417856wb) == 0x83e75ebf94ce024fp+103L, 0, 0);
+  check_except (testldbl_192 (96388802158769743664019424503323762464891716239359wb) == 0x83e75ebf94ce024fp+103L, 1, 0);
+  check_except (testldbl_192 (96388802158769743664019424503323762464891716239360wb) == 0x83e75ebf94ce0250p+103L, 1, 0);
+  check_except (testldbl_192 (96388802158769743664019424503323762464891716239361wb) == 0x83e75ebf94ce0250p+103L, 1, 0);
+  check_except (testldbl_192 (-3138550867693340381747753528143363976319490418516133150720wb) == -0xffffffffffffffffp+127L, 0, 0);
+  check_except (testldbl_192 (-3138550867693340381832824119873598592185334070374075203583wb) == -0xffffffffffffffffp+127L, 1, 0);
+  check_except (testldbl_192 (-3138550867693340381832824119873598592185334070374075203584wb) == -0x10000000000000000p+127L, 1, 0);
+  check_except (testldbl_192 (-3138550867693340381832824119873598592185334070374075203585wb) == -0x10000000000000000p+127L, 1, 0);
+  check_except (testldbl_192 (-3138550867693340381917894711603833208051177722232017256447wb - 1wb) == -0x10000000000000000p+127L, 0, 0);
+  check_except (testldblu_192 (96388802158769743653878219701497927252918090596351uwb) == 0x83e75ebf94ce024ep+103L, 1, 0);
+  check_except (testldblu_192 (96388802158769743653878219701497927252918090596352uwb) == 0x83e75ebf94ce024ep+103L, 1, 0);
+  check_except (testldblu_192 (96388802158769743653878219701497927252918090596353uwb) == 0x83e75ebf94ce024fp+103L, 1, 0);
+  check_except (testldblu_192 (96388802158769743658948822102410844858904903417856uwb) == 0x83e75ebf94ce024fp+103L, 0, 0);
+  check_except (testldblu_192 (96388802158769743664019424503323762464891716239359uwb) == 0x83e75ebf94ce024fp+103L, 1, 0);
+  check_except (testldblu_192 (96388802158769743664019424503323762464891716239360uwb) == 0x83e75ebf94ce0250p+103L, 1, 0);
+  check_except (testldblu_192 (96388802158769743664019424503323762464891716239361uwb) == 0x83e75ebf94ce0250p+103L, 1, 0);
+  check_except (testldblu_192 (6277101735386680763495507056286727952638980837032266301440uwb) == 0xffffffffffffffffp+128L, 0, 0);
+  check_except (testldblu_192 (6277101735386680763665648239747197184370668140748150407167uwb) == 0xffffffffffffffffp+128L, 1, 0);
+  check_except (testldblu_192 (6277101735386680763665648239747197184370668140748150407168uwb) == 0x10000000000000000p+128L, 1, 0);
+  check_except (testldblu_192 (6277101735386680763665648239747197184370668140748150407169uwb) == 0x10000000000000000p+128L, 1, 0);
+  check_except (testldblu_192 (6277101735386680763835789423207666416102355444464034512895uwb) == 0x10000000000000000p+128L, 1, 0);
+#endif
+#if __BITINT_MAXWIDTH__ >= 575
+  check_except (testldbl_575 (-61832600368276133511773678272426148233889331025751498446645922568076207932202076431648659257792374503198949281962308977915333294030066289778448068072486649492543280785653760wb) == -0xffffffffffffffffp+510L, 0, 0);
+  check_except (testldbl_575 (-61832600368276133513449654263668972871336084150527229212580843295650257104417521612113879761551567875299183569233171906376587276303377046135167303423979970735847486911414271wb) == -0xffffffffffffffffp+510L, 1, 0);
+  check_except (testldbl_575 (-61832600368276133513449654263668972871336084150527229212580843295650257104417521612113879761551567875299183569233171906376587276303377046135167303423979970735847486911414272wb) == -0x10000000000000000p+510L, 1, 0);
+  check_except (testldbl_575 (-61832600368276133513449654263668972871336084150527229212580843295650257104417521612113879761551567875299183569233171906376587276303377046135167303423979970735847486911414273wb) == -0x10000000000000000p+510L, 1, 0);
+  check_except (testldbl_575 (-61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174783wb - 1) == -0x10000000000000000p+510L, 0, 0);
+  check_except (testldblu_575 (123665200736552267023547356544852296467778662051502996893291845136152415864404152863297318515584749006397898563924617955830666588060132579556896136144973298985086561571307520uwb) == 0xffffffffffffffffp+511L, 0, 0);
+  check_except (testldblu_575 (123665200736552267026899308527337945742672168301054458425161686591300514208835043224227759523103135750598367138466343812753174552606754092270334606847959941471694973822828543uwb) == 0xffffffffffffffffp+511L, 1, 0);
+  check_except (testldblu_575 (123665200736552267026899308527337945742672168301054458425161686591300514208835043224227759523103135750598367138466343812753174552606754092270334606847959941471694973822828544uwb) == 0x10000000000000000p+511L, 1, 0);
+  check_except (testldblu_575 (123665200736552267026899308527337945742672168301054458425161686591300514208835043224227759523103135750598367138466343812753174552606754092270334606847959941471694973822828545uwb) == 0x10000000000000000p+511L, 1, 0);
+  check_except (testldblu_575 (123665200736552267030251260509823595017565674550605919957031528046448612553265933585158200530621522494798835713008069669675682517153375604983773077550946583958303386074349567uwb) == 0x10000000000000000p+511L, 1, 0);
+#endif
+#endif
+#if __FLT128_MANT_DIG__ == 113
+#if __BITINT_MAXWIDTH__ >= 135
+  check_except (testflt128_135 (-21646332438261169091754659013488783917055wb) == -0x1fce71fdcfb1797b42dede66ac9ecp+21F128, 1, 0);
+  check_except (testflt128_135 (-21646332438261169091754659013488783917056wb) == -0x1fce71fdcfb1797b42dede66ac9ecp+21F128, 1, 0);
+  check_except (testflt128_135 (-21646332438261169091754659013488783917057wb) == -0x1fce71fdcfb1797b42dede66ac9edp+21F128, 1, 0);
+  check_except (testflt128_135 (-21646332438261169091754659013488784965632wb) == -0x1fce71fdcfb1797b42dede66ac9edp+21F128, 0, 0);
+  check_except (testflt128_135 (-21646332438261169091754659013488786014207wb) == -0x1fce71fdcfb1797b42dede66ac9edp+21F128, 1, 0);
+  check_except (testflt128_135 (-21646332438261169091754659013488786014208wb) == -0x1fce71fdcfb1797b42dede66ac9eep+21F128, 1, 0);
+  check_except (testflt128_135 (-21646332438261169091754659013488786014209wb) == -0x1fce71fdcfb1797b42dede66ac9eep+21F128, 1, 0);
+  check_except (testflt128u_135 (21646332438261169091754659013488783917055uwb) == 0x1fce71fdcfb1797b42dede66ac9ecp+21F128, 1, 0);
+  check_except (testflt128u_135 (21646332438261169091754659013488783917056uwb) == 0x1fce71fdcfb1797b42dede66ac9ecp+21F128, 1, 0);
+  check_except (testflt128u_135 (21646332438261169091754659013488783917057uwb) == 0x1fce71fdcfb1797b42dede66ac9edp+21F128, 1, 0);
+  check_except (testflt128u_135 (21646332438261169091754659013488784965632uwb) == 0x1fce71fdcfb1797b42dede66ac9edp+21F128, 0, 0);
+  check_except (testflt128u_135 (21646332438261169091754659013488786014207uwb) == 0x1fce71fdcfb1797b42dede66ac9edp+21F128, 1, 0);
+  check_except (testflt128u_135 (21646332438261169091754659013488786014208uwb) == 0x1fce71fdcfb1797b42dede66ac9eep+21F128, 1, 0);
+  check_except (testflt128u_135 (21646332438261169091754659013488786014209uwb) == 0x1fce71fdcfb1797b42dede66ac9eep+21F128, 1, 0);
+#endif
+#if __BITINT_MAXWIDTH__ >= 192
+  check_except (testflt128_192 (3138550867693340381917894711603832905819722818574723579904wb) == 0x1ffffffffffffffffffffffffffffp+78F128, 0, 0);
+  check_except (testflt128_192 (3138550867693340381917894711603833056935450270403370418175wb) == 0x1ffffffffffffffffffffffffffffp+78F128, 1, 0);
+  check_except (testflt128_192 (3138550867693340381917894711603833056935450270403370418176wb) == 0x20000000000000000000000000000p+78F128, 1, 0);
+  check_except (testflt128_192 (3138550867693340381917894711603833056935450270403370418177wb) == 0x20000000000000000000000000000p+78F128, 1, 0);
+  check_except (testflt128_192 (3138550867693340381917894711603833208051177722232017256447wb) == 0x20000000000000000000000000000p+78F128, 1, 0);
+  check_except (testflt128u_192 (6277101735386680763835789423207665811639445637149447159808uwb) == 0x1ffffffffffffffffffffffffffffp+79F128, 0, 0);
+  check_except (testflt128u_192 (6277101735386680763835789423207666113870900540806740836351uwb) == 0x1ffffffffffffffffffffffffffffp+79F128, 1, 0);
+  check_except (testflt128u_192 (6277101735386680763835789423207666113870900540806740836352uwb) == 0x20000000000000000000000000000p+79F128, 1, 0);
+  check_except (testflt128u_192 (6277101735386680763835789423207666113870900540806740836353uwb) == 0x20000000000000000000000000000p+79F128, 1, 0);
+  check_except (testflt128u_192 (6277101735386680763835789423207666416102355444464034512895uwb) == 0x20000000000000000000000000000p+79F128, 1, 0);
+#endif
+#if __BITINT_MAXWIDTH__ >= 575
+  check_except (testflt128_575 (-39695651458311907436978914487787846289740055435765388813682045155135192382154626611682813571487190641804615256990296246545713518740501887218789991403746059512699763279527936wb) == -0x148b25ce53790ddc343a80e5af6bap+461F128, 0, 0);
+  check_except (testflt128_575 (-39695651458311907436978914487787849266871470150571212503712362264401765094669639986937588484471046485703139369468190190624257242316066424102078490670010875270428034085158911wb) == -0x148b25ce53790ddc343a80e5af6bap+461F128, 1, 0);
+  check_except (testflt128_575 (-39695651458311907436978914487787849266871470150571212503712362264401765094669639986937588484471046485703139369468190190624257242316066424102078490670010875270428034085158912wb) == -0x148b25ce53790ddc343a80e5af6bap+461F128, 1, 0);
+  check_except (testflt128_575 (-39695651458311907436978914487787849266871470150571212503712362264401765094669639986937588484471046485703139369468190190624257242316066424102078490670010875270428034085158913wb) == -0x148b25ce53790ddc343a80e5af6bbp+461F128, 1, 0);
+  check_except (testflt128_575 (-39695651458311907436978914487787852244002884865377036193742679373668337807184653362192363397454902329601663481946084134702800965891630960985366989936275691028156304890789888wb) == -0x148b25ce53790ddc343a80e5af6bbp+461F128, 0, 0);
+  check_except (testflt128_575 (-39695651458311907436978914487787855221134299580182859883772996482934910519699666737447138310438758173500187594423978078781344689467195497868655489202540506785884575696420863wb) == -0x148b25ce53790ddc343a80e5af6bbp+461F128, 1, 0);
+  check_except (testflt128_575 (-39695651458311907436978914487787855221134299580182859883772996482934910519699666737447138310438758173500187594423978078781344689467195497868655489202540506785884575696420864wb) == -0x148b25ce53790ddc343a80e5af6bcp+461F128, 1, 0);
+  check_except (testflt128_575 (-39695651458311907436978914487787855221134299580182859883772996482934910519699666737447138310438758173500187594423978078781344689467195497868655489202540506785884575696420865wb) == -0x148b25ce53790ddc343a80e5af6bcp+461F128, 1, 0);
+  check_except (testflt128_575 (-61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174783wb - 1) == -0x20000000000000000000000000000p+461F128, 0, 0);
+  check_except (testflt128u_575 (79391302916623814873957828975575692579480110871530777627364090310270384764309253223365627142974381283609230513980592493091427037481003774437579982807492119025399526559055872uwb) == 0x148b25ce53790ddc343a80e5af6bap+462F128, 0, 0);
+  check_except (testflt128u_575 (79391302916623814873957828975575698533742940301142425007424724528803530189339279973875176968942092971406278738936380381248514484632132848204156981340021750540856068170317823uwb) == 0x148b25ce53790ddc343a80e5af6bap+462F128, 1, 0);
+  check_except (testflt128u_575 (79391302916623814873957828975575698533742940301142425007424724528803530189339279973875176968942092971406278738936380381248514484632132848204156981340021750540856068170317824uwb) == 0x148b25ce53790ddc343a80e5af6bap+462F128, 1, 0);
+  check_except (testflt128u_575 (79391302916623814873957828975575698533742940301142425007424724528803530189339279973875176968942092971406278738936380381248514484632132848204156981340021750540856068170317825uwb) == 0x148b25ce53790ddc343a80e5af6bbp+462F128, 1, 0);
+  check_except (testflt128u_575 (79391302916623814873957828975575704488005769730754072387485358747336675614369306724384726794909804659203326963892168269405601931783261921970733979872551382056312609781579776uwb) == 0x148b25ce53790ddc343a80e5af6bbp+462F128, 0, 0);
+  check_except (testflt128u_575 (79391302916623814873957828975575710442268599160365719767545992965869821039399333474894276620877516347000375188847956157562689378934390995737310978405081013571769151392841727uwb) == 0x148b25ce53790ddc343a80e5af6bbp+462F128, 1, 0);
+  check_except (testflt128u_575 (79391302916623814873957828975575710442268599160365719767545992965869821039399333474894276620877516347000375188847956157562689378934390995737310978405081013571769151392841728uwb) == 0x148b25ce53790ddc343a80e5af6bcp+462F128, 1, 0);
+  check_except (testflt128u_575 (79391302916623814873957828975575710442268599160365719767545992965869821039399333474894276620877516347000375188847956157562689378934390995737310978405081013571769151392841729uwb) == 0x148b25ce53790ddc343a80e5af6bcp+462F128, 1, 0);
+  check_except (testflt128u_575 (123665200736552267030251260509823595017565674550605919957031528046448612553265933585158200530621522494798835713008069669675682517153375604983773077550946583958303386074349567uwb) == 0x20000000000000000000000000000p+462F128, 1, 0);
+#endif
+#endif
+}
--- gcc/testsuite/gcc.dg/bitint-31.c.jj	2023-09-04 19:22:08.042521693 +0200
+++ gcc/testsuite/gcc.dg/bitint-31.c	2023-09-04 20:47:57.162160285 +0200
@@ -0,0 +1,480 @@ 
+/* PR c/102989 */
+/* { dg-do run } */
+/* { dg-require-effective-target fenv } */
+/* { dg-options "-std=c2x" } */
+/* { dg-add-options ieee } */
+
+#include <fenv.h>
+
+#if __FLT_MANT_DIG__ == 24
+#if __BITINT_MAXWIDTH__ >= 135
+__attribute__((noipa)) float
+testflt_135 (_BitInt(135) b)
+{
+  return b;
+}
+
+__attribute__((noipa)) float
+testfltu_135 (unsigned _BitInt(135) b)
+{
+  return b;
+}
+#endif
+
+#if __BITINT_MAXWIDTH__ >= 192
+__attribute__((noipa)) float
+testflt_192 (_BitInt(192) b)
+{
+  return b;
+}
+
+__attribute__((noipa)) float
+testfltu_192 (unsigned _BitInt(192) b)
+{
+  return b;
+}
+#endif
+
+#if __BITINT_MAXWIDTH__ >= 575
+__attribute__((noipa)) float
+testflt_575 (_BitInt(575) b)
+{
+  return b;
+}
+
+__attribute__((noipa)) float
+testfltu_575 (unsigned _BitInt(575) b)
+{
+  return b;
+}
+#endif
+#endif
+
+#if __DBL_MANT_DIG__ == 53
+#if __BITINT_MAXWIDTH__ >= 135
+__attribute__((noipa)) double
+testdbl_135 (_BitInt(135) b)
+{
+  return b;
+}
+
+__attribute__((noipa)) double
+testdblu_135 (unsigned _BitInt(135) b)
+{
+  return b;
+}
+#endif
+
+#if __BITINT_MAXWIDTH__ >= 192
+__attribute__((noipa)) double
+testdbl_192 (_BitInt(192) b)
+{
+  return b;
+}
+
+__attribute__((noipa)) double
+testdblu_192 (unsigned _BitInt(192) b)
+{
+  return b;
+}
+#endif
+
+#if __BITINT_MAXWIDTH__ >= 575
+__attribute__((noipa)) double
+testdbl_575 (_BitInt(575) b)
+{
+  return b;
+}
+
+__attribute__((noipa)) double
+testdblu_575 (unsigned _BitInt(575) b)
+{
+  return b;
+}
+#endif
+#endif
+
+#if __LDBL_MANT_DIG__ == 64
+#if __BITINT_MAXWIDTH__ >= 135
+__attribute__((noipa)) long double
+testldbl_135 (_BitInt(135) b)
+{
+  return b;
+}
+
+__attribute__((noipa)) long double
+testldblu_135 (unsigned _BitInt(135) b)
+{
+  return b;
+}
+#endif
+
+#if __BITINT_MAXWIDTH__ >= 192
+__attribute__((noipa)) long double
+testldbl_192 (_BitInt(192) b)
+{
+  return b;
+}
+
+__attribute__((noipa)) long double
+testldblu_192 (unsigned _BitInt(192) b)
+{
+  return b;
+}
+#endif
+
+#if __BITINT_MAXWIDTH__ >= 575
+__attribute__((noipa)) long double
+testldbl_575 (_BitInt(575) b)
+{
+  return b;
+}
+
+__attribute__((noipa)) long double
+testldblu_575 (unsigned _BitInt(575) b)
+{
+  return b;
+}
+#endif
+#endif
+
+#if __FLT128_MANT_DIG__ == 113
+#if __BITINT_MAXWIDTH__ >= 135
+__attribute__((noipa)) _Float128
+testflt128_135 (_BitInt(135) b)
+{
+  return b;
+}
+
+__attribute__((noipa)) _Float128
+testflt128u_135 (unsigned _BitInt(135) b)
+{
+  return b;
+}
+#endif
+
+#if __BITINT_MAXWIDTH__ >= 192
+__attribute__((noipa)) _Float128
+testflt128_192 (_BitInt(192) b)
+{
+  return b;
+}
+
+__attribute__((noipa)) _Float128
+testflt128u_192 (unsigned _BitInt(192) b)
+{
+  return b;
+}
+#endif
+
+#if __BITINT_MAXWIDTH__ >= 575
+__attribute__((noipa)) _Float128
+testflt128_575 (_BitInt(575) b)
+{
+  return b;
+}
+
+__attribute__((noipa)) _Float128
+testflt128u_575 (unsigned _BitInt(575) b)
+{
+  return b;
+}
+#endif
+#endif
+
+#define check_round(expr, vn, vd, vu, vz) \
+  do						\
+    {						\
+      fesetround (FE_TONEAREST);		\
+      if (expr != vn)				\
+	__builtin_abort ();			\
+      fesetround (FE_DOWNWARD);			\
+      if (expr != vd)				\
+	__builtin_abort ();			\
+      fesetround (FE_UPWARD);			\
+      if (expr != vu)				\
+	__builtin_abort ();			\
+      fesetround (FE_TOWARDZERO);		\
+      if (expr != vz)				\
+	__builtin_abort ();			\
+    }						\
+  while (0)
+
+#define check_round_same(expr, vn) check_round (expr, vn, vn, vn, vn)
+
+int
+main ()
+{
+#if defined(FE_TONEAREST) && defined(FE_DOWNWARD) && defined(FE_UPWARD) && defined (FE_TOWARDZERO)
+#if __FLT_MANT_DIG__ == 24
+#if __BITINT_MAXWIDTH__ >= 135
+  check_round (testflt_135 (151115713941029764726783wb), 0xfffffep+53f, 0xfffffep+53f, 0xffffffp+53f, 0xfffffep+53f);
+  check_round (testflt_135 (151115713941029764726784wb), 0xfffffep+53f, 0xfffffep+53f, 0xffffffp+53f, 0xfffffep+53f);
+  check_round (testflt_135 (151115713941029764726785wb), 0xffffffp+53f, 0xfffffep+53f, 0xffffffp+53f, 0xfffffep+53f);
+  check_round_same (testflt_135 (151115718444629392097280wb), 0xffffffp+53f);
+  check_round (testflt_135 (151115722948229019467775wb), 0xffffffp+53f, 0xffffffp+53f, 0x1000000p+53f, 0xffffffp+53f);
+  check_round (testflt_135 (151115722948229019467776wb), 0x1000000p+53f, 0xffffffp+53f, 0x1000000p+53f, 0xffffffp+53f);
+  check_round (testflt_135 (151115722948229019467777wb), 0x1000000p+53f, 0xffffffp+53f, 0x1000000p+53f, 0xffffffp+53f);
+  check_round_same (testflt_135 (-340282346638528859811704183484516925440wb), -0xffffffp+104f);
+  check_round (testflt_135 (-340282356779733661637539395458142568447wb), -0xffffffp+104f, -__builtin_inff (), -0xffffffp+104f, -0xffffffp+104f);
+  check_round (testflt_135 (-340282356779733661637539395458142568448wb), -__builtin_inff (), -__builtin_inff (), -0xffffffp+104f, -0xffffffp+104f);
+  check_round (testflt_135 (-21778071482940061661655974875633165533183wb - 1), -__builtin_inff (), -__builtin_inff (), -0xffffffp+104f, -0xffffffp+104f);
+  check_round (testfltu_135 (151115713941029764726783uwb), 0xfffffep+53f, 0xfffffep+53f, 0xffffffp+53f, 0xfffffep+53f);
+  check_round (testfltu_135 (151115713941029764726784uwb), 0xfffffep+53f, 0xfffffep+53f, 0xffffffp+53f, 0xfffffep+53f);
+  check_round (testfltu_135 (151115713941029764726785uwb), 0xffffffp+53f, 0xfffffep+53f, 0xffffffp+53f, 0xfffffep+53f);
+  check_round_same (testfltu_135 (151115718444629392097280uwb), 0xffffffp+53f);
+  check_round (testfltu_135 (151115722948229019467775uwb), 0xffffffp+53f, 0xffffffp+53f, 0x1000000p+53f, 0xffffffp+53f);
+  check_round (testfltu_135 (151115722948229019467776uwb), 0x1000000p+53f, 0xffffffp+53f, 0x1000000p+53f, 0xffffffp+53f);
+  check_round (testfltu_135 (151115722948229019467777uwb), 0x1000000p+53f, 0xffffffp+53f, 0x1000000p+53f, 0xffffffp+53f);
+  check_round_same (testfltu_135 (340282346638528859811704183484516925440uwb), 0xffffffp+104f);
+  check_round (testfltu_135 (340282356779733661637539395458142568447uwb), 0xffffffp+104f, 0xffffffp+104f, __builtin_inff (), 0xffffffp+104f);
+  check_round (testfltu_135 (340282356779733661637539395458142568448uwb), __builtin_inff (), 0xffffffp+104f, __builtin_inff (), 0xffffffp+104f);
+  check_round (testfltu_135 (43556142965880123323311949751266331066367uwb), __builtin_inff (), 0xffffffp+104f, __builtin_inff (), 0xffffffp+104f);
+#endif
+#if __BITINT_MAXWIDTH__ >= 192
+  check_round (testflt_192 (-10141203895131470501001744613375wb), -0xfffffep+79f, -0xffffffp+79f, -0xfffffep+79f, -0xfffffep+79f);
+  check_round (testflt_192 (-10141203895131470501001744613376wb), -0xfffffep+79f, -0xffffffp+79f, -0xfffffep+79f, -0xfffffep+79f);
+  check_round (testflt_192 (-10141203895131470501001744613377wb), -0xffffffp+79f, -0xffffffp+79f, -0xfffffep+79f, -0xfffffep+79f);
+  check_round_same (testflt_192 (-10141204197362925404659038289920wb), -0xffffffp+79f);
+  check_round (testflt_192 (-10141204499594380308316331966463wb), -0xffffffp+79f, -0x1000000p+79f, -0xffffffp+79f, -0xffffffp+79f);
+  check_round (testflt_192 (-10141204499594380308316331966464wb), -0x1000000p+79f, -0x1000000p+79f, -0xffffffp+79f, -0xffffffp+79f);
+  check_round (testflt_192 (-10141204499594380308316331966465wb), -0x1000000p+79f, -0x1000000p+79f, -0xffffffp+79f, -0xffffffp+79f);
+  check_round_same (testflt_192 (340282346638528859811704183484516925440wb), 0xffffffp+104f);
+  check_round (testflt_192 (340282356779733661637539395458142568447wb), 0xffffffp+104f, 0xffffffp+104f, __builtin_inff (), 0xffffffp+104f);
+  check_round (testflt_192 (340282356779733661637539395458142568448wb), __builtin_inff (), 0xffffffp+104f, __builtin_inff (), 0xffffffp+104f);
+  check_round (testflt_192 (3138550867693340381917894711603833208051177722232017256447wb), __builtin_inff (), 0xffffffp+104f, __builtin_inff (), 0xffffffp+104f);
+  check_round (testfltu_192 (10141203895131470501001744613375uwb), 0xfffffep+79f, 0xfffffep+79f, 0xffffffp+79f, 0xfffffep+79f);
+  check_round (testfltu_192 (10141203895131470501001744613376uwb), 0xfffffep+79f, 0xfffffep+79f, 0xffffffp+79f, 0xfffffep+79f);
+  check_round (testfltu_192 (10141203895131470501001744613377uwb), 0xffffffp+79f, 0xfffffep+79f, 0xffffffp+79f, 0xfffffep+79f);
+  check_round_same (testfltu_192 (10141204197362925404659038289920uwb), 0xffffffp+79f);
+  check_round (testfltu_192 (10141204499594380308316331966463uwb), 0xffffffp+79f, 0xffffffp+79f, 0x1000000p+79f, 0xffffffp+79f);
+  check_round (testfltu_192 (10141204499594380308316331966464uwb), 0x1000000p+79f, 0xffffffp+79f, 0x1000000p+79f, 0xffffffp+79f);
+  check_round (testfltu_192 (10141204499594380308316331966465uwb), 0x1000000p+79f, 0xffffffp+79f, 0x1000000p+79f, 0xffffffp+79f);
+  check_round_same (testfltu_192 (340282346638528859811704183484516925440uwb), 0xffffffp+104f);
+  check_round (testfltu_192 (340282356779733661637539395458142568447uwb), 0xffffffp+104f, 0xffffffp+104f, __builtin_inff (), 0xffffffp+104f);
+  check_round (testfltu_192 (340282356779733661637539395458142568448uwb), __builtin_inff (), 0xffffffp+104f, __builtin_inff (), 0xffffffp+104f);
+  check_round (testfltu_192 (6277101735386680763835789423207666416102355444464034512895uwb), __builtin_inff (), 0xffffffp+104f, __builtin_inff (), 0xffffffp+104f);
+#endif
+#if 0 && __BITINT_MAXWIDTH__ >= 575
+  check_round (testflt_575 (10633823015541376812058405359715352575wb), 0xfffffep+99f, 0xfffffep+99f, 0xffffffp+99f, 0xfffffep+99f);
+  check_round (testflt_575 (10633823015541376812058405359715352576wb), 0xfffffep+99f, 0xfffffep+99f, 0xffffffp+99f, 0xfffffep+99f);
+  check_round (testflt_575 (10633823015541376812058405359715352577wb), 0xffffffp+99f, 0xfffffep+99f, 0xffffffp+99f, 0xfffffep+99f);
+  check_round_same (testflt_575 (10633823332454026869115755733891153920wb), 0xffffffp+99f);
+  check_round (testflt_575 (10633823649366676926173106108066955263wb), 0xffffffp+99f, 0xffffffp+99f, 0x1000000p+99f, 0xffffffp+99f);
+  check_round (testflt_575 (10633823649366676926173106108066955264wb), 0x1000000p+99f, 0xffffffp+99f, 0x1000000p+99f, 0xffffffp+99f);
+  check_round (testflt_575 (10633823649366676926173106108066955265wb), 0x1000000p+99f, 0xffffffp+99f, 0x1000000p+99f, 0xffffffp+99f);
+  check_round_same (testflt_575 (-340282346638528859811704183484516925440wb), -0xffffffp+104f);
+  check_round (testflt_575 (-340282356779733661637539395458142568447wb), -0xffffffp+104f, -__builtin_inff (), -0xffffffp+104f, -0xffffffp+104f);
+  check_round (testflt_575 (-340282356779733661637539395458142568448wb), -__builtin_inff (), -__builtin_inff (), -0xffffffp+104f, -0xffffffp+104f);
+  check_round (testflt_575 (-61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174783wb - 1), -__builtin_inff (), -__builtin_inff (), -0xffffffp+104f, -0xffffffp+104f);
+  check_round (testfltu_575 (10633823015541376812058405359715352575uwb), 0xfffffep+99f, 0xfffffep+99f, 0xffffffp+99f, 0xfffffep+99f);
+  check_round (testfltu_575 (10633823015541376812058405359715352576uwb), 0xfffffep+99f, 0xfffffep+99f, 0xffffffp+99f, 0xfffffep+99f);
+  check_round (testfltu_575 (10633823015541376812058405359715352577uwb), 0xffffffp+99f, 0xfffffep+99f, 0xffffffp+99f, 0xfffffep+99f);
+  check_round_same (testfltu_575 (10633823332454026869115755733891153920uwb), 0xffffffp+99f);
+  check_round (testfltu_575 (10633823649366676926173106108066955263uwb), 0xffffffp+99f, 0xffffffp+99f, 0x1000000p+99f, 0xffffffp+99f);
+  check_round (testfltu_575 (10633823649366676926173106108066955264uwb), 0x1000000p+99f, 0xffffffp+99f, 0x1000000p+99f, 0xffffffp+99f);
+  check_round (testfltu_575 (10633823649366676926173106108066955265uwb), 0x1000000p+99f, 0xffffffp+99f, 0x1000000p+99f, 0xffffffp+99f);
+  check_round_same (testfltu_575 (340282346638528859811704183484516925440uwb), 0xffffffp+104f);
+  check_round (testfltu_575 (340282356779733661637539395458142568447uwb), 0xffffffp+104f, 0xffffffp+104f, __builtin_inff (), 0xffffffp+104f);
+  check_round (testfltu_575 (340282356779733661637539395458142568448uwb), __builtin_inff (), 0xffffffp+104f, __builtin_inff (), 0xffffffp+104f);
+  check_round (testfltu_575 (123665200736552267030251260509823595017565674550605919957031528046448612553265933585158200530621522494798835713008069669675682517153375604983773077550946583958303386074349567uwb), __builtin_inff (), 0xffffffp+104f, __builtin_inff (), 0xffffffp+104f);
+#endif
+#endif
+#if __DBL_MANT_DIG__, 53
+#if __BITINT_MAXWIDTH__ >= 135
+  check_round (testdbl_135 (-21267647932558650424686050812251602943wb), -0x1ffffffffffffep+71, -0x1fffffffffffffp+71, -0x1ffffffffffffep+71, -0x1ffffffffffffep+71);
+  check_round (testdbl_135 (-21267647932558650424686050812251602944wb), -0x1ffffffffffffep+71, -0x1fffffffffffffp+71, -0x1ffffffffffffep+71, -0x1ffffffffffffep+71);
+  check_round (testdbl_135 (-21267647932558650424686050812251602945wb), -0x1fffffffffffffp+71, -0x1fffffffffffffp+71, -0x1ffffffffffffep+71, -0x1ffffffffffffep+71);
+  check_round_same (testdbl_135 (-21267647932558651605277671529662906368wb), -0x1fffffffffffffp+71);
+  check_round (testdbl_135 (-21267647932558652785869292247074209791wb), -0x1fffffffffffffp+71, -0x20000000000000p+71, -0x1fffffffffffffp+71, -0x1fffffffffffffp+71);
+  check_round (testdbl_135 (-21267647932558652785869292247074209792wb), -0x20000000000000p+71, -0x20000000000000p+71, -0x1fffffffffffffp+71, -0x1fffffffffffffp+71);
+  check_round (testdbl_135 (-21267647932558652785869292247074209793wb), -0x20000000000000p+71, -0x20000000000000p+71, -0x1fffffffffffffp+71, -0x1fffffffffffffp+71);
+  check_round_same (testdbl_135 (21778071482940059243804335646374816120832wb), 0x1fffffffffffffp+81);
+  check_round (testdbl_135 (21778071482940060452730155261003990827007wb), 0x1fffffffffffffp+81, 0x1fffffffffffffp+81, 0x20000000000000p+81, 0x1fffffffffffffp+81);
+  check_round (testdbl_135 (21778071482940060452730155261003990827008wb), 0x20000000000000p+81, 0x1fffffffffffffp+81, 0x20000000000000p+81, 0x1fffffffffffffp+81);
+  check_round (testdbl_135 (21778071482940060452730155261003990827009wb), 0x20000000000000p+81, 0x1fffffffffffffp+81, 0x20000000000000p+81, 0x1fffffffffffffp+81);
+  check_round (testdbl_135 (21778071482940061661655974875633165533183wb), 0x20000000000000p+81, 0x1fffffffffffffp+81, 0x20000000000000p+81, 0x1fffffffffffffp+81);
+  check_round (testdblu_135 (21267647932558650424686050812251602943uwb), 0x1ffffffffffffep+71, 0x1ffffffffffffep+71, 0x1fffffffffffffp+71, 0x1ffffffffffffep+71);
+  check_round (testdblu_135 (21267647932558650424686050812251602944uwb), 0x1ffffffffffffep+71, 0x1ffffffffffffep+71, 0x1fffffffffffffp+71, 0x1ffffffffffffep+71);
+  check_round (testdblu_135 (21267647932558650424686050812251602945uwb), 0x1fffffffffffffp+71, 0x1ffffffffffffep+71, 0x1fffffffffffffp+71, 0x1ffffffffffffep+71);
+  check_round_same (testdblu_135 (21267647932558651605277671529662906368uwb), 0x1fffffffffffffp+71);
+  check_round (testdblu_135 (21267647932558652785869292247074209791uwb), 0x1fffffffffffffp+71, 0x1fffffffffffffp+71, 0x20000000000000p+71, 0x1fffffffffffffp+71);
+  check_round (testdblu_135 (21267647932558652785869292247074209792uwb), 0x20000000000000p+71, 0x1fffffffffffffp+71, 0x20000000000000p+71, 0x1fffffffffffffp+71);
+  check_round (testdblu_135 (21267647932558652785869292247074209793uwb), 0x20000000000000p+71, 0x1fffffffffffffp+71, 0x20000000000000p+71, 0x1fffffffffffffp+71);
+  check_round_same (testdblu_135 (43556142965880118487608671292749632241664uwb), 0x1fffffffffffffp+82);
+  check_round (testdblu_135 (43556142965880120905460310522007981654015uwb), 0x1fffffffffffffp+82, 0x1fffffffffffffp+82, 0x20000000000000p+82, 0x1fffffffffffffp+82);
+  check_round (testdblu_135 (43556142965880120905460310522007981654016uwb), 0x20000000000000p+82, 0x1fffffffffffffp+82, 0x20000000000000p+82, 0x1fffffffffffffp+82);
+  check_round (testdblu_135 (43556142965880120905460310522007981654017uwb), 0x20000000000000p+82, 0x1fffffffffffffp+82, 0x20000000000000p+82, 0x1fffffffffffffp+82);
+  check_round (testdblu_135 (43556142965880123323311949751266331066367uwb), 0x20000000000000p+82, 0x1fffffffffffffp+82, 0x20000000000000p+82, 0x1fffffffffffffp+82);
+#endif
+#if __BITINT_MAXWIDTH__ >= 192
+  check_round (testdbl_192 (89202980794122477710862401666030147234430975wb), 0x1ffffffffffffep+93, 0x1ffffffffffffep+93, 0x1fffffffffffffp+93, 0x1ffffffffffffep+93);
+  check_round (testdbl_192 (89202980794122477710862401666030147234430976wb), 0x1ffffffffffffep+93, 0x1ffffffffffffep+93, 0x1fffffffffffffp+93, 0x1ffffffffffffep+93);
+  check_round (testdbl_192 (89202980794122477710862401666030147234430977wb), 0x1fffffffffffffp+93, 0x1ffffffffffffep+93, 0x1fffffffffffffp+93, 0x1ffffffffffffep+93);
+  check_round_same (testdbl_192 (89202980794122482662622558807551246830927872wb), 0x1fffffffffffffp+93);
+  check_round (testdbl_192 (89202980794122487614382715949072346427424767wb), 0x1fffffffffffffp+93, 0x1fffffffffffffp+93, 0x20000000000000p+93, 0x1fffffffffffffp+93);
+  check_round (testdbl_192 (89202980794122487614382715949072346427424768wb), 0x20000000000000p+93, 0x1fffffffffffffp+93, 0x20000000000000p+93, 0x1fffffffffffffp+93);
+  check_round (testdbl_192 (89202980794122487614382715949072346427424769wb), 0x20000000000000p+93, 0x1fffffffffffffp+93, 0x20000000000000p+93, 0x1fffffffffffffp+93);
+  check_round_same (testdbl_192 (-3138550867693340033468750984562846621555579712101368725504wb), -0x1fffffffffffffp+138);
+  check_round (testdbl_192 (-3138550867693340207693322848083339914803378717166692990975wb), -0x1fffffffffffffp+138, -0x20000000000000p+138, -0x1fffffffffffffp+138, -0x1fffffffffffffp+138);
+  check_round (testdbl_192 (-3138550867693340207693322848083339914803378717166692990976wb), -0x20000000000000p+138, -0x20000000000000p+138, -0x1fffffffffffffp+138, -0x1fffffffffffffp+138);
+  check_round (testdbl_192 (-3138550867693340207693322848083339914803378717166692990977wb), -0x20000000000000p+138, -0x20000000000000p+138, -0x1fffffffffffffp+138, -0x1fffffffffffffp+138);
+  check_round_same (testdbl_192 (-3138550867693340381917894711603833208051177722232017256447wb - 1), -0x20000000000000p+138);
+  check_round (testdblu_192 (89202980794122477710862401666030147234430975uwb), 0x1ffffffffffffep+93, 0x1ffffffffffffep+93, 0x1fffffffffffffp+93, 0x1ffffffffffffep+93);
+  check_round (testdblu_192 (89202980794122477710862401666030147234430976uwb), 0x1ffffffffffffep+93, 0x1ffffffffffffep+93, 0x1fffffffffffffp+93, 0x1ffffffffffffep+93);
+  check_round (testdblu_192 (89202980794122477710862401666030147234430977uwb), 0x1fffffffffffffp+93, 0x1ffffffffffffep+93, 0x1fffffffffffffp+93, 0x1ffffffffffffep+93);
+  check_round_same (testdblu_192 (89202980794122482662622558807551246830927872uwb), 0x1fffffffffffffp+93);
+  check_round (testdblu_192 (89202980794122487614382715949072346427424767uwb), 0x1fffffffffffffp+93, 0x1fffffffffffffp+93, 0x20000000000000p+93, 0x1fffffffffffffp+93);
+  check_round (testdblu_192 (89202980794122487614382715949072346427424768uwb), 0x20000000000000p+93, 0x1fffffffffffffp+93, 0x20000000000000p+93, 0x1fffffffffffffp+93);
+  check_round (testdblu_192 (89202980794122487614382715949072346427424769uwb), 0x20000000000000p+93, 0x1fffffffffffffp+93, 0x20000000000000p+93, 0x1fffffffffffffp+93);
+  check_round_same (testdblu_192 (6277101735386680066937501969125693243111159424202737451008uwb), 0x1fffffffffffffp+139);
+  check_round (testdblu_192 (6277101735386680415386645696166679829606757434333385981951uwb), 0x1fffffffffffffp+139, 0x1fffffffffffffp+139, 0x20000000000000p+139, 0x1fffffffffffffp+139);
+  check_round (testdblu_192 (6277101735386680415386645696166679829606757434333385981952uwb), 0x20000000000000p+139, 0x1fffffffffffffp+139, 0x20000000000000p+139, 0x1fffffffffffffp+139);
+  check_round (testdblu_192 (6277101735386680415386645696166679829606757434333385981953uwb), 0x20000000000000p+139, 0x1fffffffffffffp+139, 0x20000000000000p+139, 0x1fffffffffffffp+139);
+  check_round (testdblu_192 (6277101735386680763835789423207666416102355444464034512895uwb), 0x20000000000000p+139, 0x1fffffffffffffp+139, 0x20000000000000p+139, 0x1fffffffffffffp+139);
+#endif
+#if __BITINT_MAXWIDTH__ >= 575
+  check_round (testdbl_575 (-615656346818663635164482277361060010743329029962521103256875011322006445221646740336801072761830405785423389392895wb), -0x1ffffffffffffep+325, -0x1fffffffffffffp+325, -0x1ffffffffffffep+325, -0x1ffffffffffffep+325);
+  check_round (testdbl_575 (-615656346818663635164482277361060010743329029962521103256875011322006445221646740336801072761830405785423389392896wb), -0x1ffffffffffffep+325, -0x1fffffffffffffp+325, -0x1ffffffffffffep+325, -0x1ffffffffffffep+325);
+  check_round (testdbl_575 (-615656346818663635164482277361060010743329029962521103256875011322006445221646740336801072761830405785423389392897wb), -0x1fffffffffffffp+325, -0x1fffffffffffffp+325, -0x1ffffffffffffep+325, -0x1ffffffffffffep+325);
+  check_round_same (testdbl_575 (-615656346818663669340274852095621329063676328675354936900147369028450764374312465492316685252079206152816780378112wb), -0x1fffffffffffffp+325);
+  check_round (testdbl_575 (-615656346818663703516067426830182647384023627388188770543419726734895083526978190647832297742328006520210171363327wb), -0x1fffffffffffffp+325, -0x20000000000000p+325, -0x1fffffffffffffp+325, -0x1fffffffffffffp+325);
+  check_round (testdbl_575 (-615656346818663703516067426830182647384023627388188770543419726734895083526978190647832297742328006520210171363328wb), -0x20000000000000p+325, -0x20000000000000p+325, -0x1fffffffffffffp+325, -0x1fffffffffffffp+325);
+  check_round (testdbl_575 (-615656346818663703516067426830182647384023627388188770543419726734895083526978190647832297742328006520210171363329wb), -0x20000000000000p+325, -0x20000000000000p+325, -0x1fffffffffffffp+325, -0x1fffffffffffffp+325);
+  check_round_same (testdbl_575 (61832600368276126650327970124302082526882038193909742709080463879918896882169507607035916867654709124839777195049479857541529867095829765369898539058829479405123401922117632wb), 0x1fffffffffffffp+521);
+  check_round (testdbl_575 (61832600368276130082726800189606940017832437734606351343798113951571601579401237199807508566482735186119597525776757346189685562836258783930892538917151385692137547479646207wb), 0x1fffffffffffffp+521, 0x1fffffffffffffp+521, 0x20000000000000p+521, 0x1fffffffffffffp+521);
+  check_round (testdbl_575 (61832600368276130082726800189606940017832437734606351343798113951571601579401237199807508566482735186119597525776757346189685562836258783930892538917151385692137547479646208wb), 0x20000000000000p+521, 0x1fffffffffffffp+521, 0x20000000000000p+521, 0x1fffffffffffffp+521);
+  check_round (testdbl_575 (61832600368276130082726800189606940017832437734606351343798113951571601579401237199807508566482735186119597525776757346189685562836258783930892538917151385692137547479646209wb), 0x20000000000000p+521, 0x1fffffffffffffp+521, 0x20000000000000p+521, 0x1fffffffffffffp+521);
+  check_round (testdbl_575 (61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174783wb), 0x20000000000000p+521, 0x1fffffffffffffp+521, 0x20000000000000p+521, 0x1fffffffffffffp+521);
+  check_round (testdblu_575 (615656346818663635164482277361060010743329029962521103256875011322006445221646740336801072761830405785423389392895uwb), 0x1ffffffffffffep+325, 0x1ffffffffffffep+325, 0x1fffffffffffffp+325, 0x1ffffffffffffep+325);
+  check_round (testdblu_575 (615656346818663635164482277361060010743329029962521103256875011322006445221646740336801072761830405785423389392896uwb), 0x1ffffffffffffep+325, 0x1ffffffffffffep+325, 0x1fffffffffffffp+325, 0x1ffffffffffffep+325);
+  check_round (testdblu_575 (615656346818663635164482277361060010743329029962521103256875011322006445221646740336801072761830405785423389392897uwb), 0x1fffffffffffffp+325, 0x1ffffffffffffep+325, 0x1fffffffffffffp+325, 0x1ffffffffffffep+325);
+  check_round_same (testdblu_575 (615656346818663669340274852095621329063676328675354936900147369028450764374312465492316685252079206152816780378112uwb), 0x1fffffffffffffp+325);
+  check_round (testdblu_575 (615656346818663703516067426830182647384023627388188770543419726734895083526978190647832297742328006520210171363327uwb), 0x1fffffffffffffp+325, 0x1fffffffffffffp+325, 0x20000000000000p+325, 0x1fffffffffffffp+325);
+  check_round (testdblu_575 (615656346818663703516067426830182647384023627388188770543419726734895083526978190647832297742328006520210171363328uwb), 0x20000000000000p+325, 0x1fffffffffffffp+325, 0x20000000000000p+325, 0x1fffffffffffffp+325);
+  check_round (testdblu_575 (615656346818663703516067426830182647384023627388188770543419726734895083526978190647832297742328006520210171363329uwb), 0x20000000000000p+325, 0x1fffffffffffffp+325, 0x20000000000000p+325, 0x1fffffffffffffp+325);
+  check_round_same (testdblu_575 (123665200736552253300655940248604165053764076387819485418160927759837793764339015214071833735309418249679554390098959715083059734191659530739797078117658958810246803844235264uwb), 0x1fffffffffffffp+522);
+  check_round (testdblu_575 (123665200736552260165453600379213880035664875469212702687596227903143203158802474399615017132965470372239195051553514692379371125672517567861785077834302771384275094959292415uwb), 0x1fffffffffffffp+522, 0x1fffffffffffffp+522, 0x20000000000000p+522, 0x1fffffffffffffp+522);
+  check_round (testdblu_575 (123665200736552260165453600379213880035664875469212702687596227903143203158802474399615017132965470372239195051553514692379371125672517567861785077834302771384275094959292416uwb), 0x20000000000000p+522, 0x1fffffffffffffp+522, 0x20000000000000p+522, 0x1fffffffffffffp+522);
+  check_round (testdblu_575 (123665200736552260165453600379213880035664875469212702687596227903143203158802474399615017132965470372239195051553514692379371125672517567861785077834302771384275094959292417uwb), 0x20000000000000p+522, 0x1fffffffffffffp+522, 0x20000000000000p+522, 0x1fffffffffffffp+522);
+  check_round (testdblu_575 (123665200736552267030251260509823595017565674550605919957031528046448612553265933585158200530621522494798835713008069669675682517153375604983773077550946583958303386074349567uwb), 0x20000000000000p+522, 0x1fffffffffffffp+522, 0x20000000000000p+522, 0x1fffffffffffffp+522);
+#endif
+#endif
+#if __LDBL_MANT_DIG__, 64
+#if __BITINT_MAXWIDTH__ >= 135
+  check_round (testldbl_135 (-27577662721237071616947187835994111wb), -0xa9f5e144d113e1c4p+51L, -0xa9f5e144d113e1c5p+51L, -0xa9f5e144d113e1c4p+51L, -0xa9f5e144d113e1c4p+51L);
+  check_round (testldbl_135 (-27577662721237071616947187835994112wb), -0xa9f5e144d113e1c4p+51L, -0xa9f5e144d113e1c5p+51L, -0xa9f5e144d113e1c4p+51L, -0xa9f5e144d113e1c4p+51L);
+  check_round (testldbl_135 (-27577662721237071616947187835994113wb), -0xa9f5e144d113e1c5p+51L, -0xa9f5e144d113e1c5p+51L, -0xa9f5e144d113e1c4p+51L, -0xa9f5e144d113e1c4p+51L);
+  check_round_same (testldbl_135 (-27577662721237071618073087742836736wb), -0xa9f5e144d113e1c5p+51L);
+  check_round (testldbl_135 (-27577662721237071619198987649679359wb), -0xa9f5e144d113e1c5p+51L, -0xa9f5e144d113e1c6p+51L, -0xa9f5e144d113e1c5p+51L, -0xa9f5e144d113e1c5p+51L);
+  check_round (testldbl_135 (-27577662721237071619198987649679360wb), -0xa9f5e144d113e1c6p+51L, -0xa9f5e144d113e1c6p+51L, -0xa9f5e144d113e1c5p+51L, -0xa9f5e144d113e1c5p+51L);
+  check_round (testldbl_135 (-27577662721237071619198987649679361wb), -0xa9f5e144d113e1c6p+51L, -0xa9f5e144d113e1c6p+51L, -0xa9f5e144d113e1c5p+51L, -0xa9f5e144d113e1c5p+51L);
+  check_round_same (testldbl_135 (-21778071482940061660475383254915754229760wb), -0xffffffffffffffffp+70L);
+  check_round (testldbl_135 (-21778071482940061661065679065274459881471wb), -0xffffffffffffffffp+70L, -0x10000000000000000p+70L, -0xffffffffffffffffp+70L, -0xffffffffffffffffp+70L);
+  check_round (testldbl_135 (-21778071482940061661065679065274459881472wb), -0x10000000000000000p+70L, -0x10000000000000000p+70L, -0xffffffffffffffffp+70L, -0xffffffffffffffffp+70L);
+  check_round (testldbl_135 (-21778071482940061661065679065274459881473wb), -0x10000000000000000p+70L, -0x10000000000000000p+70L, -0xffffffffffffffffp+70L, -0xffffffffffffffffp+70L);
+  check_round_same (testldbl_135 (-21778071482940061661655974875633165533183wb - 1), -0x10000000000000000p+70L);
+  check_round (testldblu_135 (27577662721237071616947187835994111uwb), 0xa9f5e144d113e1c4p+51L, 0xa9f5e144d113e1c4p+51L, 0xa9f5e144d113e1c5p+51L, 0xa9f5e144d113e1c4p+51L);
+  check_round (testldblu_135 (27577662721237071616947187835994112uwb), 0xa9f5e144d113e1c4p+51L, 0xa9f5e144d113e1c4p+51L, 0xa9f5e144d113e1c5p+51L, 0xa9f5e144d113e1c4p+51L);
+  check_round (testldblu_135 (27577662721237071616947187835994113uwb), 0xa9f5e144d113e1c5p+51L, 0xa9f5e144d113e1c4p+51L, 0xa9f5e144d113e1c5p+51L, 0xa9f5e144d113e1c4p+51L);
+  check_round_same (testldblu_135 (27577662721237071618073087742836736uwb), 0xa9f5e144d113e1c5p+51L);
+  check_round (testldblu_135 (27577662721237071619198987649679359uwb), 0xa9f5e144d113e1c5p+51L, 0xa9f5e144d113e1c5p+51L, 0xa9f5e144d113e1c6p+51L, 0xa9f5e144d113e1c5p+51L);
+  check_round (testldblu_135 (27577662721237071619198987649679360uwb), 0xa9f5e144d113e1c6p+51L, 0xa9f5e144d113e1c5p+51L, 0xa9f5e144d113e1c6p+51L, 0xa9f5e144d113e1c5p+51L);
+  check_round (testldblu_135 (27577662721237071619198987649679361uwb), 0xa9f5e144d113e1c6p+51L, 0xa9f5e144d113e1c5p+51L, 0xa9f5e144d113e1c6p+51L, 0xa9f5e144d113e1c5p+51L);
+  check_round_same (testldblu_135 (43556142965880123320950766509831508459520uwb), 0xffffffffffffffffp+71L);
+  check_round (testldblu_135 (43556142965880123322131358130548919762943uwb), 0xffffffffffffffffp+71L, 0xffffffffffffffffp+71L, 0x10000000000000000p+71L, 0xffffffffffffffffp+71L);
+  check_round (testldblu_135 (43556142965880123322131358130548919762944uwb), 0x10000000000000000p+71L, 0xffffffffffffffffp+71L, 0x10000000000000000p+71L, 0xffffffffffffffffp+71L);
+  check_round (testldblu_135 (43556142965880123322131358130548919762945uwb), 0x10000000000000000p+71L, 0xffffffffffffffffp+71L, 0x10000000000000000p+71L, 0xffffffffffffffffp+71L);
+  check_round (testldblu_135 (43556142965880123323311949751266331066367uwb), 0x10000000000000000p+71L, 0xffffffffffffffffp+71L, 0x10000000000000000p+71L, 0xffffffffffffffffp+71L);
+#endif
+#if __BITINT_MAXWIDTH__ >= 192
+  check_round (testldbl_192 (96388802158769743653878219701497927252918090596351wb), 0x83e75ebf94ce024ep+103L, 0x83e75ebf94ce024ep+103L, 0x83e75ebf94ce024fp+103L, 0x83e75ebf94ce024ep+103L);
+  check_round (testldbl_192 (96388802158769743653878219701497927252918090596352wb), 0x83e75ebf94ce024ep+103L, 0x83e75ebf94ce024ep+103L, 0x83e75ebf94ce024fp+103L, 0x83e75ebf94ce024ep+103L);
+  check_round (testldbl_192 (96388802158769743653878219701497927252918090596353wb), 0x83e75ebf94ce024fp+103L, 0x83e75ebf94ce024ep+103L, 0x83e75ebf94ce024fp+103L, 0x83e75ebf94ce024ep+103L);
+  check_round_same (testldbl_192 (96388802158769743658948822102410844858904903417856wb), 0x83e75ebf94ce024fp+103L);
+  check_round (testldbl_192 (96388802158769743664019424503323762464891716239359wb), 0x83e75ebf94ce024fp+103L, 0x83e75ebf94ce024fp+103L, 0x83e75ebf94ce0250p+103L, 0x83e75ebf94ce024fp+103L);
+  check_round (testldbl_192 (96388802158769743664019424503323762464891716239360wb), 0x83e75ebf94ce0250p+103L, 0x83e75ebf94ce024fp+103L, 0x83e75ebf94ce0250p+103L, 0x83e75ebf94ce024fp+103L);
+  check_round (testldbl_192 (96388802158769743664019424503323762464891716239361wb), 0x83e75ebf94ce0250p+103L, 0x83e75ebf94ce024fp+103L, 0x83e75ebf94ce0250p+103L, 0x83e75ebf94ce024fp+103L);
+  check_round_same (testldbl_192 (-3138550867693340381747753528143363976319490418516133150720wb), -0xffffffffffffffffp+127L);
+  check_round (testldbl_192 (-3138550867693340381832824119873598592185334070374075203583wb), -0xffffffffffffffffp+127L, -0x10000000000000000p+127L, -0xffffffffffffffffp+127L, -0xffffffffffffffffp+127L);
+  check_round (testldbl_192 (-3138550867693340381832824119873598592185334070374075203584wb), -0x10000000000000000p+127L, -0x10000000000000000p+127L, -0xffffffffffffffffp+127L, -0xffffffffffffffffp+127L);
+  check_round (testldbl_192 (-3138550867693340381832824119873598592185334070374075203585wb), -0x10000000000000000p+127L, -0x10000000000000000p+127L, -0xffffffffffffffffp+127L, -0xffffffffffffffffp+127L);
+  check_round_same (testldbl_192 (-3138550867693340381917894711603833208051177722232017256447wb - 1wb), -0x10000000000000000p+127L);
+  check_round (testldblu_192 (96388802158769743653878219701497927252918090596351uwb), 0x83e75ebf94ce024ep+103L, 0x83e75ebf94ce024ep+103L, 0x83e75ebf94ce024fp+103L, 0x83e75ebf94ce024ep+103L);
+  check_round (testldblu_192 (96388802158769743653878219701497927252918090596352uwb), 0x83e75ebf94ce024ep+103L, 0x83e75ebf94ce024ep+103L, 0x83e75ebf94ce024fp+103L, 0x83e75ebf94ce024ep+103L);
+  check_round (testldblu_192 (96388802158769743653878219701497927252918090596353uwb), 0x83e75ebf94ce024fp+103L, 0x83e75ebf94ce024ep+103L, 0x83e75ebf94ce024fp+103L, 0x83e75ebf94ce024ep+103L);
+  check_round_same (testldblu_192 (96388802158769743658948822102410844858904903417856uwb), 0x83e75ebf94ce024fp+103L);
+  check_round (testldblu_192 (96388802158769743664019424503323762464891716239359uwb), 0x83e75ebf94ce024fp+103L, 0x83e75ebf94ce024fp+103L, 0x83e75ebf94ce0250p+103L, 0x83e75ebf94ce024fp+103L);
+  check_round (testldblu_192 (96388802158769743664019424503323762464891716239360uwb), 0x83e75ebf94ce0250p+103L, 0x83e75ebf94ce024fp+103L, 0x83e75ebf94ce0250p+103L, 0x83e75ebf94ce024fp+103L);
+  check_round (testldblu_192 (96388802158769743664019424503323762464891716239361uwb), 0x83e75ebf94ce0250p+103L, 0x83e75ebf94ce024fp+103L, 0x83e75ebf94ce0250p+103L, 0x83e75ebf94ce024fp+103L);
+  check_round_same (testldblu_192 (6277101735386680763495507056286727952638980837032266301440uwb), 0xffffffffffffffffp+128L);
+  check_round (testldblu_192 (6277101735386680763665648239747197184370668140748150407167uwb), 0xffffffffffffffffp+128L, 0xffffffffffffffffp+128L, 0x10000000000000000p+128L, 0xffffffffffffffffp+128L);
+  check_round (testldblu_192 (6277101735386680763665648239747197184370668140748150407168uwb), 0x10000000000000000p+128L, 0xffffffffffffffffp+128L, 0x10000000000000000p+128L, 0xffffffffffffffffp+128L);
+  check_round (testldblu_192 (6277101735386680763665648239747197184370668140748150407169uwb), 0x10000000000000000p+128L, 0xffffffffffffffffp+128L, 0x10000000000000000p+128L, 0xffffffffffffffffp+128L);
+  check_round (testldblu_192 (6277101735386680763835789423207666416102355444464034512895uwb), 0x10000000000000000p+128L, 0xffffffffffffffffp+128L, 0x10000000000000000p+128L, 0xffffffffffffffffp+128L);
+#endif
+#if __BITINT_MAXWIDTH__ >= 575
+  check_round_same (testldbl_575 (-61832600368276133511773678272426148233889331025751498446645922568076207932202076431648659257792374503198949281962308977915333294030066289778448068072486649492543280785653760wb), -0xffffffffffffffffp+510L);
+  check_round (testldbl_575 (-61832600368276133513449654263668972871336084150527229212580843295650257104417521612113879761551567875299183569233171906376587276303377046135167303423979970735847486911414271wb), -0xffffffffffffffffp+510L, -0x10000000000000000p+510L, -0xffffffffffffffffp+510L, -0xffffffffffffffffp+510L);
+  check_round (testldbl_575 (-61832600368276133513449654263668972871336084150527229212580843295650257104417521612113879761551567875299183569233171906376587276303377046135167303423979970735847486911414272wb), -0x10000000000000000p+510L, -0x10000000000000000p+510L, -0xffffffffffffffffp+510L, -0xffffffffffffffffp+510L);
+  check_round (testldbl_575 (-61832600368276133513449654263668972871336084150527229212580843295650257104417521612113879761551567875299183569233171906376587276303377046135167303423979970735847486911414273wb), -0x10000000000000000p+510L, -0x10000000000000000p+510L, -0xffffffffffffffffp+510L, -0xffffffffffffffffp+510L);
+  check_round_same (testldbl_575 (-61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174783wb - 1), -0x10000000000000000p+510L);
+  check_round_same (testldblu_575 (123665200736552267023547356544852296467778662051502996893291845136152415864404152863297318515584749006397898563924617955830666588060132579556896136144973298985086561571307520uwb), 0xffffffffffffffffp+511L);
+  check_round (testldblu_575 (123665200736552267026899308527337945742672168301054458425161686591300514208835043224227759523103135750598367138466343812753174552606754092270334606847959941471694973822828543uwb), 0xffffffffffffffffp+511L, 0xffffffffffffffffp+511L, 0x10000000000000000p+511L, 0xffffffffffffffffp+511L);
+  check_round (testldblu_575 (123665200736552267026899308527337945742672168301054458425161686591300514208835043224227759523103135750598367138466343812753174552606754092270334606847959941471694973822828544uwb), 0x10000000000000000p+511L, 0xffffffffffffffffp+511L, 0x10000000000000000p+511L, 0xffffffffffffffffp+511L);
+  check_round (testldblu_575 (123665200736552267026899308527337945742672168301054458425161686591300514208835043224227759523103135750598367138466343812753174552606754092270334606847959941471694973822828545uwb), 0x10000000000000000p+511L, 0xffffffffffffffffp+511L, 0x10000000000000000p+511L, 0xffffffffffffffffp+511L);
+  check_round (testldblu_575 (123665200736552267030251260509823595017565674550605919957031528046448612553265933585158200530621522494798835713008069669675682517153375604983773077550946583958303386074349567uwb), 0x10000000000000000p+511L, 0xffffffffffffffffp+511L, 0x10000000000000000p+511L, 0xffffffffffffffffp+511L);
+#endif
+#endif
+#if __FLT128_MANT_DIG__, 113
+#if __BITINT_MAXWIDTH__ >= 135
+  check_round (testflt128_135 (-21646332438261169091754659013488783917055wb), -0x1fce71fdcfb1797b42dede66ac9ecp+21F128, -0x1fce71fdcfb1797b42dede66ac9edp+21F128, -0x1fce71fdcfb1797b42dede66ac9ecp+21F128, -0x1fce71fdcfb1797b42dede66ac9ecp+21F128);
+  check_round (testflt128_135 (-21646332438261169091754659013488783917056wb), -0x1fce71fdcfb1797b42dede66ac9ecp+21F128, -0x1fce71fdcfb1797b42dede66ac9edp+21F128, -0x1fce71fdcfb1797b42dede66ac9ecp+21F128, -0x1fce71fdcfb1797b42dede66ac9ecp+21F128);
+  check_round (testflt128_135 (-21646332438261169091754659013488783917057wb), -0x1fce71fdcfb1797b42dede66ac9edp+21F128, -0x1fce71fdcfb1797b42dede66ac9edp+21F128, -0x1fce71fdcfb1797b42dede66ac9ecp+21F128, -0x1fce71fdcfb1797b42dede66ac9ecp+21F128);
+  check_round_same (testflt128_135 (-21646332438261169091754659013488784965632wb), -0x1fce71fdcfb1797b42dede66ac9edp+21F128);
+  check_round (testflt128_135 (-21646332438261169091754659013488786014207wb), -0x1fce71fdcfb1797b42dede66ac9edp+21F128, -0x1fce71fdcfb1797b42dede66ac9eep+21F128, -0x1fce71fdcfb1797b42dede66ac9edp+21F128, -0x1fce71fdcfb1797b42dede66ac9edp+21F128); 
+  check_round (testflt128_135 (-21646332438261169091754659013488786014208wb), -0x1fce71fdcfb1797b42dede66ac9eep+21F128, -0x1fce71fdcfb1797b42dede66ac9eep+21F128, -0x1fce71fdcfb1797b42dede66ac9edp+21F128, -0x1fce71fdcfb1797b42dede66ac9edp+21F128);
+  check_round (testflt128_135 (-21646332438261169091754659013488786014209wb), -0x1fce71fdcfb1797b42dede66ac9eep+21F128, -0x1fce71fdcfb1797b42dede66ac9eep+21F128, -0x1fce71fdcfb1797b42dede66ac9edp+21F128, -0x1fce71fdcfb1797b42dede66ac9edp+21F128);
+  check_round (testflt128u_135 (21646332438261169091754659013488783917055uwb), 0x1fce71fdcfb1797b42dede66ac9ecp+21F128, 0x1fce71fdcfb1797b42dede66ac9ecp+21F128, 0x1fce71fdcfb1797b42dede66ac9edp+21F128, 0x1fce71fdcfb1797b42dede66ac9ecp+21F128);
+  check_round (testflt128u_135 (21646332438261169091754659013488783917056uwb), 0x1fce71fdcfb1797b42dede66ac9ecp+21F128, 0x1fce71fdcfb1797b42dede66ac9ecp+21F128, 0x1fce71fdcfb1797b42dede66ac9edp+21F128, 0x1fce71fdcfb1797b42dede66ac9ecp+21F128);
+  check_round (testflt128u_135 (21646332438261169091754659013488783917057uwb), 0x1fce71fdcfb1797b42dede66ac9edp+21F128, 0x1fce71fdcfb1797b42dede66ac9ecp+21F128, 0x1fce71fdcfb1797b42dede66ac9edp+21F128, 0x1fce71fdcfb1797b42dede66ac9ecp+21F128);
+  check_round_same (testflt128u_135 (21646332438261169091754659013488784965632uwb), 0x1fce71fdcfb1797b42dede66ac9edp+21F128);
+  check_round (testflt128u_135 (21646332438261169091754659013488786014207uwb), 0x1fce71fdcfb1797b42dede66ac9edp+21F128, 0x1fce71fdcfb1797b42dede66ac9edp+21F128, 0x1fce71fdcfb1797b42dede66ac9eep+21F128, 0x1fce71fdcfb1797b42dede66ac9edp+21F128);
+  check_round (testflt128u_135 (21646332438261169091754659013488786014208uwb), 0x1fce71fdcfb1797b42dede66ac9eep+21F128, 0x1fce71fdcfb1797b42dede66ac9edp+21F128, 0x1fce71fdcfb1797b42dede66ac9eep+21F128, 0x1fce71fdcfb1797b42dede66ac9edp+21F128);
+  check_round (testflt128u_135 (21646332438261169091754659013488786014209uwb), 0x1fce71fdcfb1797b42dede66ac9eep+21F128, 0x1fce71fdcfb1797b42dede66ac9edp+21F128, 0x1fce71fdcfb1797b42dede66ac9eep+21F128, 0x1fce71fdcfb1797b42dede66ac9edp+21F128);
+#endif
+#if __BITINT_MAXWIDTH__ >= 192
+  check_round_same (testflt128_192 (3138550867693340381917894711603832905819722818574723579904wb), 0x1ffffffffffffffffffffffffffffp+78F128);
+  check_round (testflt128_192 (3138550867693340381917894711603833056935450270403370418175wb), 0x1ffffffffffffffffffffffffffffp+78F128, 0x1ffffffffffffffffffffffffffffp+78F128, 0x20000000000000000000000000000p+78F128, 0x1ffffffffffffffffffffffffffffp+78F128);
+  check_round (testflt128_192 (3138550867693340381917894711603833056935450270403370418176wb), 0x20000000000000000000000000000p+78F128, 0x1ffffffffffffffffffffffffffffp+78F128, 0x20000000000000000000000000000p+78F128, 0x1ffffffffffffffffffffffffffffp+78F128);
+  check_round (testflt128_192 (3138550867693340381917894711603833056935450270403370418177wb), 0x20000000000000000000000000000p+78F128, 0x1ffffffffffffffffffffffffffffp+78F128, 0x20000000000000000000000000000p+78F128, 0x1ffffffffffffffffffffffffffffp+78F128);
+  check_round (testflt128_192 (3138550867693340381917894711603833208051177722232017256447wb), 0x20000000000000000000000000000p+78F128, 0x1ffffffffffffffffffffffffffffp+78F128, 0x20000000000000000000000000000p+78F128, 0x1ffffffffffffffffffffffffffffp+78F128);
+  check_round_same (testflt128u_192 (6277101735386680763835789423207665811639445637149447159808uwb), 0x1ffffffffffffffffffffffffffffp+79F128);
+  check_round (testflt128u_192 (6277101735386680763835789423207666113870900540806740836351uwb), 0x1ffffffffffffffffffffffffffffp+79F128, 0x1ffffffffffffffffffffffffffffp+79F128, 0x20000000000000000000000000000p+79F128, 0x1ffffffffffffffffffffffffffffp+79F128);
+  check_round (testflt128u_192 (6277101735386680763835789423207666113870900540806740836352uwb), 0x20000000000000000000000000000p+79F128, 0x1ffffffffffffffffffffffffffffp+79F128, 0x20000000000000000000000000000p+79F128, 0x1ffffffffffffffffffffffffffffp+79F128);
+  check_round (testflt128u_192 (6277101735386680763835789423207666113870900540806740836353uwb), 0x20000000000000000000000000000p+79F128, 0x1ffffffffffffffffffffffffffffp+79F128, 0x20000000000000000000000000000p+79F128, 0x1ffffffffffffffffffffffffffffp+79F128);
+  check_round (testflt128u_192 (6277101735386680763835789423207666416102355444464034512895uwb), 0x20000000000000000000000000000p+79F128, 0x1ffffffffffffffffffffffffffffp+79F128, 0x20000000000000000000000000000p+79F128, 0x1ffffffffffffffffffffffffffffp+79F128);
+#endif
+#if __BITINT_MAXWIDTH__ >= 575
+  check_round_same (testflt128_575 (-39695651458311907436978914487787846289740055435765388813682045155135192382154626611682813571487190641804615256990296246545713518740501887218789991403746059512699763279527936wb), -0x148b25ce53790ddc343a80e5af6bap+461F128);
+  check_round (testflt128_575 (-39695651458311907436978914487787849266871470150571212503712362264401765094669639986937588484471046485703139369468190190624257242316066424102078490670010875270428034085158911wb), -0x148b25ce53790ddc343a80e5af6bap+461F128, -0x148b25ce53790ddc343a80e5af6bbp+461F128, -0x148b25ce53790ddc343a80e5af6bap+461F128, -0x148b25ce53790ddc343a80e5af6bap+461F128);
+  check_round (testflt128_575 (-39695651458311907436978914487787849266871470150571212503712362264401765094669639986937588484471046485703139369468190190624257242316066424102078490670010875270428034085158912wb), -0x148b25ce53790ddc343a80e5af6bap+461F128, -0x148b25ce53790ddc343a80e5af6bbp+461F128, -0x148b25ce53790ddc343a80e5af6bap+461F128, -0x148b25ce53790ddc343a80e5af6bap+461F128);
+  check_round (testflt128_575 (-39695651458311907436978914487787849266871470150571212503712362264401765094669639986937588484471046485703139369468190190624257242316066424102078490670010875270428034085158913wb), -0x148b25ce53790ddc343a80e5af6bbp+461F128, -0x148b25ce53790ddc343a80e5af6bbp+461F128, -0x148b25ce53790ddc343a80e5af6bap+461F128, -0x148b25ce53790ddc343a80e5af6bap+461F128);
+  check_round_same (testflt128_575 (-39695651458311907436978914487787852244002884865377036193742679373668337807184653362192363397454902329601663481946084134702800965891630960985366989936275691028156304890789888wb), -0x148b25ce53790ddc343a80e5af6bbp+461F128);
+  check_round (testflt128_575 (-39695651458311907436978914487787855221134299580182859883772996482934910519699666737447138310438758173500187594423978078781344689467195497868655489202540506785884575696420863wb), -0x148b25ce53790ddc343a80e5af6bbp+461F128, -0x148b25ce53790ddc343a80e5af6bcp+461F128, -0x148b25ce53790ddc343a80e5af6bbp+461F128, -0x148b25ce53790ddc343a80e5af6bbp+461F128);
+  check_round (testflt128_575 (-39695651458311907436978914487787855221134299580182859883772996482934910519699666737447138310438758173500187594423978078781344689467195497868655489202540506785884575696420864wb), -0x148b25ce53790ddc343a80e5af6bcp+461F128, -0x148b25ce53790ddc343a80e5af6bcp+461F128, -0x148b25ce53790ddc343a80e5af6bbp+461F128, -0x148b25ce53790ddc343a80e5af6bbp+461F128);
+  check_round (testflt128_575 (-39695651458311907436978914487787855221134299580182859883772996482934910519699666737447138310438758173500187594423978078781344689467195497868655489202540506785884575696420865wb), -0x148b25ce53790ddc343a80e5af6bcp+461F128, -0x148b25ce53790ddc343a80e5af6bcp+461F128, -0x148b25ce53790ddc343a80e5af6bbp+461F128, -0x148b25ce53790ddc343a80e5af6bbp+461F128);
+  check_round_same (testflt128_575 (-61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174783wb - 1), -0x20000000000000000000000000000p+461F128);
+  check_round_same (testflt128u_575 (79391302916623814873957828975575692579480110871530777627364090310270384764309253223365627142974381283609230513980592493091427037481003774437579982807492119025399526559055872uwb), 0x148b25ce53790ddc343a80e5af6bap+462F128);
+  check_round (testflt128u_575 (79391302916623814873957828975575698533742940301142425007424724528803530189339279973875176968942092971406278738936380381248514484632132848204156981340021750540856068170317823uwb), 0x148b25ce53790ddc343a80e5af6bap+462F128, 0x148b25ce53790ddc343a80e5af6bap+462F128, 0x148b25ce53790ddc343a80e5af6bbp+462F128, 0x148b25ce53790ddc343a80e5af6bap+462F128);
+  check_round (testflt128u_575 (79391302916623814873957828975575698533742940301142425007424724528803530189339279973875176968942092971406278738936380381248514484632132848204156981340021750540856068170317824uwb), 0x148b25ce53790ddc343a80e5af6bap+462F128, 0x148b25ce53790ddc343a80e5af6bap+462F128, 0x148b25ce53790ddc343a80e5af6bbp+462F128, 0x148b25ce53790ddc343a80e5af6bap+462F128);
+  check_round (testflt128u_575 (79391302916623814873957828975575698533742940301142425007424724528803530189339279973875176968942092971406278738936380381248514484632132848204156981340021750540856068170317825uwb), 0x148b25ce53790ddc343a80e5af6bbp+462F128, 0x148b25ce53790ddc343a80e5af6bap+462F128, 0x148b25ce53790ddc343a80e5af6bbp+462F128, 0x148b25ce53790ddc343a80e5af6bap+462F128);
+  check_round_same (testflt128u_575 (79391302916623814873957828975575704488005769730754072387485358747336675614369306724384726794909804659203326963892168269405601931783261921970733979872551382056312609781579776uwb), 0x148b25ce53790ddc343a80e5af6bbp+462F128);
+  check_round (testflt128u_575 (79391302916623814873957828975575710442268599160365719767545992965869821039399333474894276620877516347000375188847956157562689378934390995737310978405081013571769151392841727uwb), 0x148b25ce53790ddc343a80e5af6bbp+462F128, 0x148b25ce53790ddc343a80e5af6bbp+462F128, 0x148b25ce53790ddc343a80e5af6bcp+462F128, 0x148b25ce53790ddc343a80e5af6bbp+462F128);
+  check_round (testflt128u_575 (79391302916623814873957828975575710442268599160365719767545992965869821039399333474894276620877516347000375188847956157562689378934390995737310978405081013571769151392841728uwb), 0x148b25ce53790ddc343a80e5af6bcp+462F128, 0x148b25ce53790ddc343a80e5af6bbp+462F128, 0x148b25ce53790ddc343a80e5af6bcp+462F128, 0x148b25ce53790ddc343a80e5af6bbp+462F128);
+  check_round (testflt128u_575 (79391302916623814873957828975575710442268599160365719767545992965869821039399333474894276620877516347000375188847956157562689378934390995737310978405081013571769151392841729uwb), 0x148b25ce53790ddc343a80e5af6bcp+462F128, 0x148b25ce53790ddc343a80e5af6bbp+462F128, 0x148b25ce53790ddc343a80e5af6bcp+462F128, 0x148b25ce53790ddc343a80e5af6bbp+462F128);
+  check_round (testflt128u_575 (123665200736552267030251260509823595017565674550605919957031528046448612553265933585158200530621522494798835713008069669675682517153375604983773077550946583958303386074349567uwb), 0x20000000000000000000000000000p+462F128, 0x1ffffffffffffffffffffffffffffp+462F128, 0x20000000000000000000000000000p+462F128, 0x1ffffffffffffffffffffffffffffp+462F128);
+#endif
+#endif
+#endif
+}
--- gcc/testsuite/gcc.dg/dfp/bitint-1.c.jj	2023-09-04 09:45:47.076866859 +0200
+++ gcc/testsuite/gcc.dg/dfp/bitint-1.c	2023-09-04 10:52:48.625174662 +0200
@@ -37,6 +37,8 @@  main ()
   if (tests192 (0.DD) != 0wb
       || tests192 (0.9999999999999999DD) != 0wb
       || tests192 (7.999999999999999DD) != 7wb
+      || tests192 (-0.DD) != 0wb
+      || tests192 (-0.9999999999999999DD) != 0wb
       || tests192 (-42.5DD) != -42wb
       || tests192 (-34242319854.45429e+27DD) != -34242319854454290000000000000000000000wb
       || tests192 (-213855087769445.9e+43DD) != -2138550877694459000000000000000000000000000000000000000000wb
@@ -51,6 +53,7 @@  main ()
   if (testu192 (0.DD) != 0uwb
       || testu192 (0.9999999999999999DD) != 0uwb
       || testu192 (-0.9999999999999999DD) != 0uwb
+      || testu192 (-0.0DD) != 0uwb
       || testu192 (-0.5DD) != 0uwb
       || testu192 (42.99999999999999DD) != 42uwb
       || testu192 (42.e+21DD) != 42000000000000000000000uwb
@@ -68,6 +71,9 @@  main ()
   if (tests575 (0.DD) != 0wb
       || tests575 (0.999999DD) != 0wb
       || tests575 (12.9999999999999DD) != 12wb
+      || tests575 (-0.DD) != 0wb
+      || tests575 (-0.9999999999999999DD) != 0wb
+      || tests575 (-1.DD) != -1wb
       || tests575 (-89.5DD) != -89wb
       || tests575 (-34242319854.45429e+37DD) != -342423198544542900000000000000000000000000000000wb
       || tests575 (-518326003682761.2e+158DD) != -51832600368276120000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000wb
@@ -83,6 +89,8 @@  main ()
       || testu575 (0.5555555555555555DD) != 0uwb
       || testu575 (-0.7777777777777777DD) != 0uwb
       || testu575 (-0.99DD) != 0uwb
+      || testu575 (-0.000DD) != 0uwb
+      || testu575 (-0.99999999DD) != 0uwb
       || testu575 (42.99999999999999DD) != 42uwb
       || testu575 (42.e+21DD) != 42000000000000000000000uwb
       || testu575 (94272319854.45429e+27DD) != 94272319854454290000000000000000000000uwb
--- gcc/testsuite/gcc.dg/dfp/bitint-2.c.jj	2023-09-04 09:45:47.076866859 +0200
+++ gcc/testsuite/gcc.dg/dfp/bitint-2.c	2023-09-04 10:56:05.779431014 +0200
@@ -37,6 +37,9 @@  main ()
   if (tests192 (0.DF) != 0wb
       || tests192 (0.9999999DF) != 0wb
       || tests192 (7.999999DF) != 7wb
+      || tests192 (-0.000DF) != 0wb
+      || tests192 (-0.9999999DF) != 0wb
+      || tests192 (-1.DF) != -1wb
       || tests192 (-42.5DF) != -42wb
       || tests192 (-3424.231e+27DF) != -3424231000000000000000000000000wb
       || tests192 (-213855.9e+43DF) != -2138559000000000000000000000000000000000000000000wb
@@ -52,6 +55,8 @@  main ()
       || testu192 (0.9999999DF) != 0uwb
       || testu192 (-0.9999999DF) != 0uwb
       || testu192 (-0.5DF) != 0uwb
+      || testu192 (-0.0000DF) != 0uwb
+      || testu192 (-0.99999DF) != 0uwb
       || testu192 (42.99999DF) != 42uwb
       || testu192 (42.e+21DF) != 42000000000000000000000uwb
       || testu192 (3427.231e+29DF) != 342723100000000000000000000000000uwb
@@ -68,6 +73,9 @@  main ()
   if (tests575 (0.DF) != 0wb
       || tests575 (0.999999DF) != 0wb
       || tests575 (12.9999DF) != 12wb
+      || tests575 (-0.DF) != 0wb
+      || tests575 (-0.999DF) != 0wb
+      || tests575 (-1.0000DF) != -1wb
       || tests575 (-89.5DF) != -89wb
       || tests575 (-34242.31e+37DF) != -342423100000000000000000000000000000000000wb
       || tests575 (-518326.2e+88DF) != -5183262000000000000000000000000000000000000000000000000000000000000000000000000000000000000000wb
@@ -78,6 +86,9 @@  main ()
       || testu575 (0.5555555DF) != 0uwb
       || testu575 (-0.7777777DF) != 0uwb
       || testu575 (-0.99DF) != 0uwb
+      || testu575 (-0.DF) != 0uwb
+      || testu575 (-0.7777777DF) != 0uwb
+      || testu575 (-0.9999999DF) != 0uwb
       || testu575 (42.99999DF) != 42uwb
       || testu575 (42.e+21DF) != 42000000000000000000000uwb
       || testu575 (9427.231e+27DF) != 9427231000000000000000000000000uwb
--- gcc/testsuite/gcc.dg/dfp/bitint-3.c.jj	2023-09-04 09:45:47.076866859 +0200
+++ gcc/testsuite/gcc.dg/dfp/bitint-3.c	2023-09-04 11:04:29.181425571 +0200
@@ -37,6 +37,9 @@  main ()
   if (tests192 (0.DL) != 0wb
       || tests192 (0.9999999999999999999999999999999999DL) != 0wb
       || tests192 (7.999999999999999999999999999999999DL) != 7wb
+      || tests192 (-0.DL) != 0wb
+      || tests192 (-0.9999999999999999999999999999999999DL) != 0wb
+      || tests192 (-1.DL) != -1wb
       || tests192 (-42.5DL) != -42wb
       || tests192 (-34242319854.45429439857871298745432e+27DL) != -34242319854454294398578712987454320000wb
       || tests192 (-213855087769445.9e+43DL) != -2138550877694459000000000000000000000000000000000000000000wb
@@ -51,6 +54,8 @@  main ()
   if (testu192 (0.DL) != 0uwb
       || testu192 (0.9999999999999999999999999999999999DL) != 0uwb
       || testu192 (-0.9999999999999999999999999999999999DL) != 0uwb
+      || testu192 (-0.DL) != 0uwb
+      || testu192 (-0.9999999999999999999999DL) != 0uwb
       || testu192 (-0.5DL) != 0uwb
       || testu192 (42.99999999999999999999999999999999DL) != 42uwb
       || testu192 (42.e+21DL) != 42000000000000000000000uwb
@@ -68,6 +73,9 @@  main ()
   if (tests575 (0.DL) != 0wb
       || tests575 (0.999999999999999999999DL) != 0wb
       || tests575 (12.99999999999999999999999999999DL) != 12wb
+      || tests575 (-0.0000000000DL) != 0wb
+      || tests575 (-0.9999999999999999999999999999999999DL) != 0uwb
+      || tests575 (-1.DL) != -1wb
       || tests575 (-89.5DL) != -89wb
       || tests575 (-34242319854.45429986754986758972345e+37DL) != -342423198544542998675498675897234500000000000000wb
       || tests575 (-518326003682761.2e+158DL) != -51832600368276120000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000wb
@@ -83,6 +91,7 @@  main ()
       || testu575 (0.5555555555555555555555555555555555DL) != 0uwb
       || testu575 (-0.7777777777777777777777777777777777DL) != 0uwb
       || testu575 (-0.99DL) != 0uwb
+      || testu575 (-0.00000000000DL) != 0uwb
       || testu575 (42.99999999999999999999999999999999DL) != 42uwb
       || testu575 (42.e+21DL) != 42000000000000000000000uwb
       || testu575 (94272319854.45429e+27DL) != 94272319854454290000000000000000000000uwb
--- gcc/testsuite/gcc.dg/dfp/bitint-7.c.jj	2023-09-04 12:05:08.838925401 +0200
+++ gcc/testsuite/gcc.dg/dfp/bitint-7.c	2023-09-04 12:05:30.203626858 +0200
@@ -0,0 +1,110 @@ 
+/* PR c/102989 */
+/* Test non-canonical BID significands.  */
+/* { dg-do run { target bitint } } */
+/* { dg-require-effective-target dfp_bid } */
+/* { dg-options "-std=gnu2x -O2" } */
+
+union U32
+{
+  _Decimal32 d;
+  unsigned int u;
+};
+
+union U64
+{
+  _Decimal64 d;
+  unsigned long long int u;
+};
+
+union U128
+{
+  _Decimal128 d;
+  unsigned long long int u[2];
+};
+
+int
+main ()
+{
+  volatile union U32 u32;
+  u32.d = 0.9999999e+27DF;
+  u32.u++;
+  volatile union U64 u64;
+  u64.d = 0.9999999999999999e+90DD;
+  u64.u++;
+  volatile union U128 u128;
+  u128.d = 0.9999999999999999999999999999999999e+39DL;
+  if (u128.u[0] == 0x378d8e63ffffffffULL)
+    u128.u[0]++;
+  else if (u128.u[1] == 0x378d8e63ffffffffULL)
+    u128.u[1]++;
+  else
+    u128.d = 0.DL;
+#if __BITINT_MAXWIDTH__ >= 192
+  if ((_BitInt(192)) u32.d != 0wb
+      || (unsigned _BitInt(192)) u32.d != 0uwb
+      || (_BitInt(192)) u64.d != 0wb
+      || (unsigned _BitInt(192)) u64.d != 0uwb
+      || (_BitInt(192)) u128.d != 0wb
+      || (unsigned _BitInt(192)) u128.d != 0uwb)
+    __builtin_abort ();
+#endif
+#if __BITINT_MAXWIDTH__ >= 575
+  if ((_BitInt(575)) u32.d != 0wb
+      || (unsigned _BitInt(575)) u32.d != 0uwb
+      || (_BitInt(575)) u64.d != 0wb
+      || (unsigned _BitInt(575)) u64.d != 0uwb
+      || (_BitInt(575)) u128.d != 0wb
+      || (unsigned _BitInt(575)) u128.d != 0uwb)
+    __builtin_abort ();
+#endif
+  u32.u = 0xe59fffffU;
+  u64.u = 0xe3ffffffffffffffULL;
+  if (u128.u[0] == 0x378d8e6400000000ULL)
+    {
+      u128.u[0] = -1ULL;
+      u128.u[1] = 0xe1be7fffffffffffULL;
+    }
+  else if (u128.u[1] == 0x378d8e6400000000ULL)
+    {
+      u128.u[1] = -1ULL;
+      u128.u[0] = 0xe1be7fffffffffffULL;
+    }
+#if __BITINT_MAXWIDTH__ >= 192
+  if ((_BitInt(192)) u32.d != 0wb
+      || (unsigned _BitInt(192)) u32.d != 0uwb
+      || (_BitInt(192)) u64.d != 0wb
+      || (unsigned _BitInt(192)) u64.d != 0uwb
+      || (_BitInt(192)) u128.d != 0wb
+      || (unsigned _BitInt(192)) u128.d != 0uwb)
+    __builtin_abort ();
+#endif
+#if __BITINT_MAXWIDTH__ >= 575
+  if ((_BitInt(575)) u32.d != 0wb
+      || (unsigned _BitInt(575)) u32.d != 0uwb
+      || (_BitInt(575)) u64.d != 0wb
+      || (unsigned _BitInt(575)) u64.d != 0uwb
+      || (_BitInt(575)) u128.d != 0wb
+      || (unsigned _BitInt(575)) u128.d != 0uwb)
+    __builtin_abort ();
+#endif
+  if (u128.u[0] == -1ULL)
+    {
+      u128.u[0] = 0;
+      u128.u[1] = 0xe629800000000000ULL;
+    }
+  else if (u128.u[1] == -1ULL)
+    {
+      u128.u[1] = 0;
+      u128.u[0] = 0xe629800000000000ULL;
+    }
+#if __BITINT_MAXWIDTH__ >= 192
+  if ((_BitInt(192)) u128.d != 0wb
+      || (unsigned _BitInt(192)) u128.d != 0uwb)
+    __builtin_abort ();
+#endif
+#if __BITINT_MAXWIDTH__ >= 575
+  if ((_BitInt(575)) u128.d != 0wb
+      || (unsigned _BitInt(575)) u128.d != 0uwb)
+    __builtin_abort ();
+#endif
+}
--- gcc/testsuite/gcc.dg/dfp/bitint-8.c.jj	2023-09-04 20:51:21.864357476 +0200
+++ gcc/testsuite/gcc.dg/dfp/bitint-8.c	2023-09-04 21:32:20.255674946 +0200
@@ -0,0 +1,182 @@ 
+/* PR c/102989 */
+/* { dg-do run { target bitint } } */
+/* { dg-require-effective-target fenv_exceptions } */
+/* { dg-options "-std=c2x" } */
+
+#include <fenv.h>
+
+#if __BITINT_MAXWIDTH__ >= 192
+__attribute__((noipa)) _BitInt(192)
+tests192_32 (_Decimal32 d)
+{
+  return d;
+}
+
+__attribute__((noipa)) unsigned _BitInt(192)
+testu192_32 (_Decimal32 d)
+{
+  return d;
+}
+
+__attribute__((noipa)) _BitInt(192)
+tests192_64 (_Decimal64 d)
+{
+  return d;
+}
+
+__attribute__((noipa)) unsigned _BitInt(192)
+testu192_64 (_Decimal64 d)
+{
+  return d;
+}
+
+__attribute__((noipa)) _BitInt(192)
+tests192_128 (_Decimal128 d)
+{
+  return d;
+}
+
+__attribute__((noipa)) unsigned _BitInt(192)
+testu192_128 (_Decimal128 d)
+{
+  return d;
+}
+#endif
+
+#if __BITINT_MAXWIDTH__ >= 575
+__attribute__((noipa)) _BitInt(575)
+tests575_32 (_Decimal32 d)
+{
+  return d;
+}
+
+__attribute__((noipa)) unsigned _BitInt(575)
+testu575_32 (_Decimal32 d)
+{
+  return d;
+}
+
+__attribute__((noipa)) _BitInt(575)
+tests575_64 (_Decimal64 d)
+{
+  return d;
+}
+
+__attribute__((noipa)) unsigned _BitInt(575)
+testu575_64 (_Decimal64 d)
+{
+  return d;
+}
+
+__attribute__((noipa)) _BitInt(575)
+tests575_128 (_Decimal128 d)
+{
+  return d;
+}
+
+__attribute__((noipa)) unsigned _BitInt(575)
+testu575_128 (_Decimal128 d)
+{
+  return d;
+}
+#endif
+
+__attribute__((noipa)) void
+check_invalid (int test, int inv)
+{
+  if (!test)
+    __builtin_abort ();
+  if ((!fetestexcept (FE_INVALID)) != (!inv))
+    __builtin_abort ();
+  feclearexcept (FE_INVALID);
+}
+
+int
+main ()
+{
+#if __BITINT_MAXWIDTH__ >= 192
+  check_invalid (tests192_32 (__builtin_infd32 ()) == 3138550867693340381917894711603833208051177722232017256447wb, 1);
+  check_invalid (tests192_32 (-__builtin_infd32 ()) == -3138550867693340381917894711603833208051177722232017256447wb - 1wb, 1);
+  check_invalid (tests192_32 (__builtin_nand32 ("")) == 3138550867693340381917894711603833208051177722232017256447wb, 1);
+  check_invalid (tests192_32 (-313855.0e+52DF) == -3138550000000000000000000000000000000000000000000000000000wb, 0);
+  check_invalid (tests192_32 (-313855.1e+52DF) == -3138550867693340381917894711603833208051177722232017256447wb - 1wb, 1);
+  check_invalid (tests192_32 (313855.0e+52DF) == 3138550000000000000000000000000000000000000000000000000000wb, 0);
+  check_invalid (tests192_32 (313855.1e+52DF) == 3138550867693340381917894711603833208051177722232017256447wb, 1);
+  check_invalid (testu192_32 (__builtin_infd32 ()) == 6277101735386680763835789423207666416102355444464034512895uwb, 1);
+  check_invalid (testu192_32 (-__builtin_infd32 ()) == 0uwb, 1);
+  check_invalid (testu192_32 (__builtin_nand32 ("")) == 6277101735386680763835789423207666416102355444464034512895uwb, 1);
+  check_invalid (testu192_32 (-0.9999999DF) == 0uwb, 0);
+  check_invalid (testu192_32 (-1.0DF) == 0uwb, 1);
+  check_invalid (testu192_32 (6277101.0e+51DF) == 6277101000000000000000000000000000000000000000000000000000uwb, 0);
+  check_invalid (testu192_32 (6277102.0e+51DF) == 6277101735386680763835789423207666416102355444464034512895uwb, 1);
+  check_invalid (tests192_64 (__builtin_infd64 ()) == 3138550867693340381917894711603833208051177722232017256447wb, 1);
+  check_invalid (tests192_64 (-__builtin_infd64 ()) == -3138550867693340381917894711603833208051177722232017256447wb - 1wb, 1);
+  check_invalid (tests192_64 (__builtin_nand64 ("")) == 3138550867693340381917894711603833208051177722232017256447wb, 1);
+  check_invalid (tests192_64 (-313855086769334.0e+43DD) == -3138550867693340000000000000000000000000000000000000000000wb, 0);
+  check_invalid (tests192_64 (-313855086769334.1e+43DD) == -3138550867693340381917894711603833208051177722232017256447wb - 1wb, 1);
+  check_invalid (tests192_64 (313855086769334.0e+43DD) == 3138550867693340000000000000000000000000000000000000000000wb, 0);
+  check_invalid (tests192_64 (313855086769334.1e+43DD) == 3138550867693340381917894711603833208051177722232017256447wb, 1);
+  check_invalid (testu192_64 (__builtin_infd64 ()) == 6277101735386680763835789423207666416102355444464034512895uwb, 1);
+  check_invalid (testu192_64 (-__builtin_infd64 ()) == 0wb, 1);
+  check_invalid (testu192_64 (__builtin_nand64 ("")) == 6277101735386680763835789423207666416102355444464034512895uwb, 1);
+  check_invalid (testu192_64 (-0.9999999999999999DD) == 0uwb, 0);
+  check_invalid (testu192_64 (-1.0DD) == 0uwb, 1);
+  check_invalid (testu192_64 (627710173538668.0e+43DD) == 6277101735386680000000000000000000000000000000000000000000uwb, 0);
+  check_invalid (testu192_64 (627710173538668.1e+43DD) == 6277101735386680763835789423207666416102355444464034512895uwb, 1);
+  check_invalid (tests192_128 (__builtin_infd128 ()) == 3138550867693340381917894711603833208051177722232017256447wb, 1);
+  check_invalid (tests192_128 (-__builtin_infd128 ()) == -3138550867693340381917894711603833208051177722232017256447wb - 1wb, 1);
+  check_invalid (tests192_128 (__builtin_nand128 ("")) == 3138550867693340381917894711603833208051177722232017256447wb, 1);
+  check_invalid (tests192_128 (-3138550867693340381917894711603833.0e+24DL) == -3138550867693340381917894711603833000000000000000000000000wb, 0);
+  check_invalid (tests192_128 (-3138550867693340381917894711603834.0e+24DL) == -3138550867693340381917894711603833208051177722232017256447wb - 1wb, 1);
+  check_invalid (tests192_128 (3138550867693340381917894711603833.0e+24DL) == 3138550867693340381917894711603833000000000000000000000000wb, 0);
+  check_invalid (tests192_128 (3138550867693340381917894711603834.0e+24DL) == 3138550867693340381917894711603833208051177722232017256447wb, 1);
+  check_invalid (testu192_128 (__builtin_infd128 ()) == 6277101735386680763835789423207666416102355444464034512895uwb, 1);
+  check_invalid (testu192_128 (-__builtin_infd128 ()) == 0wb, 1);
+  check_invalid (testu192_128 (__builtin_nand128 ("")) == 6277101735386680763835789423207666416102355444464034512895uwb, 1);
+  check_invalid (testu192_128 (-0.9999999999999999999999999999999999DL) == 0uwb, 0);
+  check_invalid (testu192_128 (-1.0DL) == 0uwb, 1);
+  check_invalid (testu192_128 (6277101735386680763835789423207666.0e+24DL) == 6277101735386680763835789423207666000000000000000000000000uwb, 0);
+  check_invalid (testu192_128 (6277101735386680763835789423207667.0e+24DL) == 6277101735386680763835789423207666416102355444464034512895uwb, 1);
+#endif
+#if __BITINT_MAXWIDTH__ >= 575
+  check_invalid (tests575_32 (__builtin_infd32 ()) == 61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174783wb, 1);
+  check_invalid (tests575_32 (-__builtin_infd32 ()) == -61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174783wb - 1wb, 1);
+  check_invalid (tests575_32 (__builtin_nand32 ("")) == 61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174783wb, 1);
+  check_invalid (tests575_32 (-9999999e+90DF) == -9999999000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000wb, 0);
+  check_invalid (tests575_32 (9999999e+90DF) == 9999999000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000wb, 0);
+  check_invalid (testu575_32 (__builtin_infd32 ()) == 123665200736552267030251260509823595017565674550605919957031528046448612553265933585158200530621522494798835713008069669675682517153375604983773077550946583958303386074349567uwb, 1);
+  check_invalid (testu575_32 (-__builtin_infd32 ()) == 0uwb, 1);
+  check_invalid (testu575_32 (__builtin_nand32 ("")) == 123665200736552267030251260509823595017565674550605919957031528046448612553265933585158200530621522494798835713008069669675682517153375604983773077550946583958303386074349567uwb, 1);
+  check_invalid (testu575_32 (-0.9999999DF) == 0uwb, 0);
+  check_invalid (testu575_32 (-1.0DF) == 0uwb, 1);
+  check_invalid (testu575_32 (9999999e+90DF) == 9999999000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000uwb, 0);
+  check_invalid (tests575_64 (__builtin_infd64 ()) == 61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174783wb, 1);
+  check_invalid (tests575_64 (-__builtin_infd64 ()) == -61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174783wb - 1wb, 1);
+  check_invalid (tests575_64 (__builtin_nand64 ("")) == 61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174783wb, 1);
+  check_invalid (tests575_64 (-6183260036827613.0e+157DD) == -61832600368276130000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000wb, 0);
+  check_invalid (tests575_64 (-6183260036827614.0e+157DD) == -61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174783wb - 1wb, 1);
+  check_invalid (tests575_64 (6183260036827613.0e+157DD) == 61832600368276130000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000wb, 0);
+  check_invalid (tests575_64 (6183260036827614.0e+157DD) == 61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174783wb, 1);
+  check_invalid (testu575_64 (__builtin_infd64 ()) == 123665200736552267030251260509823595017565674550605919957031528046448612553265933585158200530621522494798835713008069669675682517153375604983773077550946583958303386074349567uwb, 1);
+  check_invalid (testu575_64 (-__builtin_infd64 ()) == 0wb, 1);
+  check_invalid (testu575_64 (__builtin_nand64 ("")) == 123665200736552267030251260509823595017565674550605919957031528046448612553265933585158200530621522494798835713008069669675682517153375604983773077550946583958303386074349567uwb, 1);
+  check_invalid (testu575_64 (-0.9999999999999999DD) == 0uwb, 0);
+  check_invalid (testu575_64 (-1.0DD) == 0uwb, 1);
+  check_invalid (testu575_64 (1236652007365522.0e+158DD) == 123665200736552200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000uwb, 0);
+  check_invalid (testu575_64 (1236652007365523.0e+158DD) == 123665200736552267030251260509823595017565674550605919957031528046448612553265933585158200530621522494798835713008069669675682517153375604983773077550946583958303386074349567uwb, 1);
+  check_invalid (tests575_128 (__builtin_infd128 ()) == 61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174783wb, 1);
+  check_invalid (tests575_128 (-__builtin_infd128 ()) == -61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174783wb - 1wb, 1);
+  check_invalid (tests575_128 (__builtin_nand128 ("")) == 61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174783wb, 1);
+  check_invalid (tests575_128 (-6183260036827613351512563025491179.0e+139DL) == -61832600368276133515125630254911790000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000wb, 0);
+  check_invalid (tests575_128 (-618326003682761335151256302549118.0e+140DL) == -61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174783wb - 1wb, 1);
+  check_invalid (tests575_128 (6183260036827613351512563025491179.0e+139DL) == 61832600368276133515125630254911790000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000wb, 0);
+  check_invalid (tests575_128 (618326003682761335151256302549118.0e+140DL) == 61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174783wb, 1);
+  check_invalid (testu575_128 (__builtin_infd128 ()) == 123665200736552267030251260509823595017565674550605919957031528046448612553265933585158200530621522494798835713008069669675682517153375604983773077550946583958303386074349567uwb, 1);
+  check_invalid (testu575_128 (-__builtin_infd128 ()) == 0wb, 1);
+  check_invalid (testu575_128 (__builtin_nand128 ("")) == 123665200736552267030251260509823595017565674550605919957031528046448612553265933585158200530621522494798835713008069669675682517153375604983773077550946583958303386074349567uwb, 1);
+  check_invalid (testu575_128 (-0.9999999999999999999999999999999999DL) == 0uwb, 0);
+  check_invalid (testu575_128 (-1.0DL) == 0uwb, 1);
+  check_invalid (testu575_128 (1236652007365522670302512605098235.0e+140DL) == 123665200736552267030251260509823500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000uwb, 0);
+  check_invalid (testu575_128 (1236652007365522670302512605098236.0e+140DL) == 123665200736552267030251260509823595017565674550605919957031528046448612553265933585158200530621522494798835713008069669675682517153375604983773077550946583958303386074349567uwb, 1);
+#endif
+}