aboutsummaryrefslogtreecommitdiff
path: root/sim
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-12-05 12:32:34 -0500
committerMike Frysinger <vapier@gentoo.org>2022-01-06 01:17:38 -0500
commit39a5fdbc652ee79f6c20a70c31eb40478ced27e2 (patch)
treedb52f227fc842b039d3e82511460c095a93828d7 /sim
parent4a92dedc592fd0d5e8bbf9987ed2602b92607bed (diff)
downloadgdb-39a5fdbc652ee79f6c20a70c31eb40478ced27e2.zip
gdb-39a5fdbc652ee79f6c20a70c31eb40478ced27e2.tar.gz
gdb-39a5fdbc652ee79f6c20a70c31eb40478ced27e2.tar.bz2
sim: testsuite: migrate to standard uintXX_t types
This old code setup its own uintXX types, but since we require C11 now, we can assume the standard uintXX_t types exist and use them.
Diffstat (limited to 'sim')
-rw-r--r--sim/testsuite/common/alu-n-tst.h2
-rw-r--r--sim/testsuite/common/alu-tst.c16
-rw-r--r--sim/testsuite/common/bits-gen.c4
-rw-r--r--sim/testsuite/common/fpu-tst.c16
4 files changed, 19 insertions, 19 deletions
diff --git a/sim/testsuite/common/alu-n-tst.h b/sim/testsuite/common/alu-n-tst.h
index cd218d4..14abe86 100644
--- a/sim/testsuite/common/alu-n-tst.h
+++ b/sim/testsuite/common/alu-n-tst.h
@@ -5,7 +5,7 @@
#include "symcat.h"
/* NOTE: see end of file for #undef of these macros */
-#define unsignedN XCONCAT2(unsigned,N)
+#define unsignedN XCONCAT3(uint,N,_t)
#define MAX_INT XCONCAT2(MAX_INT,N)
#define MIN_INT XCONCAT2(MIN_INT,N)
#define alu_N_tests XCONCAT3(alu_,N,_tests)
diff --git a/sim/testsuite/common/alu-tst.c b/sim/testsuite/common/alu-tst.c
index 110427f..63042cf 100644
--- a/sim/testsuite/common/alu-tst.c
+++ b/sim/testsuite/common/alu-tst.c
@@ -27,13 +27,13 @@
typedef struct {
char *op;
- unsigned64 arg;
+ uint64_t arg;
} alu_op;
typedef struct {
- unsigned64 begin;
+ uint64_t begin;
alu_op ops[4];
- unsigned64 result;
+ uint64_t result;
int carry_borrow;
int overflow;
} alu_test;
@@ -51,21 +51,21 @@ typedef struct {
#define MIN_INT64 UNSIGNED64 (0x8000000000000000)
static void
-print_hex (unsigned64 val, int nr_bits)
+print_hex (uint64_t val, int nr_bits)
{
switch (nr_bits)
{
case 8:
- printf ("0x%02lx", (long) (unsigned8) (val));
+ printf ("0x%02lx", (long) (uint8_t) (val));
break;
case 16:
- printf ("0x%04lx", (long) (unsigned16) (val));
+ printf ("0x%04lx", (long) (uint16_t) (val));
break;
case 32:
- printf ("0x%08lx", (long) (unsigned32) (val));
+ printf ("0x%08lx", (long) (uint32_t) (val));
break;
case 64:
- printf ("0x%016llx", (long long) (unsigned64) (val));
+ printf ("0x%016llx", (long long) (uint64_t) (val));
break;
default:
abort ();
diff --git a/sim/testsuite/common/bits-gen.c b/sim/testsuite/common/bits-gen.c
index 5f35247..d1787fc 100644
--- a/sim/testsuite/common/bits-gen.c
+++ b/sim/testsuite/common/bits-gen.c
@@ -30,8 +30,8 @@ gen_struct (void)
printf (" int line;\n");
printf (" int row;\n");
printf (" int col;\n");
- printf (" unsigned64 val;\n");
- printf (" unsigned64 check;\n");
+ printf (" uint64_t val;\n");
+ printf (" uint64_t check;\n");
printf ("} test_tuples;\n");
printf ("\n");
printf ("typedef struct _test_spec {\n");
diff --git a/sim/testsuite/common/fpu-tst.c b/sim/testsuite/common/fpu-tst.c
index d347e12..5ae1e08 100644
--- a/sim/testsuite/common/fpu-tst.c
+++ b/sim/testsuite/common/fpu-tst.c
@@ -25,7 +25,7 @@ do { \
static int flags;
-int8
+int8_t
syst_float_flags_clear ()
{
int old_flags = 0;
@@ -72,7 +72,7 @@ syst_float_flags_clear ()
sim_fpu_round rounding_mode;
void
-syst_float_set_rounding_mode(int8 mode)
+syst_float_set_rounding_mode(int8_t mode)
{
switch (mode)
{
@@ -93,7 +93,7 @@ syst_float_set_rounding_mode(int8 mode)
float32
-syst_int32_to_float32(int32 a)
+syst_int32_to_float32(int32_t a)
{
float32 z;
sim_fpu s;
@@ -104,7 +104,7 @@ syst_int32_to_float32(int32 a)
}
float64
-syst_int32_to_float64( int32 a )
+syst_int32_to_float64( int32_t a )
{
float64 z;
sim_fpu s;
@@ -113,10 +113,10 @@ syst_int32_to_float64( int32 a )
return z;
}
-int32
+int32_t
syst_float32_to_int32_round_to_zero( float32 a )
{
- int32 z;
+ int32_t z;
sim_fpu s;
sim_fpu_32to (&s, a);
flags |= sim_fpu_to32i (&z, &s, sim_fpu_round_zero);
@@ -312,9 +312,9 @@ flag syst_float32_lt_quiet( float32 a, float32 b )
return is;
}
-int32 syst_float64_to_int32_round_to_zero( float64 a )
+int32_t syst_float64_to_int32_round_to_zero( float64 a )
{
- int32 z;
+ int32_t z;
sim_fpu s;
sim_fpu_64to (&s, a);
flags |= sim_fpu_to32i (&z, &s, sim_fpu_round_zero);