smatch.h: introduce sm_pedantic()
[smatch.git] / target-sparc.c
blobd830f6cbe8283033d8a5b0e11dca7c99a4bd10cd
1 #include "symbol.h"
2 #include "target.h"
3 #include "machine.h"
6 static int sparc_version;
8 static void predefine_sparc(const struct target *self)
10 predefine("__sparc__", 1, "1");
11 predefine("__sparc", 1, "1");
12 predefine_nostd("sparc");
14 predefine_weak("__sparc_v%d__", sparc_version);
15 predefine_weak("__sparcv%d__", sparc_version);
16 predefine_weak("__sparcv%d", sparc_version);
20 static void init_sparc32(const struct target *target)
22 fast16_ctype = &int_ctype;
23 ufast16_ctype = &uint_ctype;
24 fast32_ctype = &int_ctype;
25 ufast32_ctype = &uint_ctype;
27 if (!sparc_version)
28 sparc_version = 8;
30 if (arch_os == OS_SUNOS) {
31 wint_ctype = &long_ctype;
32 wchar_ctype = &long_ctype;
34 bits_in_longdouble = 128;
35 max_fp_alignment = 16;
37 funsigned_char = 0;
41 static void predefine_sparc32(const struct target *self)
43 predefine_sparc(self);
46 const struct target target_sparc32 = {
47 .mach = MACH_SPARC32,
48 .bitness = ARCH_LP32,
49 .big_endian = 1,
50 .unsigned_char = 0,
52 .bits_in_longdouble = 64,
53 .max_fp_alignment = 8,
55 .init = init_sparc32,
56 .target_64bit = &target_sparc64,
58 .predefine = predefine_sparc32,
62 static void init_sparc64(const struct target *target)
64 if (!sparc_version)
65 sparc_version = 9;
68 static void predefine_sparc64(const struct target *self)
70 predefine("__sparc64__", 1, "1");
71 predefine("__arch64__", 1, "1");
73 predefine_sparc(self);
76 const struct target target_sparc64 = {
77 .mach = MACH_SPARC64,
78 .bitness = ARCH_LP64,
79 .big_endian = 1,
80 .unsigned_char = 0,
81 .has_int128 = 1,
83 .target_32bit = &target_sparc32,
85 .init = init_sparc64,
86 .predefine = predefine_sparc64,