diff options
author | Mike Frysinger <vapier@gentoo.org> | 2021-12-06 02:18:31 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2022-01-06 01:17:38 -0500 |
commit | 9850d2d83eb919dc9e333e8ad9d7f308d2d1967b (patch) | |
tree | 469903d696dacf7d09d22f4a4ef32f36d09b17b9 /sim | |
parent | b331e677d748b322003d4f59eb0bd2ce3feada4b (diff) | |
download | gdb-9850d2d83eb919dc9e333e8ad9d7f308d2d1967b.zip gdb-9850d2d83eb919dc9e333e8ad9d7f308d2d1967b.tar.gz gdb-9850d2d83eb919dc9e333e8ad9d7f308d2d1967b.tar.bz2 |
sim: igen: migrate to standard uintXX_t types
Move off the custom local 64-bit types and to the standard uintXX_t
types that C11 provides.
Diffstat (limited to 'sim')
-rw-r--r-- | sim/igen/gen-idecode.c | 4 | ||||
-rw-r--r-- | sim/igen/igen.c | 2 | ||||
-rw-r--r-- | sim/igen/ld-decode.c | 2 | ||||
-rw-r--r-- | sim/igen/ld-insn.c | 2 | ||||
-rw-r--r-- | sim/igen/ld-insn.h | 2 | ||||
-rw-r--r-- | sim/igen/misc.h | 24 |
6 files changed, 9 insertions, 27 deletions
diff --git a/sim/igen/gen-idecode.c b/sim/igen/gen-idecode.c index 5e87e15..d16cab5 100644 --- a/sim/igen/gen-idecode.c +++ b/sim/igen/gen-idecode.c @@ -984,8 +984,8 @@ print_idecode_globals (lf *file) lf_printf (file, "\n"); lf_printf (file, "typedef struct _idecode_table_entry {\n"); lf_printf (file, " int shift;\n"); - lf_printf (file, " unsigned%d mask;\n", options.insn_bit_size); - lf_printf (file, " unsigned%d value;\n", options.insn_bit_size); + lf_printf (file, " uint%d_t mask;\n", options.insn_bit_size); + lf_printf (file, " uint%d_t value;\n", options.insn_bit_size); lf_printf (file, " void *function_or_table;\n"); lf_printf (file, "} idecode_table_entry;\n"); } diff --git a/sim/igen/igen.c b/sim/igen/igen.c index 2389ccd..ba85640 100644 --- a/sim/igen/igen.c +++ b/sim/igen/igen.c @@ -759,7 +759,7 @@ static void gen_idecode_h (lf *file, gen_table *gen, insn_table *insns, cache_entry *cache_rules) { - lf_printf (file, "typedef unsigned%d %sinstruction_word;\n", + lf_printf (file, "typedef uint%d_t %sinstruction_word;\n", options.insn_bit_size, options.module.global.prefix.l); if (options.gen.delayed_branch) { diff --git a/sim/igen/ld-decode.c b/sim/igen/ld-decode.c index 3875bdb..da0e9da 100644 --- a/sim/igen/ld-decode.c +++ b/sim/igen/ld-decode.c @@ -70,7 +70,7 @@ static const name_map decode_search_map[] = { static void -set_bits (int bit[max_insn_bit_size], unsigned64 value) +set_bits (int bit[max_insn_bit_size], uint64_t value) { int bit_nr; for (bit_nr = 0; bit_nr < max_insn_bit_size; bit_nr++) diff --git a/sim/igen/ld-insn.c b/sim/igen/ld-insn.c index 6727d9f..20c1f77 100644 --- a/sim/igen/ld-insn.c +++ b/sim/igen/ld-insn.c @@ -203,7 +203,7 @@ parse_insn_word (line_ref *line, char *string, int word_nr) { /* when the length/pos field is omited, an integer field is always binary */ - unsigned64 val = 0; + uint64_t val = 0; int i; for (i = 0; i < strlen_val; i++) { diff --git a/sim/igen/ld-insn.h b/sim/igen/ld-insn.h index dba2e63..4859bae 100644 --- a/sim/igen/ld-insn.h +++ b/sim/igen/ld-insn.h @@ -21,7 +21,7 @@ -typedef unsigned64 insn_uint; +typedef uint64_t insn_uint; /* Common among most entries: diff --git a/sim/igen/misc.h b/sim/igen/misc.h index 48c2126..a1cae76 100644 --- a/sim/igen/misc.h +++ b/sim/igen/misc.h @@ -30,29 +30,11 @@ enum }; -/* Define a 64bit data type */ - -#if defined __GNUC__ || defined _WIN32 -#ifdef __GNUC__ - -typedef long long signed64; -typedef unsigned long long unsigned64; - -#else /* _WIN32 */ - -typedef __int64 signed64; -typedef unsigned __int64 unsigned64; - -#endif /* _WIN32 */ -#else /* Not GNUC or WIN32 */ -/* Not supported */ -#endif - - -#include <stdio.h> #include <ctype.h> -#include <string.h> +#include <stdint.h> +#include <stdio.h> #include <stdlib.h> +#include <string.h> #if !defined (__attribute__) && (!defined(__GNUC__) || __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)) #define __attribute__(arg) |