File: git-floatn-gcc-13-support.diff

package info (click to toggle)
glibc 2.36-9%2Bdeb12u10
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bookworm-backports
  • size: 299,916 kB
  • sloc: ansic: 1,055,590; asm: 324,891; makefile: 15,194; python: 12,603; sh: 10,884; cpp: 5,685; awk: 1,883; perl: 518; yacc: 292; pascal: 182; sed: 39
file content (796 lines) | stat: -rw-r--r-- 26,862 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
commit 3e5760fcb48528d48deeb60cb885a97bb731160c
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Wed Sep 28 20:09:34 2022 +0000

    Update _FloatN header support for C++ in GCC 13
    
    GCC 13 adds support for _FloatN and _FloatNx types in C++, so breaking
    the installed glibc headers that assume such support is not present.
    GCC mostly works around this with fixincludes, but that doesn't help
    for building glibc and its tests (glibc doesn't itself contain C++
    code, but there's C++ code built for tests).  Update glibc's
    bits/floatn-common.h and bits/floatn.h headers to handle the GCC 13
    support directly.
    
    In general the changes match those made by fixincludes, though I think
    the ones in sysdeps/powerpc/bits/floatn.h, where the header tests
    __LDBL_MANT_DIG__ == 113 or uses #elif, wouldn't match the existing
    fixincludes patterns.
    
    Some places involving special C++ handling in relation to _FloatN
    support are not changed.  There's no need to change the
    __HAVE_FLOATN_NOT_TYPEDEF definition (also in a form that wouldn't be
    matched by the fixincludes fixes) because it's only used in relation
    to macro definitions using features not supported for C++
    (__builtin_types_compatible_p and _Generic).  And there's no need to
    change the inline function overloads for issignaling, iszero and
    iscanonical in C++ because cases where types have the same format but
    are no longer compatible types are handled automatically by the C++
    overload resolution rules.
    
    This patch also does not change the overload handling for iseqsig, and
    there I think changes *are* needed, beyond those in this patch or made
    by fixincludes.  The way that overload is defined, via a template
    parameter to a structure type, requires overloads whenever the types
    are incompatible, even if they have the same format.  So I think we
    need to add overloads with GCC 13 for every supported _FloatN and
    _FloatNx type, rather than just having one for _Float128 when it has a
    different ABI to long double as at present (but for older GCC, such
    overloads must not be defined for types that end up defined as
    typedefs for another type).
    
    Tested with build-many-glibcs.py: compilers build for
    aarch64-linux-gnu ia64-linux-gnu mips64-linux-gnu powerpc-linux-gnu
    powerpc64le-linux-gnu x86_64-linux-gnu; glibcs build for
    aarch64-linux-gnu ia64-linux-gnu i686-linux-gnu mips-linux-gnu
    mips64-linux-gnu-n32 powerpc-linux-gnu powerpc64le-linux-gnu
    x86_64-linux-gnu.

diff --git a/bits/floatn-common.h b/bits/floatn-common.h
index 92982d6460..67519dbb74 100644
--- a/bits/floatn-common.h
+++ b/bits/floatn-common.h
@@ -78,7 +78,7 @@
    or _FloatNx types, if __HAVE_<type> is 1.  The corresponding
    literal suffixes exist since GCC 7, for C only.  */
 # if __HAVE_FLOAT16
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 /* No corresponding suffix available for this type.  */
 #   define __f16(x) ((_Float16) x##f)
 #  else
@@ -87,7 +87,7 @@
 # endif
 
 # if __HAVE_FLOAT32
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 #   define __f32(x) x##f
 #  else
 #   define __f32(x) x##f32
@@ -95,7 +95,7 @@
 # endif
 
 # if __HAVE_FLOAT64
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 #   ifdef __NO_LONG_DOUBLE_MATH
 #    define __f64(x) x##l
 #   else
@@ -107,7 +107,7 @@
 # endif
 
 # if __HAVE_FLOAT32X
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 #   define __f32x(x) x
 #  else
 #   define __f32x(x) x##f32x
@@ -115,7 +115,7 @@
 # endif
 
 # if __HAVE_FLOAT64X
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 #   if __HAVE_FLOAT64X_LONG_DOUBLE
 #    define __f64x(x) x##l
 #   else
@@ -127,7 +127,7 @@
 # endif
 
 # if __HAVE_FLOAT128X
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 #   error "_Float128X supported but no constant suffix"
 #  else
 #   define __f128x(x) x##f128x
@@ -136,7 +136,7 @@
 
 /* Defined to a complex type if __HAVE_<type> is 1.  */
 # if __HAVE_FLOAT16
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 typedef _Complex float __cfloat16 __attribute__ ((__mode__ (__HC__)));
 #   define __CFLOAT16 __cfloat16
 #  else
@@ -145,7 +145,7 @@ typedef _Complex float __cfloat16 __attribute__ ((__mode__ (__HC__)));
 # endif
 
 # if __HAVE_FLOAT32
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 #   define __CFLOAT32 _Complex float
 #  else
 #   define __CFLOAT32 _Complex _Float32
@@ -153,7 +153,7 @@ typedef _Complex float __cfloat16 __attribute__ ((__mode__ (__HC__)));
 # endif
 
 # if __HAVE_FLOAT64
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 #   ifdef __NO_LONG_DOUBLE_MATH
 #    define __CFLOAT64 _Complex long double
 #   else
@@ -165,7 +165,7 @@ typedef _Complex float __cfloat16 __attribute__ ((__mode__ (__HC__)));
 # endif
 
 # if __HAVE_FLOAT32X
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 #   define __CFLOAT32X _Complex double
 #  else
 #   define __CFLOAT32X _Complex _Float32x
@@ -173,7 +173,7 @@ typedef _Complex float __cfloat16 __attribute__ ((__mode__ (__HC__)));
 # endif
 
 # if __HAVE_FLOAT64X
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 #   if __HAVE_FLOAT64X_LONG_DOUBLE
 #    define __CFLOAT64X _Complex long double
 #   else
@@ -185,7 +185,7 @@ typedef _Complex float __cfloat16 __attribute__ ((__mode__ (__HC__)));
 # endif
 
 # if __HAVE_FLOAT128X
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 #   error "_Float128X supported but no complex type"
 #  else
 #   define __CFLOAT128X _Complex _Float128x
@@ -195,7 +195,7 @@ typedef _Complex float __cfloat16 __attribute__ ((__mode__ (__HC__)));
 /* The remaining of this file provides support for older compilers.  */
 # if __HAVE_FLOAT16
 
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 typedef float _Float16 __attribute__ ((__mode__ (__HF__)));
 #  endif
 
@@ -210,7 +210,7 @@ typedef float _Float16 __attribute__ ((__mode__ (__HF__)));
 
 # if __HAVE_FLOAT32
 
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 typedef float _Float32;
 #  endif
 
@@ -234,7 +234,7 @@ typedef float _Float32;
 
 #  ifdef __NO_LONG_DOUBLE_MATH
 
-#   if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#   if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 typedef long double _Float64;
 #   endif
 
@@ -247,7 +247,7 @@ typedef long double _Float64;
 
 #  else
 
-#   if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#   if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 typedef double _Float64;
 #   endif
 
@@ -264,7 +264,7 @@ typedef double _Float64;
 
 # if __HAVE_FLOAT32X
 
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 typedef double _Float32x;
 #  endif
 
@@ -281,7 +281,7 @@ typedef double _Float32x;
 
 #  if __HAVE_FLOAT64X_LONG_DOUBLE
 
-#   if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#   if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 typedef long double _Float64x;
 #   endif
 
@@ -294,7 +294,7 @@ typedef long double _Float64x;
 
 #  else
 
-#   if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#   if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 typedef _Float128 _Float64x;
 #   endif
 
@@ -311,7 +311,7 @@ typedef _Float128 _Float64x;
 
 # if __HAVE_FLOAT128X
 
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 #   error "_Float128x supported but no type"
 #  endif
 
diff --git a/sysdeps/ia64/bits/floatn.h b/sysdeps/ia64/bits/floatn.h
index 5507038bc7..75f7547045 100644
--- a/sysdeps/ia64/bits/floatn.h
+++ b/sysdeps/ia64/bits/floatn.h
@@ -56,7 +56,7 @@
 /* Defined to concatenate the literal suffix to be used with _Float128
    types, if __HAVE_FLOAT128 is 1. */
 # if __HAVE_FLOAT128
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 /* The literal suffix f128 exists only since GCC 7.0.  */
 #   define __f128(x) x##q
 #  else
@@ -66,7 +66,7 @@
 
 /* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1.  */
 # if __HAVE_FLOAT128
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 /* Add a typedef for older GCC compilers which don't natively support
    _Complex _Float128.  */
 typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__TC__)));
