Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit 4978a08

Browse files
authored
Merge pull request #2357 from ibuclaw/archany
Version duplicate multilib definition blocks using ARCH_Any merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>
2 parents 2b6673f + c6719eb commit 4978a08

File tree

15 files changed

+295
-1623
lines changed

15 files changed

+295
-1623
lines changed

src/core/stdc/errno.d

Lines changed: 22 additions & 523 deletions
Large diffs are not rendered by default.

src/core/stdc/fenv.d

Lines changed: 19 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,18 @@ extern (C):
2828
nothrow:
2929
@nogc:
3030

31-
version (PPC)
32-
version = PPC_Any;
33-
else version (PPC64)
34-
version = PPC_Any;
35-
36-
version (SPARC)
37-
version = SPARC_Any;
38-
version (SPARC64)
39-
version = SPARC_Any;
40-
41-
version (X86)
42-
version = X86_Any;
43-
version (X86_64)
44-
version = X86_Any;
31+
version (ARM) version = ARM_Any;
32+
version (AArch64) version = ARM_Any;
33+
version (MIPS32) version = MIPS_Any;
34+
version (MIPS64) version = MIPS_Any;
35+
version (PPC) version = PPC_Any;
36+
version (PPC64) version = PPC_Any;
37+
version (S390) version = IBMZ_Any;
38+
version (SPARC) version = SPARC_Any;
39+
version (SPARC64) version = SPARC_Any;
40+
version (SystemZ) version = IBMZ_Any;
41+
version (X86) version = X86_Any;
42+
version (X86_64) version = X86_Any;
4543

