smatch_kernel_host_data: enable additional debug
[smatch.git] / target-mips.c
blob1ff0760c24469df79f34ecc3f394adacb88cf4c2
1 #include "symbol.h"
2 #include "target.h"
3 #include "machine.h"
6 static void predefine_mips(const struct target *self)
8 predefine("__mips__", 1, "1");
9 predefine("__mips", 1, "%d", ptr_ctype.bit_size);
10 predefine("_MIPS_SZINT", 1, "%d", int_ctype.bit_size);
11 predefine("_MIPS_SZLONG", 1, "%d", long_ctype.bit_size);
12 predefine("_MIPS_SZPTR", 1, "%d", ptr_ctype.bit_size);
14 if (arch_big_endian) {
15 predefine("_MIPSEB", 1, "1");
16 predefine("__MIPSEB", 1, "1");
17 predefine("__MIPSEB__", 1, "1");
18 } else {
19 predefine("_MIPSEL", 1, "1");
20 predefine("__MIPSEL", 1, "1");
21 predefine("__MIPSEL__", 1, "1");
26 static void predefine_mips32(const struct target *self)
28 predefine_mips(self);
31 const struct target target_mips32 = {
32 .mach = MACH_MIPS32,
33 .bitness = ARCH_LP32,
34 .big_endian = 1,
35 .unsigned_char = 0,
37 .bits_in_longdouble = 64,
38 .max_fp_alignment = 8,
40 .target_64bit = &target_mips64,
42 .predefine = predefine_mips32,
46 static void predefine_mips64(const struct target *self)
48 predefine("__mips64", 1, "64");
50 predefine_mips(self);
53 const struct target target_mips64 = {
54 .mach = MACH_MIPS64,
55 .bitness = ARCH_LP64,
56 .big_endian = 1,
57 .unsigned_char = 0,
58 .has_int128 = 1,
60 .target_32bit = &target_mips32,
62 .predefine = predefine_mips64,