@@ -80,7 +80,7 @@ typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__TC__)));
 # if __HAVE_FLOAT128
 
 /* The type _Float128 exists only since GCC 7.0.  */
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 typedef __float128 _Float128;
 #  endif
 
diff --git a/sysdeps/ieee754/ldbl-128/bits/floatn.h b/sysdeps/ieee754/ldbl-128/bits/floatn.h
index 9ae7b30373..6ef60a3c9b 100644
--- a/sysdeps/ieee754/ldbl-128/bits/floatn.h
+++ b/sysdeps/ieee754/ldbl-128/bits/floatn.h
@@ -55,7 +55,7 @@
 /* Defined to concatenate the literal suffix to be used with _Float128
    types, if __HAVE_FLOAT128 is 1. */
 # if __HAVE_FLOAT128
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 /* The literal suffix f128 exists only since GCC 7.0.  */
 #   define __f128(x) x##l
 #  else
@@ -65,7 +65,7 @@
 
 /* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1.  */
 # if __HAVE_FLOAT128
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 #   define __CFLOAT128 _Complex long double
 #  else
 #   define __CFLOAT128 _Complex _Float128
@@ -76,7 +76,7 @@
 # if __HAVE_FLOAT128
 
 /* The type _Float128 exists only since GCC 7.0.  */
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 typedef long double _Float128;
 #  endif
 
