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.
This commit is contained in:
Mike Frysinger 2021-12-06 02:18:31 -05:00
parent b331e677d7
commit 9850d2d83e
6 changed files with 9 additions and 27 deletions

View File

@ -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");
}

View File

@ -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)
{

View File

@ -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++)

View File

@ -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++)
{

View File

@ -21,7 +21,7 @@
typedef unsigned64 insn_uint;
typedef uint64_t insn_uint;
/* Common among most entries:

View File

@ -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)