4644
version (MinGW)
4745
version = GNUFP;
@@ -94,17 +92,7 @@ version (GNUFP)
9492
alias fexcept_t = ushort;
9593
}
9694
// https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/mips/bits/fenv.h
97-
else version (MIPS32)
98-
{
99-
struct fenv_t
100-
{
101-
uint __fp_control_register;
102-
}
103-
104-
alias fexcept_t = ushort;
105-
}
106-
// https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/mips/bits/fenv.h
107-
else version (MIPS64)
95+
else version (MIPS_Any)
10896
{
10997
struct fenv_t
11098
{
@@ -147,7 +135,7 @@ version (GNUFP)
147135
alias fexcept_t = ulong;
148136
}
149137
// https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/s390/fpu/bits/fenv.h
150-
else version (SystemZ)
138+
else version (IBMZ_Any)
151139
{
152140
struct fenv_t
153141
{
@@ -575,7 +563,7 @@ else
575563
FE_TOWARDZERO = 0xC00, ///
576564
}
577565
}
578-
else version (ARM)
566+
else version (ARM_Any)
579567
{
580568
// Define bits representing exceptions in the FPU status word.
581569
enum
@@ -597,29 +585,7 @@ else
597585
FE_TOWARDZERO = 0xC00000, ///
598586
}
599587
}
600-
else version (AArch64)
601-
{
602-
// Define bits representing exceptions in the FPSR status word.
603-
enum
604-
{
605-
FE_INVALID = 1, ///
606-
FE_DIVBYZERO = 2, ///
607-
FE_OVERFLOW = 4, ///
608-
FE_UNDERFLOW = 8, ///
609-
FE_INEXACT = 16, ///
610-
FE_ALL_EXCEPT = 31, ///
611-
}
612-
613-
// Define bits representing rounding modes in the FPCR Rmode field.
614-
enum
615-
{
616-
FE_TONEAREST = 0x000000, ///
617-
FE_UPWARD = 0x400000, ///
618-
FE_DOWNWARD = 0x800000, ///
619-
FE_TOWARDZERO = 0xC00000, ///
620-
}
621-
}
622-
else version (MIPS32)
588+
else version (MIPS_Any)
623589
{
624590
// Define bits representing the exception.
625591
enum
@@ -641,61 +607,7 @@ else
641607
FE_DOWNWARD = 0x3, ///
642608
}
643609
}
644-
else version (MIPS64)
645-
{
646-
// Define bits representing the exception.
647-
enum
648-
{
649-
FE_INEXACT = 0x04, ///
650-
FE_UNDERFLOW = 0x08, ///
651-
FE_OVERFLOW = 0x10, ///
652-
FE_DIVBYZERO = 0x20, ///
653-
FE_INVALID = 0x40, ///
654-
FE_ALL_EXCEPT = 0x7C, ///
655-
}
656-
657-
// The MIPS FPU supports all of the four defined rounding modes.
658-
enum
659-
{
660-
FE_TONEAREST = 0x0, ///
661-
FE_TOWARDZERO = 0x1, ///
662-
FE_UPWARD = 0x2, ///
663-
FE_DOWNWARD = 0x3, ///
664-
}
665-
}
666-
else version (PPC)
667-
{
668-
// Define bits representing the exception.
669-
enum
670-
{
671-
FE_INEXACT = 0x2000000, ///
672-
FE_DIVBYZERO = 0x4000000, ///
673-
FE_UNDERFLOW = 0x8000000, ///
674-
FE_OVERFLOW = 0x10000000, ///
675-
FE_INVALID = 0x20000000, ///
676-
FE_INVALID_SNAN = 0x1000000, /// non-standard
677-
FE_INVALID_ISI = 0x800000, /// non-standard
678-
FE_INVALID_IDI = 0x400000, /// non-standard
679-
FE_INVALID_ZDZ = 0x200000, /// non-standard
680-
FE_INVALID_IMZ = 0x100000, /// non-standard
681-
FE_INVALID_COMPARE = 0x80000, /// non-standard
682-
FE_INVALID_SOFTWARE = 0x400, /// non-standard
683-
FE_INVALID_SQRT = 0x200, /// non-standard
684-
FE_INVALID_INTEGER_CONVERSION = 0x100, /// non-standard
685-
FE_ALL_INVALID = 0x1F80700, /// non-standard
686-
FE_ALL_EXCEPT = 0x3E000000, ///
687-
}
688-
689-
// PowerPC chips support all of the four defined rounding modes.
690-
enum
691-
{
692-
FE_TONEAREST = 0, ///
693-
FE_TOWARDZERO = 1, ///
694-
FE_UPWARD = 2, ///
695-
FE_DOWNWARD = 3, ///
696-
}
697-
}
698-
else version (PPC64)
610+
else version (PPC_Any)
699611
{
700612
// Define bits representing the exception.
701613
enum
@@ -727,7 +639,7 @@ else
727639
FE_DOWNWARD = 3, ///
728640
}
729641
}
730-
else version (SPARC64)
642+
else version (SPARC_Any)
731643
{
732644
// Define bits representing the exception.
733645
enum
@@ -749,7 +661,7 @@ else
749661
FE_DOWNWARD = 0xc0000000, ///
750662
}
751663
}
752-
else version (SystemZ)
664+
else version (IBMZ_Any)
753665
{
754666
// Define bits representing the exception.
755667
enum

src/core/stdc/math.d

Lines changed: 19 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,19 @@ else version (TVOS)
2424
else version (WatchOS)
2525
version = Darwin;
2626

27+
version (ARM) version = ARM_Any;
28+
version (AArch64) version = ARM_Any;
29+
version (MIPS32) version = MIPS_Any;
30+
version (MIPS64) version = MIPS_Any;
31+
version (PPC) version = PPC_Any;
32+
version (PPC64) version = PPC_Any;
33+
version (S390) version = IBMZ_Any;
34+
version (SPARC) version = SPARC_Any;
35+
version (SPARC64) version = SPARC_Any;
36+
version (SystemZ) version = IBMZ_Any;
37+
version (X86) version = X86_Any;
38+
version (X86_64) version = X86_Any;
39+
2740
extern (C):
2841
@trusted: // All functions here operate on floating point and integer values only.
2942
nothrow:
@@ -118,70 +131,42 @@ else version (CRuntime_UClibc)
118131
}
119132
else version (CRuntime_Glibc)
120133
{
121-
version (X86)
134+
version (X86_Any)
122135
{
123136
///
124137
enum int FP_ILOGB0 = int.min;
125138
///
126139
enum int FP_ILOGBNAN = int.min;
127140
}
128-
else version (X86_64)
129-
{
130-
///
131-
enum int FP_ILOGB0 = int.min;
132-
///
133-
enum int FP_ILOGBNAN = int.min;
134-
}
135-
else version (ARM)
136-
{
137-
///
138-
enum int FP_ILOGB0 = -int.max;
139-
///
140-
enum int FP_ILOGBNAN = int.max;
141-
}
142-
else version (AArch64)
143-
{
144-
///
145-
enum int FP_ILOGB0 = -int.max;
146-
///
147-
enum int FP_ILOGBNAN = int.max;
148-
}
149-
else version (MIPS32)
150-
{
151-
///
152-
enum int FP_ILOGB0 = -int.max;
153-
///
154-
enum int FP_ILOGBNAN = int.max;
155-
}
156-
else version (MIPS64)
141+
else version (ARM_Any)
157142
{
158143
///
159144
enum int FP_ILOGB0 = -int.max;
160145
///
161146
enum int FP_ILOGBNAN = int.max;
162147
}
163-
else version (PPC)
148+
else version (MIPS_Any)
164149
{
165150
///
166151
enum int FP_ILOGB0 = -int.max;
167152
///
168153
enum int FP_ILOGBNAN = int.max;
169154
}
170-
else version (PPC64)
155+
else version (PPC_Any)
171156
{
172157
///
173158
enum int FP_ILOGB0 = -int.max;
174159
///
175160
enum int FP_ILOGBNAN = int.max;
176161
}
177-
else version (SPARC64)
162+
else version (SPARC_Any)
178163
{
179164
///
180165
enum int FP_ILOGB0 = -int.max;
181166
///
182167
enum int FP_ILOGBNAN = int.max;
183168
}
184-
else version (SystemZ)
169+
else version (IBMZ_Any)
185170
{
186171
///
187172
enum int FP_ILOGB0 = -int.max;

0 commit comments

Comments
 (0)