diff --git a/sysdeps/mips/ieee754/bits/floatn.h b/sysdeps/mips/ieee754/bits/floatn.h
index 1d51db04c7..f0321eb010 100644
--- a/sysdeps/mips/ieee754/bits/floatn.h
+++ b/sysdeps/mips/ieee754/bits/floatn.h
@@ -55,7 +55,7 @@
 /* Defined to concatenate the literal suffix to be used with _Float128
    types, if __HAVE_FLOAT128 is 1. */
 # if __HAVE_FLOAT128
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 /* The literal suffix f128 exists only since GCC 7.0.  */
 #   define __f128(x) x##l
 #  else
@@ -65,7 +65,7 @@
 
 /* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1.  */
 # if __HAVE_FLOAT128
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 #   define __CFLOAT128 _Complex long double
 #  else
 #   define __CFLOAT128 _Complex _Float128
@@ -76,7 +76,7 @@
 # if __HAVE_FLOAT128
 
 /* The type _Float128 exists only since GCC 7.0.  */
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 typedef long double _Float128;
 #  endif
 
diff --git a/sysdeps/powerpc/bits/floatn.h b/sysdeps/powerpc/bits/floatn.h
index 23db8be5a3..3c756dfc9d 100644
--- a/sysdeps/powerpc/bits/floatn.h
+++ b/sysdeps/powerpc/bits/floatn.h
@@ -57,7 +57,7 @@
 /* Defined to concatenate the literal suffix to be used with _Float128
    types, if __HAVE_FLOAT128 is 1. */
 # if __HAVE_FLOAT128
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 /* The literal suffix (f128) exist for powerpc only since GCC 7.0.  */
 #   if __LDBL_MANT_DIG__ == 113
 #    define __f128(x) x##l
@@ -71,10 +71,10 @@
 
 /* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1.  */
 # if __HAVE_FLOAT128
-#  if __LDBL_MANT_DIG__ == 113 && defined __cplusplus
+#  if __LDBL_MANT_DIG__ == 113 && defined __cplusplus && !__GNUC_PREREQ (13, 0)
 typedef long double _Float128;
 #   define __CFLOAT128 _Complex long double
-#  elif !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  elif !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 /* The type _Float128 exist for powerpc only since GCC 7.0.  */
 typedef __float128 _Float128;
 /* Add a typedef for older GCC and C++ compilers which don't natively support
diff --git a/sysdeps/x86/bits/floatn.h b/sysdeps/x86/bits/floatn.h
index 34a6fdc864..4ff39457b5 100644
--- a/sysdeps/x86/bits/floatn.h
+++ b/sysdeps/x86/bits/floatn.h
@@ -58,7 +58,7 @@
 /* Defined to concatenate the literal suffix to be used with _Float128
    types, if __HAVE_FLOAT128 is 1. */
 # if __HAVE_FLOAT128
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 /* The literal suffix f128 exists only since GCC 7.0.  */
 #   define __f128(x) x##q
 #  else
