diff options
author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2019-12-02 01:22:20 +0100 |
---|---|---|
committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2019-12-16 10:29:00 +0100 |
commit | dd0012ff9766f81f877f4ec89957e9f22a320beb (patch) | |
tree | c8b4a8c54080054451434ab2f246b3a360ad22a0 | |
parent | 17a0752e0c01e0b44c5a3f08dce8e8fbd21a0dee (diff) | |
download | sparse-dd0012ff9766f81f877f4ec89957e9f22a320beb.tar.gz |
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 <luc.vanoostenryck@gmail.com>
-rw-r--r-- | lib.c | 10 | ||||
-rw-r--r-- | target-arm64.c | 1 | ||||
-rw-r--r-- | target-mips.c | 1 | ||||
-rw-r--r-- | target-ppc.c | 1 | ||||
-rw-r--r-- | target-riscv.c | 1 | ||||
-rw-r--r-- | target-s390.c | 1 | ||||
-rw-r--r-- | target-sparc.c | 1 | ||||
-rw-r--r-- | target-x86.c | 1 | ||||
-rw-r--r-- | target.h | 1 |
9 files changed, 9 insertions, 9 deletions
@@ -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, @@ -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; |