From dd0012ff9766f81f877f4ec89957e9f22a320beb Mon Sep 17 00:00:00 2001 From: Luc Van Oostenryck Date: Mon, 2 Dec 2019 01:22:20 +0100 Subject: arch: use arch_target for INT128's predefine 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 --- 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(-) diff --git a/lib.c b/lib.c index de9c87c1..842423c6 100644 --- a/lib.c +++ b/lib.c @@ -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"); diff --git a/target-arm64.c b/target-arm64.c index 71db639c..d491b65e 100644 --- a/target-arm64.c +++ b/target-arm64.c @@ -30,6 +30,7 @@ const struct target target_arm64 = { .big_endian = 0, .unsigned_char = 1, + .has_int128 = 1, .wchar = &uint_ctype, diff --git a/target-mips.c b/target-mips.c index 395e6ff1..3d73236f 100644 --- a/target-mips.c +++ b/target-mips.c @@ -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, diff --git a/target-ppc.c b/target-ppc.c index 21ce86d8..b138635b 100644 --- a/target-ppc.c +++ b/target-ppc.c @@ -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, diff --git a/target-riscv.c b/target-riscv.c index bbb47e9d..08d036ca 100644 --- a/target-riscv.c +++ b/target-riscv.c @@ -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, diff --git a/target-s390.c b/target-s390.c index 159a6b11..8fe7d936 100644 --- a/target-s390.c +++ b/target-s390.c @@ -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, diff --git a/target-sparc.c b/target-sparc.c index 5267430f..70c440c2 100644 --- a/target-sparc.c +++ b/target-sparc.c @@ -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, diff --git a/target-x86.c b/target-x86.c index 046e346e..01d213ef 100644 --- a/target-x86.c +++ b/target-x86.c @@ -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, diff --git a/target.h b/target.h index 8f39abb8..a89e21b6 100644 --- a/target.h +++ b/target.h @@ -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; -- cgit 1.2.3-korg