@@ -68,7 +68,7 @@
 
 /* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1.  */
 # if __HAVE_FLOAT128
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 /* Add a typedef for older GCC compilers which don't natively support
    _Complex _Float128.  */
 typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__TC__)));
@@ -82,7 +82,7 @@ typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__TC__)));
 # if __HAVE_FLOAT128
 
 /* The type _Float128 exists only since GCC 7.0.  */
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 typedef __float128 _Float128;
 #  endif
 
commit ba70f6959876b6daba180afbe427710e4383e357
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Fri Sep 30 19:36:41 2022 +0000

    Fix iseqsig for _FloatN and _FloatNx in C++ with GCC 13
    
    With GCC 13, _FloatN and _FloatNx types, when they exist, are distinct
    types like they are in C with GCC 7 and later, rather than typedefs
    for types such as float, double or long double.
    
    This breaks the templated iseqsig implementation for C++ in <math.h>,
    when used with types that were previously implemented as aliases.  Add
    the necessary definitions for _Float32, _Float64, _Float128 (when the
    same format as long double), _Float32x and _Float64x in this case, so
    that iseqsig can be used with such types in C++ with GCC 13 as it
    could with previous GCC versions.
    
    Also add tests for calling iseqsig in C++ with arguments of such types
    (more minimal than existing tests, so that they can work with older
    GCC versions and without relying on any C++ library support for the
    types or on hardcoding details of their formats).  The LDBL_MANT_DIG
    != 106 conditionals on some tests are because the type-generic
    comparison macros have undefined behavior when neither argument has a
    type whose set of values is a subset of those for the type of the
    other argument, which applies when one argument is IBM long double and
    the other is an IEEE format wider than binary64.
    
    Tested with build-many-glibcs.py glibcs build for aarch64-linux-gnu
    i686-linux-gnu mips-linux-gnu mips64-linux-gnu-n32 powerpc-linux-gnu
    powerpc64le-linux-gnu x86_64-linux-gnu.

diff --git a/math/math.h b/math/math.h
index 27963ef6dc..cf980c37c3 100644
--- a/math/math.h
+++ b/math/math.h
@@ -1391,14 +1391,62 @@ template<> struct __iseqsig_type<long double>
   }
 };
 
-#  if __HAVE_FLOAT128_UNLIKE_LDBL
+#  if __HAVE_FLOAT32 && __GNUC_PREREQ (13, 0)
+template<> struct __iseqsig_type<_Float32>
+{
+  static int __call (_Float32 __x, _Float32 __y) throw ()
+  {
+    return __iseqsigf (__x, __y);
+  }
+};
+#  endif
+
+#  if __HAVE_FLOAT64 && __GNUC_PREREQ (13, 0)
+template<> struct __iseqsig_type<_Float64>
+{
+  static int __call (_Float64 __x, _Float64 __y) throw ()
+  {
+    return __iseqsig (__x, __y);
+  }
+};
+#  endif
+
+#  if __HAVE_FLOAT128_UNLIKE_LDBL || (__HAVE_FLOAT128 && __GNUC_PREREQ (13, 0))
   /* When using an IEEE 128-bit long double, _Float128 is defined as long double
      in C++.  */
 template<> struct __iseqsig_type<_Float128>
 {
   static int __call (_Float128 __x, _Float128 __y) throw ()
   {
+#   if __HAVE_FLOAT128_UNLIKE_LDBL
     return __iseqsigf128 (__x, __y);
+#   else
+    return __iseqsigl (__x, __y);
+#   endif
+  }
+};
+#  endif
+
+#  if __HAVE_FLOAT32X && __GNUC_PREREQ (13, 0)
+template<> struct __iseqsig_type<_Float32x>
+{
+  static int __call (_Float32x __x, _Float32x __y) throw ()
+  {
+    return __iseqsig (__x, __y);
+  }
+};
+#  endif
+
+#  if __HAVE_FLOAT64X && __GNUC_PREREQ (13, 0)
+template<> struct __iseqsig_type<_Float64x>
+{
+  static int __call (_Float64x __x, _Float64x __y) throw ()
+  {
+#   if __HAVE_FLOAT64X_LONG_DOUBLE
+    return __iseqsigl (__x, __y);
+#   else
+    return __iseqsigf128 (__x, __y);
+#   endif
   }
 };
 #  endif
