@@ -154,6 +154,15 @@ void predefined_macros(void)
predefined_ctype("INT_LEAST64", int64_ctype, PTYPE_MAX|PTYPE_TYPE|PTYPE_WIDTH);
predefined_ctype("UINT_LEAST64", uint64_ctype, PTYPE_MAX|PTYPE_TYPE);
+ predefined_ctype("INT_FAST8", fast8_ctype, PTYPE_MAX|PTYPE_TYPE|PTYPE_WIDTH);
+ predefined_ctype("UINT_FAST8", ufast8_ctype, PTYPE_MAX|PTYPE_TYPE);
+ predefined_ctype("INT_FAST16", fast16_ctype, PTYPE_MAX|PTYPE_TYPE|PTYPE_WIDTH);
+ predefined_ctype("UINT_FAST16",ufast16_ctype, PTYPE_MAX|PTYPE_TYPE);
+ predefined_ctype("INT_FAST32", fast32_ctype, PTYPE_MAX|PTYPE_TYPE|PTYPE_WIDTH);
+ predefined_ctype("UINT_FAST32",ufast32_ctype, PTYPE_MAX|PTYPE_TYPE);
+ predefined_ctype("INT_FAST64", fast64_ctype, PTYPE_MAX|PTYPE_TYPE|PTYPE_WIDTH);
+ predefined_ctype("UINT_FAST64",ufast64_ctype, PTYPE_MAX|PTYPE_TYPE);
+
predefined_ctype("INTMAX", intmax_ctype, PTYPE_MAX|PTYPE_TYPE|PTYPE_WIDTH);
predefined_ctype("UINTMAX", uintmax_ctype, PTYPE_MAX|PTYPE_TYPE);
predefined_ctype("INTPTR", ssize_t_ctype, PTYPE_MAX|PTYPE_TYPE|PTYPE_WIDTH);
@@ -5,9 +5,16 @@
static void init_arm(const struct target *self)
{
+ fast16_ctype = &int_ctype;
+ ufast16_ctype = &uint_ctype;
+ fast32_ctype = &int_ctype;
+ ufast32_ctype = &uint_ctype;
+
if (arch_os == OS_NONE) {
int32_ctype = &long_ctype;
uint32_ctype = &ulong_ctype;
+ fast8_ctype = &int_ctype;
+ ufast8_ctype = &uint_ctype;
}
}
@@ -8,6 +8,11 @@ static void init_h8300(const struct target *self)
ssize_t_ctype = &long_ctype;
size_t_ctype = &ulong_ctype;
wchar_ctype = &ushort_ctype;
+
+ fast16_ctype = &int_ctype;
+ ufast16_ctype = &uint_ctype;
+ fast32_ctype = &int_ctype;
+ ufast32_ctype = &uint_ctype;
}
static void predefine_h8300(const struct target *self)
@@ -3,6 +3,14 @@
#include "machine.h"
+static void init_m68k(const struct target *self)
+{
+ fast16_ctype = &int_ctype;
+ ufast16_ctype = &uint_ctype;
+ fast32_ctype = &int_ctype;
+ ufast32_ctype = &uint_ctype;
+}
+
static void predefine_m68k(const struct target *self)
{
predefine("__m68k__", 1, "1");
@@ -19,5 +27,6 @@ const struct target target_m68k = {
.bits_in_longdouble = 96,
.max_fp_alignment = 4,
+ .init = init_m68k,
.predefine = predefine_m68k,
};
@@ -3,6 +3,14 @@
#include "machine.h"
+static void init_microblaze(const struct target *self)
+{
+ fast16_ctype = &int_ctype;
+ ufast16_ctype = &uint_ctype;
+ fast32_ctype = &int_ctype;
+ ufast32_ctype = &uint_ctype;
+}
+
static void predefine_microblaze(const struct target *self)
{
predefine("__MICROBLAZE__", 1, "1");
@@ -21,5 +29,6 @@ const struct target target_microblaze = {
.bits_in_longdouble = 64,
+ .init = init_microblaze,
.predefine = predefine_microblaze,
};
@@ -5,6 +5,11 @@
static void init_nds32(const struct target *self)
{
+ fast16_ctype = &int_ctype;
+ ufast16_ctype = &uint_ctype;
+ fast32_ctype = &int_ctype;
+ ufast32_ctype = &uint_ctype;
+
wchar_ctype = &uint_ctype;
}
@@ -4,6 +4,14 @@
#include "builtin.h"
+static void init_nios2(const struct target *self)
+{
+ fast16_ctype = &int_ctype;
+ ufast16_ctype = &uint_ctype;
+ fast32_ctype = &int_ctype;
+ ufast32_ctype = &uint_ctype;
+}
+
static void predefine_nios2(const struct target *self)
{
predefine("__NIOS2", 1, "1");
@@ -33,6 +41,7 @@ const struct target target_nios2 = {
.bits_in_longdouble = 64,
+ .init = init_nios2,
.predefine = predefine_nios2,
.builtins = builtins_nios2,
};
@@ -5,6 +5,11 @@
static void init_openrisc(const struct target *self)
{
+ fast16_ctype = &int_ctype;
+ ufast16_ctype = &uint_ctype;
+ fast32_ctype = &int_ctype;
+ ufast32_ctype = &uint_ctype;
+
wchar_ctype = &uint_ctype;
}
@@ -31,6 +31,14 @@ static const char *asm_constraint_ppc(struct asm_operand *op, int c, const char
}
+static void init_ppc32(const struct target *self)
+{
+ fast16_ctype = &int_ctype;
+ ufast16_ctype = &uint_ctype;
+ fast32_ctype = &int_ctype;
+ ufast32_ctype = &uint_ctype;
+}
+
static void predefine_ppc32(const struct target *self)
{
predefine_ppc(self);
@@ -46,6 +54,7 @@ const struct target target_ppc32 = {
.target_64bit = &target_ppc64,
+ .init = init_ppc32,
.predefine = predefine_ppc32,
.asm_constraint = asm_constraint_ppc,
};
@@ -87,6 +87,16 @@ static void init_riscv(const struct target *self)
riscv_flags = self->flags;
}
+static void init_riscv32(const struct target *self)
+{
+ fast16_ctype = &int_ctype;
+ ufast16_ctype = &uint_ctype;
+ fast32_ctype = &int_ctype;
+ ufast32_ctype = &uint_ctype;
+
+ init_riscv(self);
+}
+
static void predefine_riscv(const struct target *self)
{
static const char *cmodels[CMODEL_LAST] = {
@@ -131,7 +141,7 @@ const struct target target_riscv32 = {
.target_64bit = &target_riscv64,
- .init = init_riscv,
+ .init = init_riscv32,
.predefine = predefine_riscv,
.parse_march = parse_march_riscv,
};
@@ -4,6 +4,14 @@
#include "expression.h"
+static void init_s390(const struct target *self)
+{
+ fast16_ctype = &int_ctype;
+ ufast16_ctype = &uint_ctype;
+ fast32_ctype = &int_ctype;
+ ufast32_ctype = &uint_ctype;
+}
+
static void predefine_s390(const struct target *self)
{
predefine("__s390__", 1, "1");
@@ -31,6 +39,7 @@ const struct target target_s390 = {
.target_64bit = &target_s390x,
+ .init = init_s390,
.predefine = predefine_s390,
.asm_constraint = asm_constraint_s390,
};
@@ -7,6 +7,12 @@ static void init_sh(const struct target *self)
{
int64_ctype = &llong_ctype;
uint64_ctype = &ullong_ctype;
+
+ fast16_ctype = &int_ctype;
+ ufast16_ctype = &uint_ctype;
+ fast32_ctype = &int_ctype;
+ ufast32_ctype = &uint_ctype;
+
wchar_ctype = &long_ctype;
}
@@ -19,6 +19,11 @@ static void predefine_sparc(const struct target *self)
static void init_sparc32(const struct target *target)
{
+ fast16_ctype = &int_ctype;
+ ufast16_ctype = &uint_ctype;
+ fast32_ctype = &int_ctype;
+ ufast32_ctype = &uint_ctype;
+
if (!sparc_version)
sparc_version = 8;
@@ -33,6 +33,8 @@ static void init_x86_common(const struct target *target)
ssize_t_ctype = &long_ctype;
wchar_ctype = &int_ctype;
wint_ctype = &int_ctype;
+ fast16_ctype = &short_ctype;
+ ufast16_ctype = &ushort_ctype;
break;
}
}
@@ -40,6 +42,11 @@ static void init_x86_common(const struct target *target)
static void init_i386(const struct target *target)
{
+ fast16_ctype = &int_ctype;
+ ufast16_ctype = &uint_ctype;
+ fast32_ctype = &int_ctype;
+ ufast32_ctype = &uint_ctype;
+
init_x86_common(target);
}
@@ -71,13 +78,31 @@ static void init_x86_64(const struct target *target)
int64_ctype = &llong_ctype;
uint64_ctype = &ullong_ctype;
wint_ctype = &int_ctype;
+ fast16_ctype = &short_ctype;
+ ufast16_ctype = &ushort_ctype;
+ fast32_ctype = &int_ctype;
+ ufast32_ctype = &uint_ctype;
+ fast64_ctype = &llong_ctype;
+ ufast64_ctype = &ullong_ctype;
break;
case OS_FREEBSD:
+ fast16_ctype = &short_ctype;
+ ufast16_ctype = &ushort_ctype;
+ fast32_ctype = &int_ctype;
+ ufast32_ctype = &uint_ctype;
break;
case OS_NETBSD:
+ fast8_ctype = &int_ctype;
+ ufast8_ctype = &uint_ctype;
+ fast16_ctype = &int_ctype;
+ ufast16_ctype = &uint_ctype;
+ fast32_ctype = &int_ctype;
+ ufast32_ctype = &uint_ctype;
wint_ctype = &int_ctype;
break;
case OS_OPENBSD:
+ fast32_ctype = &int_ctype;
+ ufast32_ctype = &uint_ctype;
int64_ctype = &llong_ctype;
uint64_ctype = &ullong_ctype;
intmax_ctype = &llong_ctype;
@@ -5,6 +5,11 @@
static void init_xtensa(const struct target *self)
{
+ fast16_ctype = &int_ctype;
+ ufast16_ctype = &uint_ctype;
+ fast32_ctype = &int_ctype;
+ ufast32_ctype = &uint_ctype;
+
wchar_ctype = &long_ctype;
}
@@ -23,6 +23,14 @@ struct symbol *least32_ctype = &int_ctype;
struct symbol *uleast32_ctype = &uint_ctype;
struct symbol *least64_ctype = &llong_ctype;
struct symbol *uleast64_ctype = &ullong_ctype;
+struct symbol *fast8_ctype = &schar_ctype;
+struct symbol *ufast8_ctype = &uchar_ctype;
+struct symbol *fast16_ctype = &long_ctype;
+struct symbol *ufast16_ctype = &ulong_ctype;
+struct symbol *fast32_ctype = &long_ctype;
+struct symbol *ufast32_ctype = &ulong_ctype;
+struct symbol *fast64_ctype = &long_ctype;
+struct symbol *ufast64_ctype = &ulong_ctype;
/*
* For "__attribute__((aligned))"
@@ -214,6 +222,8 @@ void target_init(void)
uint64_ctype = &ullong_ctype;
intmax_ctype = &llong_ctype;
uintmax_ctype = &ullong_ctype;
+ fast64_ctype = &llong_ctype;
+ ufast64_ctype = &ullong_ctype;
if (target->target_32bit)
target = target->target_32bit;
break;
@@ -21,6 +21,14 @@ extern struct symbol *least32_ctype;
extern struct symbol *uleast32_ctype;
extern struct symbol *least64_ctype;
extern struct symbol *uleast64_ctype;
+extern struct symbol *fast8_ctype;
+extern struct symbol *ufast8_ctype;
+extern struct symbol *fast16_ctype;
+extern struct symbol *ufast16_ctype;
+extern struct symbol *fast32_ctype;
+extern struct symbol *ufast32_ctype;
+extern struct symbol *fast64_ctype;
+extern struct symbol *ufast64_ctype;
/*
* For "__attribute__((aligned))"
We just added __INT_LEAST${N}_TYPE__, so add these ones too as they looks slightly more useful. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com> --- predefine.c | 9 +++++++++ target-arm.c | 7 +++++++ target-h8300.c | 5 +++++ target-m68k.c | 9 +++++++++ target-microblaze.c | 9 +++++++++ target-nds32.c | 5 +++++ target-nios2.c | 9 +++++++++ target-openrisc.c | 5 +++++ target-ppc.c | 9 +++++++++ target-riscv.c | 12 +++++++++++- target-s390.c | 9 +++++++++ target-sh.c | 6 ++++++ target-sparc.c | 5 +++++ target-x86.c | 25 +++++++++++++++++++++++++ target-xtensa.c | 5 +++++ target.c | 10 ++++++++++ target.h | 8 ++++++++ 17 files changed, 146 insertions(+), 1 deletion(-)