#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)
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;
#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 ();
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");
static int flags;
-int8
+int8_t
syst_float_flags_clear ()
{
int old_flags = 0;
sim_fpu_round rounding_mode;
void
-syst_float_set_rounding_mode(int8 mode)
+syst_float_set_rounding_mode(int8_t mode)
{
switch (mode)
{
float32
-syst_int32_to_float32(int32 a)
+syst_int32_to_float32(int32_t a)
{
float32 z;
sim_fpu s;
}
float64
-syst_int32_to_float64( int32 a )
+syst_int32_to_float64( int32_t a )
{
float64 z;
sim_fpu s;
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);
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);