diff --git a/math/test-math-iseqsig.cc b/math/test-math-iseqsig.cc
index 59a84d57bd..44be4aeba8 100644
--- a/math/test-math-iseqsig.cc
+++ b/math/test-math-iseqsig.cc
@@ -17,6 +17,7 @@
    <https://www.gnu.org/licenses/>.  */
 
 #define _GNU_SOURCE 1
+#include <float.h>
 #include <math.h>
 #include <stdio.h>
 
@@ -67,6 +68,20 @@ check_type ()
     }
 }
 
+/* Run minimal tests of iseqsig for a pair of types, without relying
+   on C++ library support or knowledge of the representation.  */
+template <class T1, class T2>
+static void
+check_type_minimal ()
+{
+  T1 t1 = 0;
+  T2 t2 = 0;
+  CHECK (iseqsig (t1, t2), 1);
+
+  t2 = 1;
+  CHECK (iseqsig (t1, t2), 0);
+}
+
 #if __HAVE_DISTINCT_FLOAT128
 static void
 check_float128 ()
@@ -105,6 +120,281 @@ do_test (void)
 #if __HAVE_DISTINCT_FLOAT128
   check_float128 ();
 #endif
+
+#if __HAVE_FLOAT16
+  check_type_minimal<float, _Float16> ();
+#endif
+#if __HAVE_FLOAT32
+  check_type_minimal<float, _Float32> ();
+#endif
+#if __HAVE_FLOAT64
+  check_type_minimal<float, _Float64> ();
+#endif
+#if __HAVE_FLOAT128
+  check_type_minimal<float, _Float128> ();
+#endif
+#if __HAVE_FLOAT32X
+  check_type_minimal<float, _Float32x> ();
+#endif
+#if __HAVE_FLOAT64X
+  check_type_minimal<float, _Float64x> ();
+#endif
+#if __HAVE_FLOAT128X
+  check_type_minimal<float, _Float128x> ();
+#endif
+#if __HAVE_FLOAT16
+  check_type_minimal<double, _Float16> ();
+#endif
+#if __HAVE_FLOAT32
+  check_type_minimal<double, _Float32> ();
+#endif
+#if __HAVE_FLOAT64
+  check_type_minimal<double, _Float64> ();
+#endif
+#if __HAVE_FLOAT128
+  check_type_minimal<double, _Float128> ();
+#endif
+#if __HAVE_FLOAT32X
+  check_type_minimal<double, _Float32x> ();
+#endif
+#if __HAVE_FLOAT64X
+  check_type_minimal<double, _Float64x> ();
+#endif
+#if __HAVE_FLOAT128X
+  check_type_minimal<double, _Float128x> ();
+#endif
+#if __HAVE_FLOAT16
+  check_type_minimal<long double, _Float16> ();
+#endif
+#if __HAVE_FLOAT32
+  check_type_minimal<long double, _Float32> ();
+#endif
+#if __HAVE_FLOAT64
+  check_type_minimal<long double, _Float64> ();
+#endif
+#if __HAVE_FLOAT128 && LDBL_MANT_DIG != 106
+  check_type_minimal<long double, _Float128> ();
+#endif
+#if __HAVE_FLOAT32X
+  check_type_minimal<long double, _Float32x> ();
+#endif
+#if __HAVE_FLOAT64X && LDBL_MANT_DIG != 106
+  check_type_minimal<long double, _Float64x> ();
+#endif
+#if __HAVE_FLOAT128X && LDBL_MANT_DIG != 106
+  check_type_minimal<long double, _Float128x> ();
+#endif
+#if __HAVE_FLOAT16
+  check_type_minimal<_Float16, float> ();
+#endif
+#if __HAVE_FLOAT16
+  check_type_minimal<_Float16, double> ();
+#endif
+#if __HAVE_FLOAT16
+  check_type_minimal<_Float16, long double> ();
+#endif
+#if __HAVE_FLOAT16
+  check_type_minimal<_Float16, _Float16> ();
+#endif
+#if __HAVE_FLOAT16 && __HAVE_FLOAT32
+  check_type_minimal<_Float16, _Float32> ();
+#endif
+#if __HAVE_FLOAT16 && __HAVE_FLOAT64
+  check_type_minimal<_Float16, _Float64> ();
+#endif
+#if __HAVE_FLOAT16 && __HAVE_FLOAT128
+  check_type_minimal<_Float16, _Float128> ();
+#endif
+#if __HAVE_FLOAT16 && __HAVE_FLOAT32X
+  check_type_minimal<_Float16, _Float32x> ();
+#endif
+#if __HAVE_FLOAT16 && __HAVE_FLOAT64X
+  check_type_minimal<_Float16, _Float64x> ();
+#endif
+#if __HAVE_FLOAT16 && __HAVE_FLOAT128X
+  check_type_minimal<_Float16, _Float128x> ();
+#endif
+#if __HAVE_FLOAT32
+  check_type_minimal<_Float32, float> ();
+#endif
+#if __HAVE_FLOAT32
+  check_type_minimal<_Float32, double> ();
+#endif
+#if __HAVE_FLOAT32
+  check_type_minimal<_Float32, long double> ();
+#endif
+#if __HAVE_FLOAT32 && __HAVE_FLOAT16
+  check_type_minimal<_Float32, _Float16> ();
+#endif
+#if __HAVE_FLOAT32
+  check_type_minimal<_Float32, _Float32> ();
+#endif
+#if __HAVE_FLOAT32 && __HAVE_FLOAT64
+  check_type_minimal<_Float32, _Float64> ();
+#endif
+#if __HAVE_FLOAT32 && __HAVE_FLOAT128
+  check_type_minimal<_Float32, _Float128> ();
+#endif
+#if __HAVE_FLOAT32 && __HAVE_FLOAT32X
+  check_type_minimal<_Float32, _Float32x> ();
+#endif
+#if __HAVE_FLOAT32 && __HAVE_FLOAT64X
+  check_type_minimal<_Float32, _Float64x> ();
+#endif
+#if __HAVE_FLOAT32 && __HAVE_FLOAT128X
+  check_type_minimal<_Float32, _Float128x> ();
+#endif
+#if __HAVE_FLOAT64
+  check_type_minimal<_Float64, float> ();
+#endif
+#if __HAVE_FLOAT64
+  check_type_minimal<_Float64, double> ();
+#endif
+#if __HAVE_FLOAT64
+  check_type_minimal<_Float64, long double> ();
+#endif
+#if __HAVE_FLOAT64 && __HAVE_FLOAT16
+  check_type_minimal<_Float64, _Float16> ();
+#endif
+#if __HAVE_FLOAT64 && __HAVE_FLOAT32
+  check_type_minimal<_Float64, _Float32> ();
+#endif
+#if __HAVE_FLOAT64
+  check_type_minimal<_Float64, _Float64> ();
+#endif
+#if __HAVE_FLOAT64 && __HAVE_FLOAT128
+  check_type_minimal<_Float64, _Float128> ();
+#endif
+#if __HAVE_FLOAT64 && __HAVE_FLOAT32X
+  check_type_minimal<_Float64, _Float32x> ();
+#endif
+#if __HAVE_FLOAT64 && __HAVE_FLOAT64X
+  check_type_minimal<_Float64, _Float64x> ();
+#endif
+#if __HAVE_FLOAT64 && __HAVE_FLOAT128X
+  check_type_minimal<_Float64, _Float128x> ();
+#endif
+#if __HAVE_FLOAT128
+  check_type_minimal<_Float128, float> ();
+#endif
+#if __HAVE_FLOAT128
+  check_type_minimal<_Float128, double> ();
+#endif
+#if __HAVE_FLOAT128 && LDBL_MANT_DIG != 106
+  check_type_minimal<_Float128, long double> ();
+#endif
+#if __HAVE_FLOAT128 && __HAVE_FLOAT16
+  check_type_minimal<_Float128, _Float16> ();
+#endif
+#if __HAVE_FLOAT128 && __HAVE_FLOAT32
+  check_type_minimal<_Float128, _Float32> ();
+#endif
+#if __HAVE_FLOAT128 && __HAVE_FLOAT64
+  check_type_minimal<_Float128, _Float64> ();
+#endif
+#if __HAVE_FLOAT128
+  check_type_minimal<_Float128, _Float128> ();
+#endif
+#if __HAVE_FLOAT128 && __HAVE_FLOAT32X
+  check_type_minimal<_Float128, _Float32x> ();
+#endif
+#if __HAVE_FLOAT128 && __HAVE_FLOAT64X
+  check_type_minimal<_Float128, _Float64x> ();
+#endif
+#if __HAVE_FLOAT128 && __HAVE_FLOAT128X
+  check_type_minimal<_Float128, _Float128x> ();
+#endif
+#if __HAVE_FLOAT32X
+  check_type_minimal<_Float32x, float> ();
+#endif
+#if __HAVE_FLOAT32X
+  check_type_minimal<_Float32x, double> ();
+#endif
+#if __HAVE_FLOAT32X
+  check_type_minimal<_Float32x, long double> ();
+#endif
+#if __HAVE_FLOAT32X && __HAVE_FLOAT16
+  check_type_minimal<_Float32x, _Float16> ();
+#endif
+#if __HAVE_FLOAT32X && __HAVE_FLOAT32
+  check_type_minimal<_Float32x, _Float32> ();
+#endif
+#if __HAVE_FLOAT32X && __HAVE_FLOAT64
+  check_type_minimal<_Float32x, _Float64> ();
+#endif
+#if __HAVE_FLOAT32X && __HAVE_FLOAT128
+  check_type_minimal<_Float32x, _Float128> ();
+#endif
+#if __HAVE_FLOAT32X
+  check_type_minimal<_Float32x, _Float32x> ();
+#endif
+#if __HAVE_FLOAT32X && __HAVE_FLOAT64X
+  check_type_minimal<_Float32x, _Float64x> ();
+#endif
+#if __HAVE_FLOAT32X && __HAVE_FLOAT128X
+  check_type_minimal<_Float32x, _Float128x> ();
+#endif
+#if __HAVE_FLOAT64X
+  check_type_minimal<_Float64x, float> ();
+#endif
+#if __HAVE_FLOAT64X
+  check_type_minimal<_Float64x, double> ();
+#endif
+#if __HAVE_FLOAT64X && LDBL_MANT_DIG != 106
+  check_type_minimal<_Float64x, long double> ();
+#endif
+#if __HAVE_FLOAT64X && __HAVE_FLOAT16
+  check_type_minimal<_Float64x, _Float16> ();
+#endif
+#if __HAVE_FLOAT64X && __HAVE_FLOAT32
+  check_type_minimal<_Float64x, _Float32> ();
+#endif
+#if __HAVE_FLOAT64X && __HAVE_FLOAT64
+  check_type_minimal<_Float64x, _Float64> ();
+#endif
+#if __HAVE_FLOAT64X && __HAVE_FLOAT128
+  check_type_minimal<_Float64x, _Float128> ();
+#endif
+#if __HAVE_FLOAT64X && __HAVE_FLOAT32X
+  check_type_minimal<_Float64x, _Float32x> ();
+#endif
+#if __HAVE_FLOAT64X
+  check_type_minimal<_Float64x, _Float64x> ();
+#endif
+#if __HAVE_FLOAT64X && __HAVE_FLOAT128X
+  check_type_minimal<_Float64x, _Float128x> ();
+#endif
+#if __HAVE_FLOAT128X
+  check_type_minimal<_Float128x, float> ();
+#endif
+#if __HAVE_FLOAT128X
+  check_type_minimal<_Float128x, double> ();
+#endif
+#if __HAVE_FLOAT128X && LDBL_MANT_DIG != 106
+  check_type_minimal<_Float128x, long double> ();
+#endif
+#if __HAVE_FLOAT128X && __HAVE_FLOAT16
+  check_type_minimal<_Float128x, _Float16> ();
+#endif
+#if __HAVE_FLOAT128X && __HAVE_FLOAT32
+  check_type_minimal<_Float128x, _Float32> ();
+#endif
+#if __HAVE_FLOAT128X && __HAVE_FLOAT64
+  check_type_minimal<_Float128x, _Float64> ();
+#endif
+#if __HAVE_FLOAT128X && __HAVE_FLOAT128
+  check_type_minimal<_Float128x, _Float128> ();
+#endif
+#if __HAVE_FLOAT128X && __HAVE_FLOAT32X
+  check_type_minimal<_Float128x, _Float32x> ();
+#endif
+#if __HAVE_FLOAT128X && __HAVE_FLOAT64X
+  check_type_minimal<_Float128x, _Float64x> ();
+#endif
+#if __HAVE_FLOAT128X
+  check_type_minimal<_Float128x, _Float128x> ();
+#endif
+
   return 0;
 }