@@ -1350,16 +1350,8 @@ static void predefined_macros(void)
predefined_sizeof("DOUBLE", "", bits_in_double);
predefined_sizeof("LONG_DOUBLE", "", bits_in_longdouble);
- switch (arch_mach) {
- case MACH_ARM64:
- case MACH_MIPS64:
- case MACH_PPC64:
- case MACH_RISCV64:
- case MACH_S390X:
- case MACH_SPARC64:
- case MACH_X86_64:
+ if (arch_target->has_int128)
predefined_sizeof("INT128", "", 128);
- }
predefine("__ORDER_LITTLE_ENDIAN__", 1, "1234");
predefine("__ORDER_BIG_ENDIAN__", 1, "4321");
@@ -30,6 +30,7 @@ const struct target target_arm64 = {
.big_endian = 0,
.unsigned_char = 1,
+ .has_int128 = 1,
.wchar = &uint_ctype,
@@ -45,6 +45,7 @@ const struct target target_mips64 = {
.bitness = ARCH_LP64,
.big_endian = 1,
.unsigned_char = 0,
+ .has_int128 = 1,
.target_32bit = &target_mips32,
@@ -50,6 +50,7 @@ const struct target target_ppc64 = {
.bitness = ARCH_LP64,
.big_endian = 1,
.unsigned_char = 1,
+ .has_int128 = 1,
.target_32bit = &target_ppc32,
@@ -44,6 +44,7 @@ const struct target target_riscv64 = {
.bitness = ARCH_LP64,
.big_endian = 0,
.unsigned_char = 1,
+ .has_int128 = 1,
.target_32bit = &target_riscv32,
@@ -37,6 +37,7 @@ const struct target target_s390x = {
.bitness = ARCH_LP64,
.big_endian = 1,
.unsigned_char = 1,
+ .has_int128 = 1,
.bits_in_longdouble = 64,
.max_fp_alignment = 8,
@@ -58,6 +58,7 @@ const struct target target_sparc64 = {
.bitness = ARCH_LP64,
.big_endian = 1,
.unsigned_char = 0,
+ .has_int128 = 1,
.target_32bit = &target_sparc32,
@@ -61,6 +61,7 @@ const struct target target_x86_64 = {
.bitness = ARCH_LP64,
.big_endian = 0,
.unsigned_char = 0,
+ .has_int128 = 1,
.bits_in_longdouble = 128,
.max_fp_alignment = 16,
@@ -60,6 +60,7 @@ struct target {
unsigned int big_endian:1;
unsigned int unsigned_char:1;
unsigned int size_t_long:1;
+ unsigned int has_int128:1;
struct symbol *wchar;
struct symbol *wint;
The predefine for INT128 is still done with the generic predefines but are arch-specific. So, set a new flag for each arch supporting int128 and use this to determine if the predefine must be issued or not. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com> --- lib.c | 10 +--------- target-arm64.c | 1 + target-mips.c | 1 + target-ppc.c | 1 + target-riscv.c | 1 + target-s390.c | 1 + target-sparc.c | 1 + target-x86.c | 1 + target.h | 1 + 9 files changed, 9 insertions(+), 9 deletions(-)