sim_fpu op1;
sim_fpu op2;
sim_fpu ans;
- unsigned32 res;
+ uint32_t res;
sim_fpu_status status;
sim_fpu_32to (&op1, x);
sim_fpu op1;
sim_fpu op2;
sim_fpu ans;
- unsigned32 res;
+ uint32_t res;
sim_fpu_status status;
sim_fpu_32to (&op1, x);
sim_fpu op1;
sim_fpu op2;
sim_fpu ans;
- unsigned32 res;
+ uint32_t res;
sim_fpu_status status;
sim_fpu_32to (&op1, x);
sim_fpu op1;
sim_fpu op2;
sim_fpu ans;
- unsigned32 res;
+ uint32_t res;
sim_fpu_status status;
sim_fpu_32to (&op1, x);
sim_fpu op1;
sim_fpu op2;
sim_fpu ans;
- unsigned32 res;
+ uint32_t res;
sim_fpu_status status;
sim_fpu_32to (&op1, x);
{
sim_fpu op1;
sim_fpu ans;
- unsigned32 res;
+ uint32_t res;
sim_fpu_status status;
sim_fpu_32to (&op1, x);
{
sim_fpu op1;
sim_fpu ans;
- unsigned32 res;
+ uint32_t res;
sim_fpu_status status;
sim_fpu_32to (&op1, x);
{
sim_fpu op1;
sim_fpu ans;
- unsigned32 res;
+ uint32_t res;
sim_fpu_status status;
sim_fpu_32to (&op1, x);
{
sim_fpu op1;
sim_fpu ans;
- unsigned32 res;
+ uint32_t res;
sim_fpu_status status;
sim_fpu_32to (&op1, x);
sim_fpu op1;
sim_fpu op2;
sim_fpu ans;
- unsigned32 res;
+ uint32_t res;
sim_fpu_status status;
sim_fpu_32to (&op1, x);
sim_fpu op1;
sim_fpu op2;
sim_fpu ans;
- unsigned32 res;
+ uint32_t res;
sim_fpu_status status;
sim_fpu_32to (&op1, x);
fextsfdf (CGEN_FPU* fpu, int how UNUSED, SF x)
{
sim_fpu op1;
- unsigned64 res;
+ uint64_t res;
sim_fpu_32to (&op1, x);
sim_fpu_to64 (&res, &op1);
ftruncdfsf (CGEN_FPU* fpu, int how UNUSED, DF x)
{
sim_fpu op1;
- unsigned32 res;
+ uint32_t res;
sim_fpu_64to (&op1, x);
sim_fpu_to32 (&res, &op1);
floatsisf (CGEN_FPU* fpu, int how UNUSED, SI x)
{
sim_fpu ans;
- unsigned32 res;
+ uint32_t res;
sim_fpu_i32to (&ans, x, sim_fpu_round_near);
sim_fpu_to32 (&res, &ans);
floatsidf (CGEN_FPU* fpu, int how UNUSED, SI x)
{
sim_fpu ans;
- unsigned64 res;
+ uint64_t res;
sim_fpu_i32to (&ans, x, sim_fpu_round_near);
sim_fpu_to64 (&res, &ans);
floatdidf (CGEN_FPU* fpu, int how UNUSED, DI x)
{
sim_fpu ans;
- unsigned64 res;
+ uint64_t res;
sim_fpu_i64to (&ans, x, sim_fpu_round_near);
sim_fpu_to64 (&res, &ans);
ufloatsisf (CGEN_FPU* fpu, int how UNUSED, USI x)
{
sim_fpu ans;
- unsigned32 res;
+ uint32_t res;
sim_fpu_u32to (&ans, x, sim_fpu_round_near);
sim_fpu_to32 (&res, &ans);
fixsfsi (CGEN_FPU* fpu, int how UNUSED, SF x)
{
sim_fpu op1;
- signed32 res;
+ int32_t res;
sim_fpu_32to (&op1, x);
sim_fpu_to32i (&res, &op1, sim_fpu_round_near);
fixdfsi (CGEN_FPU* fpu, int how UNUSED, DF x)
{
sim_fpu op1;
- signed32 res;
+ int32_t res;
sim_fpu_64to (&op1, x);
sim_fpu_to32i (&res, &op1, sim_fpu_round_near);
fixdfdi (CGEN_FPU* fpu, int how UNUSED, DF x)
{
sim_fpu op1;
- signed64 res;
+ int64_t res;
sim_fpu_64to (&op1, x);
sim_fpu_to64i (&res, &op1, sim_fpu_round_near);
ufixsfsi (CGEN_FPU* fpu, int how UNUSED, SF x)
{
sim_fpu op1;
- unsigned32 res;
+ uint32_t res;
sim_fpu_32to (&op1, x);
sim_fpu_to32u (&res, &op1, sim_fpu_round_near);
sim_fpu op1;
sim_fpu op2;
sim_fpu ans;
- unsigned64 res;
+ uint64_t res;
sim_fpu_status status;
sim_fpu_64to (&op1, x);
sim_fpu op1;
sim_fpu op2;
sim_fpu ans;
- unsigned64 res;
+ uint64_t res;
sim_fpu_status status;
sim_fpu_64to (&op1, x);
sim_fpu op1;
sim_fpu op2;
sim_fpu ans;
- unsigned64 res;
+ uint64_t res;
sim_fpu_status status;
sim_fpu_64to (&op1, x);
sim_fpu op1;
sim_fpu op2;
sim_fpu ans;
- unsigned64 res;
+ uint64_t res;
sim_fpu_status status;
sim_fpu_64to (&op1, x);
sim_fpu op1;
sim_fpu op2;
sim_fpu ans;
- unsigned64 res;
+ uint64_t res;
sim_fpu_status status;
sim_fpu_64to (&op1, x);
{
sim_fpu op1;
sim_fpu ans;
- unsigned64 res;
+ uint64_t res;
sim_fpu_status status;
sim_fpu_64to (&op1, x);
{
sim_fpu op1;
sim_fpu ans;
- unsigned64 res;
+ uint64_t res;
sim_fpu_status status;
sim_fpu_64to (&op1, x);
{
sim_fpu op1;
sim_fpu ans;
- unsigned64 res;
+ uint64_t res;
sim_fpu_status status;
sim_fpu_64to (&op1, x);
{
sim_fpu op1;
sim_fpu ans;
- unsigned64 res;
+ uint64_t res;
sim_fpu_status status;
sim_fpu_64to (&op1, x);
sim_fpu op1;
sim_fpu op2;
sim_fpu ans;
- unsigned64 res;
+ uint64_t res;
sim_fpu_status status;
sim_fpu_64to (&op1, x);
sim_fpu op1;
sim_fpu op2;
sim_fpu ans;
- unsigned64 res;
+ uint64_t res;
sim_fpu_status status;
sim_fpu_64to (&op1, x);
typedef struct {
enum cgen_write_queue_kind kind; /* Used to select union member below. */
IADDR insn_address; /* Address of the insn performing the write. */
- unsigned32 flags; /* Target specific flags. */
+ uint32_t flags; /* Target specific flags. */
long word1; /* Target specific field. */
union {
struct {
struct disassemble_info disasm_info;
SFILE sfile;
union {
- unsigned8 bytes[CGEN_MAX_INSN_SIZE];
- unsigned16 shorts[8];
- unsigned32 words[4];
+ uint8_t bytes[CGEN_MAX_INSN_SIZE];
+ uint16_t shorts[8];
+ uint32_t words[4];
} insn_buf;
SIM_DESC sd = CPU_STATE (cpu);
CGEN_CPU_DESC cd = CPU_CPU_DESC (cpu);
#undef VOID
typedef void VOID;
typedef unsigned char BI;
-typedef signed8 QI;
-typedef signed16 HI;
-typedef signed32 SI;
-typedef unsigned8 UQI;
-typedef unsigned16 UHI;
-typedef unsigned32 USI;
-
-typedef signed64 DI;
-typedef unsigned64 UDI;
+typedef int8_t QI;
+typedef int16_t HI;
+typedef int32_t SI;
+typedef uint8_t UQI;
+typedef uint16_t UHI;
+typedef uint32_t USI;
+
+typedef int64_t DI;
+typedef uint64_t UDI;
#define GETLODI(di) ((SI) (di))
#define GETHIDI(di) ((SI) ((UDI) (di) >> 32))
#define SETLODI(di, val) ((di) = (((di) & 0xffffffff00000000LL) | (val)))
typedef struct _hw_pal_counter {
struct hw_event *handler;
- signed64 start;
- unsigned32 delta;
+ int64_t start;
+ uint32_t delta;
int periodic_p;
} hw_pal_counter;
hw_pal_device *pal,
const char *reg,
hw_pal_counter *counter,
- unsigned32 *word,
+ uint32_t *word,
unsigned nr_bytes)
{
- unsigned32 val;
+ uint32_t val;
if (nr_bytes != 4)
hw_abort (me, "%s - bad read size must be 4 bytes", reg);
val = counter->delta;
hw_pal_device *pal,
const char *reg,
hw_pal_counter *counter,
- unsigned32 *word,
+ uint32_t *word,
unsigned nr_bytes)
{
- unsigned32 val;
+ uint32_t val;
if (nr_bytes != 4)
hw_abort (me, "%s - bad read size must be 4 bytes", reg);
if (counter->delta != 0)
hw_pal_device *pal,
const char *reg,
hw_pal_counter *counter,
- const unsigned32 *word,
+ const uint32_t *word,
unsigned nr_bytes)
{
if (nr_bytes != 4)
struct hw_event *
hw_event_queue_schedule (struct hw *me,
- signed64 delta_time,
+ int64_t delta_time,
hw_event_callback *callback,
void *data)
{
struct hw_event *
hw_event_queue_schedule_tracef (struct hw *me,
- signed64 delta_time,
+ int64_t delta_time,
hw_event_callback *callback,
void *data,
const char *fmt,
struct hw_event *
hw_event_queue_schedule_vtracef (struct hw *me,
- signed64 delta_time,
+ int64_t delta_time,
hw_event_callback *callback,
void *data,
const char *fmt,
}
-signed64
+int64_t
hw_event_queue_time (struct hw *me)
{
return sim_events_time (hw_system (me));
}
/* Returns the time that remains before the event is raised. */
-signed64
+int64_t
hw_event_remain_time (struct hw *me, struct hw_event *event)
{
- signed64 t;
+ int64_t t;
t = sim_events_remain_time (hw_system (me), event->real);
return t;
struct hw_event *hw_event_queue_schedule
(struct hw *me,
- signed64 delta_time,
+ int64_t delta_time,
hw_event_callback *handler,
void *data);
struct hw_event *hw_event_queue_schedule_tracef
(struct hw *me,
- signed64 delta_time,
+ int64_t delta_time,
hw_event_callback *handler,
void *data,
const char *fmt,
struct hw_event *hw_event_queue_schedule_vtracef
(struct hw *me,
- signed64 delta_time,
+ int64_t delta_time,
hw_event_callback *handler,
void *data,
const char *fmt,
(struct hw *me,
struct hw_event *event_to_remove);
-signed64 hw_event_queue_time
+int64_t hw_event_queue_time
(struct hw *me);
/* Returns the time that remains before the event is raised. */
-signed64 hw_event_remain_time
+int64_t hw_event_remain_time
(struct hw *me, struct hw_event *event);
#endif
const char *property,
int boolean)
{
- signed32 new_boolean = (boolean ? -1 : 0);
+ int32_t new_boolean = (boolean ? -1 : 0);
hw_add_property (me, property, boolean_property,
&new_boolean, sizeof (new_boolean),
&new_boolean, sizeof (new_boolean),
#endif
case '[':
{
- unsigned8 words[1024];
+ uint8_t words[1024];
char *curr = spec.value + 1;
int nr_words = 0;
while (1)
}
else
{
- unsigned8 *w = (unsigned8*)property->array;
+ uint8_t *w = (uint8_t*)property->array;
p->print (p->file, " [");
while ((char*)w - (char*)property->array < property->sizeof_array)
{
overflow method 2 are used. */
#define ALU8_BEGIN(VAL) \
-unsigned alu8_cr = (unsigned8) (VAL); \
-signed alu8_vr = (signed8) (alu8_cr)
+unsigned alu8_cr = (uint8_t) (VAL); \
+signed alu8_vr = (int8_t) (alu8_cr)
#define ALU8_SET(VAL) \
-alu8_cr = (unsigned8) (VAL); \
-alu8_vr = (signed8) (alu8_cr)
+alu8_cr = (uint8_t) (VAL); \
+alu8_vr = (int8_t) (alu8_cr)
#define ALU8_SET_CARRY_BORROW(CARRY) \
do { \
#define ALU8_HAD_CARRY_BORROW (alu8_cr & LSBIT32(8))
#define ALU8_HAD_OVERFLOW (((alu8_vr >> 8) ^ alu8_vr) & LSBIT32 (8-1))
-#define ALU8_RESULT ((unsigned8) alu8_cr)
-#define ALU8_CARRY_BORROW_RESULT ((unsigned8) alu8_cr)
-#define ALU8_OVERFLOW_RESULT ((unsigned8) alu8_vr)
+#define ALU8_RESULT ((uint8_t) alu8_cr)
+#define ALU8_CARRY_BORROW_RESULT ((uint8_t) alu8_cr)
+#define ALU8_OVERFLOW_RESULT ((uint8_t) alu8_vr)
/* #define ALU8_END ????? - target dependant */
overflow method 2 are used. */
#define ALU16_BEGIN(VAL) \
-signed alu16_cr = (unsigned16) (VAL); \
-unsigned alu16_vr = (signed16) (alu16_cr)
+signed alu16_cr = (uint16_t) (VAL); \
+unsigned alu16_vr = (int16_t) (alu16_cr)
#define ALU16_SET(VAL) \
-alu16_cr = (unsigned16) (VAL); \
-alu16_vr = (signed16) (alu16_cr)
+alu16_cr = (uint16_t) (VAL); \
+alu16_vr = (int16_t) (alu16_cr)
#define ALU16_SET_CARRY_BORROW(CARRY) \
do { \
#define ALU16_HAD_CARRY_BORROW (alu16_cr & LSBIT32(16))
#define ALU16_HAD_OVERFLOW (((alu16_vr >> 16) ^ alu16_vr) & LSBIT32 (16-1))
-#define ALU16_RESULT ((unsigned16) alu16_cr)
-#define ALU16_CARRY_BORROW_RESULT ((unsigned16) alu16_cr)
-#define ALU16_OVERFLOW_RESULT ((unsigned16) alu16_vr)
+#define ALU16_RESULT ((uint16_t) alu16_cr)
+#define ALU16_CARRY_BORROW_RESULT ((uint16_t) alu16_cr)
+#define ALU16_OVERFLOW_RESULT ((uint16_t) alu16_vr)
/* #define ALU16_END ????? - target dependant */
method 4 and overflow method 4 are used. */
#define ALU32_BEGIN(VAL) \
-unsigned32 alu32_r = (VAL); \
+uint32_t alu32_r = (VAL); \
int alu32_c = 0; \
int alu32_v = 0
arithmetic, it is still used. */
#define ALU64_BEGIN(VAL) \
-unsigned64 alu64_r = (VAL); \
+uint64_t alu64_r = (VAL); \
int alu64_c = 0; \
int alu64_v = 0
#define ALU8_ADD(VAL) \
do { \
- unsigned8 alu8add_val = (VAL); \
+ uint8_t alu8add_val = (VAL); \
ALU8_ADDC (alu8add_val); \
} while (0)
#define ALU16_ADD(VAL) \
do { \
- unsigned16 alu16add_val = (VAL); \
+ uint16_t alu16add_val = (VAL); \
ALU16_ADDC (alu8add_val); \
} while (0)
#define ALU32_ADD(VAL) \
do { \
- unsigned32 alu32add_val = (VAL); \
+ uint32_t alu32add_val = (VAL); \
ALU32_ADDC (alu32add_val); \
} while (0)
#define ALU64_ADD(VAL) \
do { \
- unsigned64 alu64add_val = (unsigned64) (VAL); \
+ uint64_t alu64add_val = (uint64_t) (VAL); \
ALU64_ADDC (alu64add_val); \
} while (0)
#define ALU8_ADDC(VAL) \
do { \
- unsigned8 alu8addc_val = (VAL); \
- alu8_cr += (unsigned8)(alu8addc_val); \
- alu8_vr += (signed8)(alu8addc_val); \
+ uint8_t alu8addc_val = (VAL); \
+ alu8_cr += (uint8_t)(alu8addc_val); \
+ alu8_vr += (int8_t)(alu8addc_val); \
} while (0)
#define ALU16_ADDC(VAL) \
do { \
- unsigned16 alu16addc_val = (VAL); \
- alu16_cr += (unsigned16)(alu16addc_val); \
- alu16_vr += (signed16)(alu16addc_val); \
+ uint16_t alu16addc_val = (VAL); \
+ alu16_cr += (uint16_t)(alu16addc_val); \
+ alu16_vr += (int16_t)(alu16addc_val); \
} while (0)
#define ALU32_ADDC(VAL) \
do { \
- unsigned32 alu32addc_val = (VAL); \
- unsigned32 alu32addc_sign = alu32addc_val ^ alu32_r; \
+ uint32_t alu32addc_val = (VAL); \
+ uint32_t alu32addc_sign = alu32addc_val ^ alu32_r; \
alu32_r += (alu32addc_val); \
alu32_c = (alu32_r < alu32addc_val); \
- alu32_v = ((alu32addc_sign ^ - (unsigned32)alu32_c) ^ alu32_r) >> 31; \
+ alu32_v = ((alu32addc_sign ^ - (uint32_t)alu32_c) ^ alu32_r) >> 31; \
} while (0)
#define ALU64_ADDC(VAL) \
do { \
- unsigned64 alu64addc_val = (unsigned64) (VAL); \
- unsigned64 alu64addc_sign = alu64addc_val ^ alu64_r; \
+ uint64_t alu64addc_val = (uint64_t) (VAL); \
+ uint64_t alu64addc_sign = alu64addc_val ^ alu64_r; \
alu64_r += (alu64addc_val); \
alu64_c = (alu64_r < alu64addc_val); \
- alu64_v = ((alu64addc_sign ^ - (unsigned64)alu64_c) ^ alu64_r) >> 63; \
+ alu64_v = ((alu64addc_sign ^ - (uint64_t)alu64_c) ^ alu64_r) >> 63; \
} while (0)
#define ALU_ADDC XCONCAT3(ALU,WITH_TARGET_WORD_BITSIZE,_ADDC)
#define ALU8_ADDC_C(VAL,C) \
do { \
- unsigned8 alu8addcc_val = (VAL); \
- unsigned8 alu8addcc_c = (C); \
- alu8_cr += (unsigned)(unsigned8)alu8addcc_val + alu8addcc_c; \
- alu8_vr += (signed)(signed8)(alu8addcc_val) + alu8addcc_c; \
+ uint8_t alu8addcc_val = (VAL); \
+ uint8_t alu8addcc_c = (C); \
+ alu8_cr += (unsigned)(uint8_t)alu8addcc_val + alu8addcc_c; \
+ alu8_vr += (signed)(int8_t)(alu8addcc_val) + alu8addcc_c; \
} while (0)
#define ALU16_ADDC_C(VAL,C) \
do { \
- unsigned16 alu16addcc_val = (VAL); \
- unsigned16 alu16addcc_c = (C); \
- alu16_cr += (unsigned)(unsigned16)alu16addcc_val + alu16addcc_c; \
- alu16_vr += (signed)(signed16)(alu16addcc_val) + alu16addcc_c; \
+ uint16_t alu16addcc_val = (VAL); \
+ uint16_t alu16addcc_c = (C); \
+ alu16_cr += (unsigned)(uint16_t)alu16addcc_val + alu16addcc_c; \
+ alu16_vr += (signed)(int16_t)(alu16addcc_val) + alu16addcc_c; \
} while (0)
#define ALU32_ADDC_C(VAL,C) \
do { \
- unsigned32 alu32addcc_val = (VAL); \
- unsigned32 alu32addcc_c = (C); \
- unsigned32 alu32addcc_sign = (alu32addcc_val ^ alu32_r); \
+ uint32_t alu32addcc_val = (VAL); \
+ uint32_t alu32addcc_c = (C); \
+ uint32_t alu32addcc_sign = (alu32addcc_val ^ alu32_r); \
alu32_r += (alu32addcc_val + alu32addcc_c); \
alu32_c = ((alu32_r < alu32addcc_val) \
|| (alu32addcc_c && alu32_r == alu32addcc_val)); \
- alu32_v = ((alu32addcc_sign ^ - (unsigned32)alu32_c) ^ alu32_r) >> 31;\
+ alu32_v = ((alu32addcc_sign ^ - (uint32_t)alu32_c) ^ alu32_r) >> 31;\
} while (0)
#define ALU64_ADDC_C(VAL,C) \
do { \
- unsigned64 alu64addcc_val = (VAL); \
- unsigned64 alu64addcc_c = (C); \
- unsigned64 alu64addcc_sign = (alu64addcc_val ^ alu64_r); \
+ uint64_t alu64addcc_val = (VAL); \
+ uint64_t alu64addcc_c = (C); \
+ uint64_t alu64addcc_sign = (alu64addcc_val ^ alu64_r); \
alu64_r += (alu64addcc_val + alu64addcc_c); \
alu64_c = ((alu64_r < alu64addcc_val) \
|| (alu64addcc_c && alu64_r == alu64addcc_val)); \
- alu64_v = ((alu64addcc_sign ^ - (unsigned64)alu64_c) ^ alu64_r) >> 63;\
+ alu64_v = ((alu64addcc_sign ^ - (uint64_t)alu64_c) ^ alu64_r) >> 63;\
} while (0)
#define ALU_ADDC_C XCONCAT3(ALU,WITH_TARGET_WORD_BITSIZE,_ADDC_C)
#define ALU8_SUB(VAL) \
do { \
- unsigned8 alu8sub_val = (VAL); \
+ uint8_t alu8sub_val = (VAL); \
ALU8_ADDC_C (~alu8sub_val, 1); \
} while (0)
#define ALU16_SUB(VAL) \
do { \
- unsigned16 alu16sub_val = (VAL); \
+ uint16_t alu16sub_val = (VAL); \
ALU16_ADDC_C (~alu16sub_val, 1); \
} while (0)
#define ALU32_SUB(VAL) \
do { \
- unsigned32 alu32sub_val = (VAL); \
+ uint32_t alu32sub_val = (VAL); \
ALU32_ADDC_C (~alu32sub_val, 1); \
} while (0)
#define ALU64_SUB(VAL) \
do { \
- unsigned64 alu64sub_val = (VAL); \
+ uint64_t alu64sub_val = (VAL); \
ALU64_ADDC_C (~alu64sub_val, 1); \
} while (0)
#define ALU8_SUBC(VAL) \
do { \
- unsigned8 alu8subc_val = (VAL); \
+ uint8_t alu8subc_val = (VAL); \
ALU8_ADDC_C (~alu8subc_val, 1); \
} while (0)
#define ALU16_SUBC(VAL) \
do { \
- unsigned16 alu16subc_val = (VAL); \
+ uint16_t alu16subc_val = (VAL); \
ALU16_ADDC_C (~alu16subc_val, 1); \
} while (0)
#define ALU32_SUBC(VAL) \
do { \
- unsigned32 alu32subc_val = (VAL); \
+ uint32_t alu32subc_val = (VAL); \
ALU32_ADDC_C (~alu32subc_val, 1); \
} while (0)
#define ALU64_SUBC(VAL) \
do { \
- unsigned64 alu64subc_val = (VAL); \
+ uint64_t alu64subc_val = (VAL); \
ALU64_ADDC_C (~alu64subc_val, 1); \
} while (0)
#define ALU8_SUBC_X(VAL,C) \
do { \
- unsigned8 alu8subcx_val = (VAL); \
- unsigned8 alu8subcx_c = (C); \
+ uint8_t alu8subcx_val = (VAL); \
+ uint8_t alu8subcx_c = (C); \
ALU8_ADDC_C (~alu8subcx_val, alu8subcx_c); \
} while (0)
#define ALU16_SUBC_X(VAL,C) \
do { \
- unsigned16 alu16subcx_val = (VAL); \
- unsigned16 alu16subcx_c = (C); \
+ uint16_t alu16subcx_val = (VAL); \
+ uint16_t alu16subcx_c = (C); \
ALU16_ADDC_C (~alu16subcx_val, alu16subcx_c); \
} while (0)
#define ALU32_SUBC_X(VAL,C) \
do { \
- unsigned32 alu32subcx_val = (VAL); \
- unsigned32 alu32subcx_c = (C); \
+ uint32_t alu32subcx_val = (VAL); \
+ uint32_t alu32subcx_c = (C); \
ALU32_ADDC_C (~alu32subcx_val, alu32subcx_c); \
} while (0)
#define ALU64_SUBC_X(VAL,C) \
do { \
- unsigned64 alu64subcx_val = (VAL); \
- unsigned64 alu64subcx_c = (C); \
+ uint64_t alu64subcx_val = (VAL); \
+ uint64_t alu64subcx_c = (C); \
ALU64_ADDC_C (~alu64subcx_val, alu64subcx_c); \
} while (0)
#define ALU8_SUBB(VAL) \
do { \
- unsigned8 alu8subb_val = (VAL); \
- alu8_cr -= (unsigned)(unsigned8)alu8subb_val; \
- alu8_vr -= (signed)(signed8)alu8subb_val; \
+ uint8_t alu8subb_val = (VAL); \
+ alu8_cr -= (unsigned)(uint8_t)alu8subb_val; \
+ alu8_vr -= (signed)(int8_t)alu8subb_val; \
} while (0)
#define ALU16_SUBB(VAL) \
do { \
- unsigned16 alu16subb_val = (VAL); \
- alu16_cr -= (unsigned)(unsigned16)alu16subb_val; \
- alu16_vr -= (signed)(signed16)alu16subb_val; \
+ uint16_t alu16subb_val = (VAL); \
+ alu16_cr -= (unsigned)(uint16_t)alu16subb_val; \
+ alu16_vr -= (signed)(int16_t)alu16subb_val; \
} while (0)
#define ALU32_SUBB(VAL) \
do { \
- unsigned32 alu32subb_val = (VAL); \
- unsigned32 alu32subb_sign = alu32subb_val ^ alu32_r; \
+ uint32_t alu32subb_val = (VAL); \
+ uint32_t alu32subb_sign = alu32subb_val ^ alu32_r; \
alu32_c = (alu32_r < alu32subb_val); \
alu32_r -= (alu32subb_val); \
- alu32_v = ((alu32subb_sign ^ - (unsigned32)alu32_c) ^ alu32_r) >> 31; \
+ alu32_v = ((alu32subb_sign ^ - (uint32_t)alu32_c) ^ alu32_r) >> 31; \
} while (0)
#define ALU64_SUBB(VAL) \
do { \
- unsigned64 alu64subb_val = (VAL); \
- unsigned64 alu64subb_sign = alu64subb_val ^ alu64_r; \
+ uint64_t alu64subb_val = (VAL); \
+ uint64_t alu64subb_sign = alu64subb_val ^ alu64_r; \
alu64_c = (alu64_r < alu64subb_val); \
alu64_r -= (alu64subb_val); \
- alu64_v = ((alu64subb_sign ^ - (unsigned64)alu64_c) ^ alu64_r) >> 31; \
+ alu64_v = ((alu64subb_sign ^ - (uint64_t)alu64_c) ^ alu64_r) >> 31; \
} while (0)
#define ALU_SUBB XCONCAT3(ALU,WITH_TARGET_WORD_BITSIZE,_SUBB)
#define ALU8_SUBB_B(VAL,B) \
do { \
- unsigned8 alu8subbb_val = (VAL); \
- unsigned8 alu8subbb_b = (B); \
- alu8_cr -= (unsigned)(unsigned8)alu8subbb_val; \
- alu8_cr -= (unsigned)(unsigned8)alu8subbb_b; \
- alu8_vr -= (signed)(signed8)alu8subbb_val + alu8subbb_b; \
+ uint8_t alu8subbb_val = (VAL); \
+ uint8_t alu8subbb_b = (B); \
+ alu8_cr -= (unsigned)(uint8_t)alu8subbb_val; \
+ alu8_cr -= (unsigned)(uint8_t)alu8subbb_b; \
+ alu8_vr -= (signed)(int8_t)alu8subbb_val + alu8subbb_b; \
} while (0)
#define ALU16_SUBB_B(VAL,B) \
do { \
- unsigned16 alu16subbb_val = (VAL); \
- unsigned16 alu16subbb_b = (B); \
- alu16_cr -= (unsigned)(unsigned16)alu16subbb_val; \
- alu16_cr -= (unsigned)(unsigned16)alu16subbb_b; \
- alu16_vr -= (signed)(signed16)alu16subbb_val + alu16subbb_b; \
+ uint16_t alu16subbb_val = (VAL); \
+ uint16_t alu16subbb_b = (B); \
+ alu16_cr -= (unsigned)(uint16_t)alu16subbb_val; \
+ alu16_cr -= (unsigned)(uint16_t)alu16subbb_b; \
+ alu16_vr -= (signed)(int16_t)alu16subbb_val + alu16subbb_b; \
} while (0)
#define ALU32_SUBB_B(VAL,B) \
do { \
- unsigned32 alu32subbb_val = (VAL); \
- unsigned32 alu32subbb_b = (B); \
+ uint32_t alu32subbb_val = (VAL); \
+ uint32_t alu32subbb_b = (B); \
ALU32_ADDC_C (~alu32subbb_val, !alu32subbb_b); \
alu32_c = !alu32_c; \
} while (0)
#define ALU64_SUBB_B(VAL,B) \
do { \
- unsigned64 alu64subbb_val = (VAL); \
- unsigned64 alu64subbb_b = (B); \
+ uint64_t alu64subbb_val = (VAL); \
+ uint64_t alu64subbb_b = (B); \
ALU64_ADDC_C (~alu64subbb_val, !alu64subbb_b); \
alu64_c = !alu64_c; \
} while (0)
#define ALU32_NEG() \
do { \
- unsigned32 alu32neg_val = (ALU32_RESULT); \
+ uint32_t alu32neg_val = (ALU32_RESULT); \
ALU32_SET (1); \
ALU32_ADDC (~alu32neg_val); \
} while(0)
#define ALU64_NEG() \
do { \
- unsigned64 alu64neg_val = (ALU64_RESULT); \
+ uint64_t alu64neg_val = (ALU64_RESULT); \
ALU64_SET (1); \
ALU64_ADDC (~alu64neg_val); \
} while (0)
#define ALU32_NEGC() \
do { \
- unsigned32 alu32negc_val = (ALU32_RESULT); \
+ uint32_t alu32negc_val = (ALU32_RESULT); \
ALU32_SET (1); \
ALU32_ADDC (~alu32negc_val); \
} while(0)
#define ALU64_NEGC() \
do { \
- unsigned64 alu64negc_val = (ALU64_RESULT); \
+ uint64_t alu64negc_val = (ALU64_RESULT); \
ALU64_SET (1); \
ALU64_ADDC (~alu64negc_val); \
} while (0)
#define ALU32_NEGB() \
do { \
- unsigned32 alu32negb_val = (ALU32_RESULT); \
+ uint32_t alu32negb_val = (ALU32_RESULT); \
ALU32_SET (0); \
ALU32_SUBB (alu32negb_val); \
} while(0)
#define ALU64_NEGB() \
do { \
- unsigned64 alu64negb_val = (ALU64_RESULT); \
+ uint64_t alu64negb_val = (ALU64_RESULT); \
ALU64_SET (0); \
ALU64_SUBB (alu64negb_val); \
} while (0)
/* LS/MS Bit operations */
-#define LSBIT8(POS) ((unsigned8) 1 << (POS))
-#define LSBIT16(POS) ((unsigned16)1 << (POS))
-#define LSBIT32(POS) ((unsigned32)1 << (POS))
-#define LSBIT64(POS) ((unsigned64)1 << (POS))
+#define LSBIT8(POS) ((uint8_t) 1 << (POS))
+#define LSBIT16(POS) ((uint16_t)1 << (POS))
+#define LSBIT32(POS) ((uint32_t)1 << (POS))
+#define LSBIT64(POS) ((uint64_t)1 << (POS))
#if (WITH_TARGET_WORD_BITSIZE == 64)
#define LSBIT(POS) LSBIT64 (POS)
#endif
#if (WITH_TARGET_WORD_BITSIZE == 32)
-#define LSBIT(POS) ((unsigned32)((POS) >= 32 \
+#define LSBIT(POS) ((uint32_t)((POS) >= 32 \
? 0 \
: (1 << ((POS) >= 32 ? 0 : (POS)))))
#endif
#if (WITH_TARGET_WORD_BITSIZE == 16)
-#define LSBIT(POS) ((unsigned16)((POS) >= 16 \
+#define LSBIT(POS) ((uint16_t)((POS) >= 16 \
? 0 \
: (1 << ((POS) >= 16 ? 0 : (POS)))))
#endif
-#define MSBIT8(POS) ((unsigned8) 1 << ( 8 - 1 - (POS)))
-#define MSBIT16(POS) ((unsigned16)1 << (16 - 1 - (POS)))
-#define MSBIT32(POS) ((unsigned32)1 << (32 - 1 - (POS)))
-#define MSBIT64(POS) ((unsigned64)1 << (64 - 1 - (POS)))
+#define MSBIT8(POS) ((uint8_t) 1 << ( 8 - 1 - (POS)))
+#define MSBIT16(POS) ((uint16_t)1 << (16 - 1 - (POS)))
+#define MSBIT32(POS) ((uint32_t)1 << (32 - 1 - (POS)))
+#define MSBIT64(POS) ((uint64_t)1 << (64 - 1 - (POS)))
#if (WITH_TARGET_WORD_BITSIZE == 64)
#define MSBIT(POS) MSBIT64 (POS)
#endif
#if (WITH_TARGET_WORD_BITSIZE == 32)
-#define MSBIT(POS) ((unsigned32)((POS) < 32 \
+#define MSBIT(POS) ((uint32_t)((POS) < 32 \
? 0 \
: (1 << ((POS) < 32 ? 0 : (64 - 1) - (POS)))))
#endif
#if (WITH_TARGET_WORD_BITSIZE == 16)
-#define MSBIT(POS) ((unsigned16)((POS) < 48 \
+#define MSBIT(POS) ((uint16_t)((POS) < 48 \
? 0 \
: (1 << ((POS) < 48 ? 0 : (64 - 1) - (POS)))))
#endif
/* multi bit mask */
/* 111111 -> mmll11 -> mm11ll */
-#define _MASKn(WIDTH, START, STOP) (((unsigned##WIDTH)(-1) \
+#define _MASKn(WIDTH, START, STOP) (((uint##WIDTH##_t)(-1) \
>> (_MSB_SHIFT (WIDTH, START) \
+ _LSB_SHIFT (WIDTH, STOP))) \
<< _LSB_SHIFT (WIDTH, STOP))
/* mask the required bits, leaving them in place */
-INLINE_SIM_BITS(unsigned8) LSMASKED8 (unsigned8 word, int first, int last);
-INLINE_SIM_BITS(unsigned16) LSMASKED16 (unsigned16 word, int first, int last);
-INLINE_SIM_BITS(unsigned32) LSMASKED32 (unsigned32 word, int first, int last);
-INLINE_SIM_BITS(unsigned64) LSMASKED64 (unsigned64 word, int first, int last);
+INLINE_SIM_BITS(uint8_t) LSMASKED8 (uint8_t word, int first, int last);
+INLINE_SIM_BITS(uint16_t) LSMASKED16 (uint16_t word, int first, int last);
+INLINE_SIM_BITS(uint32_t) LSMASKED32 (uint32_t word, int first, int last);
+INLINE_SIM_BITS(uint64_t) LSMASKED64 (uint64_t word, int first, int last);
INLINE_SIM_BITS(unsigned_word) LSMASKED (unsigned_word word, int first, int last);
-INLINE_SIM_BITS(unsigned8) MSMASKED8 (unsigned8 word, int first, int last);
-INLINE_SIM_BITS(unsigned16) MSMASKED16 (unsigned16 word, int first, int last);
-INLINE_SIM_BITS(unsigned32) MSMASKED32 (unsigned32 word, int first, int last);
-INLINE_SIM_BITS(unsigned64) MSMASKED64 (unsigned64 word, int first, int last);
+INLINE_SIM_BITS(uint8_t) MSMASKED8 (uint8_t word, int first, int last);
+INLINE_SIM_BITS(uint16_t) MSMASKED16 (uint16_t word, int first, int last);
+INLINE_SIM_BITS(uint32_t) MSMASKED32 (uint32_t word, int first, int last);
+INLINE_SIM_BITS(uint64_t) MSMASKED64 (uint64_t word, int first, int last);
INLINE_SIM_BITS(unsigned_word) MSMASKED (unsigned_word word, int first, int last);
/* extract the required bits aligning them with the lsb */
-INLINE_SIM_BITS(unsigned8) LSEXTRACTED8 (unsigned8 val, int start, int stop);
-INLINE_SIM_BITS(unsigned16) LSEXTRACTED16 (unsigned16 val, int start, int stop);
-INLINE_SIM_BITS(unsigned32) LSEXTRACTED32 (unsigned32 val, int start, int stop);
-INLINE_SIM_BITS(unsigned64) LSEXTRACTED64 (unsigned64 val, int start, int stop);
+INLINE_SIM_BITS(uint8_t) LSEXTRACTED8 (uint8_t val, int start, int stop);
+INLINE_SIM_BITS(uint16_t) LSEXTRACTED16 (uint16_t val, int start, int stop);
+INLINE_SIM_BITS(uint32_t) LSEXTRACTED32 (uint32_t val, int start, int stop);
+INLINE_SIM_BITS(uint64_t) LSEXTRACTED64 (uint64_t val, int start, int stop);
INLINE_SIM_BITS(unsigned_word) LSEXTRACTED (unsigned_word val, int start, int stop);
-INLINE_SIM_BITS(unsigned8) MSEXTRACTED8 (unsigned8 val, int start, int stop);
-INLINE_SIM_BITS(unsigned16) MSEXTRACTED16 (unsigned16 val, int start, int stop);
-INLINE_SIM_BITS(unsigned32) MSEXTRACTED32 (unsigned32 val, int start, int stop);
-INLINE_SIM_BITS(unsigned64) MSEXTRACTED64 (unsigned64 val, int start, int stop);
+INLINE_SIM_BITS(uint8_t) MSEXTRACTED8 (uint8_t val, int start, int stop);
+INLINE_SIM_BITS(uint16_t) MSEXTRACTED16 (uint16_t val, int start, int stop);
+INLINE_SIM_BITS(uint32_t) MSEXTRACTED32 (uint32_t val, int start, int stop);
+INLINE_SIM_BITS(uint64_t) MSEXTRACTED64 (uint64_t val, int start, int stop);
INLINE_SIM_BITS(unsigned_word) MSEXTRACTED (unsigned_word val, int start, int stop);
/* NB: the wierdness (N>O?N-O:0) is to stop a warning from GCC */
#define _SHUFFLEDn(N, WORD, OLD, NEW) \
((OLD) < (NEW) \
- ? (((unsigned##N)(WORD) \
+ ? (((uint##N##_t)(WORD) \
>> (((NEW) > (OLD)) ? ((NEW) - (OLD)) : 0)) \
& MASK32((NEW), (NEW))) \
- : (((unsigned##N)(WORD) \
+ : (((uint##N##_t)(WORD) \
<< (((OLD) > (NEW)) ? ((OLD) - (NEW)) : 0)) \
& MASK32((NEW), (NEW))))
/* Insert a group of bits into a bit position */
-INLINE_SIM_BITS(unsigned8) LSINSERTED8 (unsigned8 val, int start, int stop);
-INLINE_SIM_BITS(unsigned16) LSINSERTED16 (unsigned16 val, int start, int stop);
-INLINE_SIM_BITS(unsigned32) LSINSERTED32 (unsigned32 val, int start, int stop);
-INLINE_SIM_BITS(unsigned64) LSINSERTED64 (unsigned64 val, int start, int stop);
+INLINE_SIM_BITS(uint8_t) LSINSERTED8 (uint8_t val, int start, int stop);
+INLINE_SIM_BITS(uint16_t) LSINSERTED16 (uint16_t val, int start, int stop);
+INLINE_SIM_BITS(uint32_t) LSINSERTED32 (uint32_t val, int start, int stop);
+INLINE_SIM_BITS(uint64_t) LSINSERTED64 (uint64_t val, int start, int stop);
INLINE_SIM_BITS(unsigned_word) LSINSERTED (unsigned_word val, int start, int stop);
-INLINE_SIM_BITS(unsigned8) MSINSERTED8 (unsigned8 val, int start, int stop);
-INLINE_SIM_BITS(unsigned16) MSINSERTED16 (unsigned16 val, int start, int stop);
-INLINE_SIM_BITS(unsigned32) MSINSERTED32 (unsigned32 val, int start, int stop);
-INLINE_SIM_BITS(unsigned64) MSINSERTED64 (unsigned64 val, int start, int stop);
+INLINE_SIM_BITS(uint8_t) MSINSERTED8 (uint8_t val, int start, int stop);
+INLINE_SIM_BITS(uint16_t) MSINSERTED16 (uint16_t val, int start, int stop);
+INLINE_SIM_BITS(uint32_t) MSINSERTED32 (uint32_t val, int start, int stop);
+INLINE_SIM_BITS(uint64_t) MSINSERTED64 (uint64_t val, int start, int stop);
INLINE_SIM_BITS(unsigned_word) MSINSERTED (unsigned_word val, int start, int stop);
#if (WITH_TARGET_WORD_MSB == 0)
#define EXTEND4(X) (LSSEXT ((X), 3))
#define EXTEND5(X) (LSSEXT ((X), 4))
#define EXTEND6(X) (LSSEXT ((X), 5))
-#define EXTEND8(X) ((signed_word)(signed8)(X))
+#define EXTEND8(X) ((signed_word)(int8_t)(X))
#define EXTEND11(X) (LSSEXT ((X), 10))
#define EXTEND12(X) (LSSEXT ((X), 11))
#define EXTEND15(X) (LSSEXT ((X), 14))
-#define EXTEND16(X) ((signed_word)(signed16)(X))
+#define EXTEND16(X) ((signed_word)(int16_t)(X))
#define EXTEND24(X) (LSSEXT ((X), 23))
#define EXTEND25(X) (LSSEXT ((X), 24))
-#define EXTEND32(X) ((signed_word)(signed32)(X))
-#define EXTEND64(X) ((signed_word)(signed64)(X))
+#define EXTEND32(X) ((signed_word)(int32_t)(X))
+#define EXTEND64(X) ((signed_word)(int64_t)(X))
/* depending on MODE return a 64bit or 32bit (sign extended) value */
#if (WITH_TARGET_WORD_BITSIZE == 64)
-#define EXTENDED(X) ((signed64)(signed32)(X))
+#define EXTENDED(X) ((int64_t)(int32_t)(X))
#endif
#if (WITH_TARGET_WORD_BITSIZE == 32)
#define EXTENDED(X) (X)
intentionally omited. */
-INLINE_SIM_BITS(unsigned8) ROT8 (unsigned8 val, int shift);
-INLINE_SIM_BITS(unsigned16) ROT16 (unsigned16 val, int shift);
-INLINE_SIM_BITS(unsigned32) ROT32 (unsigned32 val, int shift);
-INLINE_SIM_BITS(unsigned64) ROT64 (unsigned64 val, int shift);
+INLINE_SIM_BITS(uint8_t) ROT8 (uint8_t val, int shift);
+INLINE_SIM_BITS(uint16_t) ROT16 (uint16_t val, int shift);
+INLINE_SIM_BITS(uint32_t) ROT32 (uint32_t val, int shift);
+INLINE_SIM_BITS(uint64_t) ROT64 (uint64_t val, int shift);
-INLINE_SIM_BITS(unsigned8) ROTL8 (unsigned8 val, int shift);
-INLINE_SIM_BITS(unsigned16) ROTL16 (unsigned16 val, int shift);
-INLINE_SIM_BITS(unsigned32) ROTL32 (unsigned32 val, int shift);
-INLINE_SIM_BITS(unsigned64) ROTL64 (unsigned64 val, int shift);
+INLINE_SIM_BITS(uint8_t) ROTL8 (uint8_t val, int shift);
+INLINE_SIM_BITS(uint16_t) ROTL16 (uint16_t val, int shift);
+INLINE_SIM_BITS(uint32_t) ROTL32 (uint32_t val, int shift);
+INLINE_SIM_BITS(uint64_t) ROTL64 (uint64_t val, int shift);
-INLINE_SIM_BITS(unsigned8) ROTR8 (unsigned8 val, int shift);
-INLINE_SIM_BITS(unsigned16) ROTR16 (unsigned16 val, int shift);
-INLINE_SIM_BITS(unsigned32) ROTR32 (unsigned32 val, int shift);
-INLINE_SIM_BITS(unsigned64) ROTR64 (unsigned64 val, int shift);
+INLINE_SIM_BITS(uint8_t) ROTR8 (uint8_t val, int shift);
+INLINE_SIM_BITS(uint16_t) ROTR16 (uint16_t val, int shift);
+INLINE_SIM_BITS(uint32_t) ROTR32 (uint32_t val, int shift);
+INLINE_SIM_BITS(uint64_t) ROTR64 (uint64_t val, int shift);
/* Sign extension operations */
-INLINE_SIM_BITS(unsigned8) LSSEXT8 (signed8 val, int sign_bit);
-INLINE_SIM_BITS(unsigned16) LSSEXT16 (signed16 val, int sign_bit);
-INLINE_SIM_BITS(unsigned32) LSSEXT32 (signed32 val, int sign_bit);
-INLINE_SIM_BITS(unsigned64) LSSEXT64 (signed64 val, int sign_bit);
+INLINE_SIM_BITS(uint8_t) LSSEXT8 (int8_t val, int sign_bit);
+INLINE_SIM_BITS(uint16_t) LSSEXT16 (int16_t val, int sign_bit);
+INLINE_SIM_BITS(uint32_t) LSSEXT32 (int32_t val, int sign_bit);
+INLINE_SIM_BITS(uint64_t) LSSEXT64 (int64_t val, int sign_bit);
INLINE_SIM_BITS(unsigned_word) LSSEXT (signed_word val, int sign_bit);
-INLINE_SIM_BITS(unsigned8) MSSEXT8 (signed8 val, int sign_bit);
-INLINE_SIM_BITS(unsigned16) MSSEXT16 (signed16 val, int sign_bit);
-INLINE_SIM_BITS(unsigned32) MSSEXT32 (signed32 val, int sign_bit);
-INLINE_SIM_BITS(unsigned64) MSSEXT64 (signed64 val, int sign_bit);
+INLINE_SIM_BITS(uint8_t) MSSEXT8 (int8_t val, int sign_bit);
+INLINE_SIM_BITS(uint16_t) MSSEXT16 (int16_t val, int sign_bit);
+INLINE_SIM_BITS(uint32_t) MSSEXT32 (int32_t val, int sign_bit);
+INLINE_SIM_BITS(uint64_t) MSSEXT64 (int64_t val, int sign_bit);
INLINE_SIM_BITS(unsigned_word) MSSEXT (signed_word val, int sign_bit);
#if (WITH_TARGET_WORD_MSB == 0)
{
unsigned mask = modulo - 1;
/* any zero bits */
- while (mask >= sizeof (unsigned64)) /* minimum modulo */
+ while (mask >= sizeof (uint64_t)) /* minimum modulo */
{
if ((mask & 1) == 0)
mask = 0;
else
mask >>= 1;
}
- if (mask != sizeof (unsigned64) - 1)
+ if (mask != sizeof (uint64_t) - 1)
{
#if (WITH_HW)
sim_hw_abort (sd, client, "sim_core_attach - internal error - modulo %lx not power of two", (long) modulo);
{
if (optional_buffer == NULL)
{
- int padding = (addr % sizeof (unsigned64));
+ int padding = (addr % sizeof (uint64_t));
unsigned long bytes = (modulo == 0 ? nr_bytes : modulo) + padding;
free_buffer = zalloc (bytes);
buffer = (char*) free_buffer + padding;
sim_core_translate (sim_core_mapping *mapping,
address_word addr)
{
- return (void *)((unsigned8 *) mapping->buffer
+ return (void *)((uint8_t *) mapping->buffer
+ ((addr - mapping->base) & mapping->mask));
}
void *data;
sim_event_handler *handler;
/* timer event */
- signed64 time_of_event;
+ int64_t time_of_event;
/* watch wallclock event */
unsigned wallclock;
/* watch core address */
int is_within; /* 0/1 */
unsigned ub;
unsigned lb;
- unsigned64 ub64;
- unsigned64 lb64;
+ uint64_t ub64;
+ uint64_t lb64;
/* trace info (if any) */
char *trace;
/* list */
INLINE_SIM_EVENTS\
-(signed64)
+(int64_t)
sim_events_time (SIM_DESC sd)
{
sim_events *events = STATE_EVENTS (sd);
/* Returns the time that remains before the event is raised. */
INLINE_SIM_EVENTS\
-(signed64)
+(int64_t)
sim_events_remain_time (SIM_DESC sd, sim_event *event)
{
if (event == 0)
update_time_from_event (SIM_DESC sd)
{
sim_events *events = STATE_EVENTS (sd);
- signed64 current_time = sim_events_time (sd);
+ int64_t current_time = sim_events_time (sd);
if (events->queue != NULL)
{
events->time_of_event = events->queue->time_of_event;
static void
insert_sim_event (SIM_DESC sd,
sim_event *new_event,
- signed64 delta)
+ int64_t delta)
{
sim_events *events = STATE_EVENTS (sd);
sim_event *curr;
sim_event **prev;
- signed64 time_of_event;
+ int64_t time_of_event;
if (delta < 0)
sim_io_error (sd, "what is past is past!\n");
#if EXTERN_SIM_EVENTS_P
sim_event *
sim_events_schedule (SIM_DESC sd,
- signed64 delta_time,
+ int64_t delta_time,
sim_event_handler *handler,
void *data)
{
#if EXTERN_SIM_EVENTS_P
sim_event *
sim_events_schedule_tracef (SIM_DESC sd,
- signed64 delta_time,
+ int64_t delta_time,
sim_event_handler *handler,
void *data,
const char *fmt,
#if EXTERN_SIM_EVENTS_P
sim_event *
sim_events_schedule_vtracef (SIM_DESC sd,
- signed64 delta_time,
+ int64_t delta_time,
sim_event_handler *handler,
void *data,
const char *fmt,
#if EXTERN_SIM_EVENTS_P
void
sim_events_schedule_after_signal (SIM_DESC sd,
- signed64 delta_time,
+ int64_t delta_time,
sim_event_handler *handler,
void *data)
{
sim_event *
sim_events_watch_pc (SIM_DESC sd,
int is_within,
- unsigned64 lb,
- unsigned64 ub,
+ uint64_t lb,
+ uint64_t ub,
sim_event_handler *handler,
void *data)
{
int nr_bytes,
enum bfd_endian byte_order,
int is_within,
- unsigned64 lb,
- unsigned64 ub,
+ uint64_t lb,
+ uint64_t ub,
sim_event_handler *handler,
void *data)
{
int nr_bytes,
enum bfd_endian byte_order,
int is_within,
- unsigned64 lb,
- unsigned64 ub,
+ uint64_t lb,
+ uint64_t ub,
sim_event_handler *handler,
void *data)
{
sim_events_process (SIM_DESC sd)
{
sim_events *events = STATE_EVENTS (sd);
- signed64 event_time = sim_events_time (sd);
+ int64_t event_time = sim_events_time (sd);
/* Clear work_pending before checking nr_held. Clearing
work_pending after nr_held (with out a lock could loose an
/* timekeeping */
unsigned long elapsed_wallclock;
SIM_ELAPSED_TIME resume_wallclock;
- signed64 time_of_event;
- signed64 time_from_event;
+ int64_t time_of_event;
+ int64_t time_from_event;
};
extern sim_event *sim_events_schedule
(SIM_DESC sd,
- signed64 delta_time,
+ int64_t delta_time,
sim_event_handler *handler,
void *data);
extern sim_event *sim_events_schedule_tracef
(SIM_DESC sd,
- signed64 delta_time,
+ int64_t delta_time,
sim_event_handler *handler,
void *data,
const char *fmt,
extern sim_event *sim_events_schedule_vtracef
(SIM_DESC sd,
- signed64 delta_time,
+ int64_t delta_time,
sim_event_handler *handler,
void *data,
const char *fmt,
extern void sim_events_schedule_after_signal
(SIM_DESC sd,
- signed64 delta_time,
+ int64_t delta_time,
sim_event_handler *handler,
void *data);
extern sim_event *sim_events_watch_pc
(SIM_DESC sd,
int is_within,
- unsigned64 lb,
- unsigned64 ub,
+ uint64_t lb,
+ uint64_t ub,
sim_event_handler *handler,
void *data);
int nr_bytes,
enum bfd_endian byte_order,
int is_within,
- unsigned64 lb,
- unsigned64 ub,
+ uint64_t lb,
+ uint64_t ub,
sim_event_handler *handler,
void *data);
int nr_bytes,
enum bfd_endian byte_order,
int is_within,
- unsigned64 lb,
- unsigned64 ub,
+ uint64_t lb,
+ uint64_t ub,
sim_event_handler *handler,
void *data);
/* local concept of elapsed target time */
INLINE_SIM_EVENTS\
-(signed64) sim_events_time
+(int64_t) sim_events_time
(SIM_DESC sd);
/* Returns the time that remains before the event is raised. */
INLINE_SIM_EVENTS\
-(signed64) sim_events_remain_time
+(int64_t) sim_events_remain_time
(SIM_DESC sd, sim_event *event);
If digits is -1, then print all digits. */
static void
-print_bits (unsigned64 x,
+print_bits (uint64_t x,
int msbit,
int digits,
sim_fpu_print_func print,
void *arg)
{
- unsigned64 bit = LSBIT64 (msbit);
+ uint64_t bit = LSBIT64 (msbit);
int i = 4;
while (bit && digits)
{
typedef union
{
double d;
- unsigned64 i;
+ uint64_t i;
} sim_fpu_map;
/* Integer constants */
-#define MAX_INT32 ((signed64) LSMASK64 (30, 0))
+#define MAX_INT32 ((int64_t) LSMASK64 (30, 0))
#define MAX_UINT32 LSMASK64 (31, 0)
-#define MIN_INT32 ((signed64) LSMASK64 (63, 31))
+#define MIN_INT32 ((int64_t) LSMASK64 (63, 31))
-#define MAX_INT64 ((signed64) LSMASK64 (62, 0))
+#define MAX_INT64 ((int64_t) LSMASK64 (62, 0))
#define MAX_UINT64 LSMASK64 (63, 0)
-#define MIN_INT64 ((signed64) LSMASK64 (63, 63))
+#define MIN_INT64 ((int64_t) LSMASK64 (63, 63))
#define MAX_INT (is_64bit ? MAX_INT64 : MAX_INT32)
#define MIN_INT (is_64bit ? MIN_INT64 : MIN_INT32)
#define NR_INTBITS (is_64bit ? 64 : 32)
/* Squeeze an unpacked sim_fpu struct into a 32/64 bit integer. */
-STATIC_INLINE_SIM_FPU (unsigned64)
+STATIC_INLINE_SIM_FPU (uint64_t)
pack_fpu (const sim_fpu *src,
int is_double)
{
int sign;
- unsigned64 exp;
- unsigned64 fraction;
- unsigned64 packed;
+ uint64_t exp;
+ uint64_t fraction;
+ uint64_t packed;
switch (src->class)
{
/* Unpack a 32/64 bit integer into a sim_fpu structure. */
STATIC_INLINE_SIM_FPU (void)
-unpack_fpu (sim_fpu *dst, unsigned64 packed, int is_double)
+unpack_fpu (sim_fpu *dst, uint64_t packed, int is_double)
{
- unsigned64 fraction = LSMASKED64 (packed, NR_FRACBITS - 1, 0);
+ uint64_t fraction = LSMASKED64 (packed, NR_FRACBITS - 1, 0);
unsigned exp = LSEXTRACTED64 (packed, NR_EXPBITS + NR_FRACBITS - 1, NR_FRACBITS);
int sign = (packed & SIGNBIT) != 0;
}
else
{
- unsigned32 val = pack_fpu (dst, 0);
- unsigned32 org = packed;
+ uint32_t val = pack_fpu (dst, 0);
+ uint32_t org = packed;
ASSERT (val == org);
}
}
/* Convert a floating point into an integer. */
STATIC_INLINE_SIM_FPU (int)
-fpu2i (signed64 *i,
+fpu2i (int64_t *i,
const sim_fpu *s,
int is_64bit,
sim_fpu_round round)
{
- unsigned64 tmp;
+ uint64_t tmp;
int shift;
int status = 0;
if (sim_fpu_is_zero (s))
/* Convert an integer into a floating point. */
STATIC_INLINE_SIM_FPU (int)
-i2fpu (sim_fpu *f, signed64 i, int is_64bit)
+i2fpu (sim_fpu *f, int64_t i, int is_64bit)
{
int status = 0;
if (i == 0)
/* sanity check */
{
- signed64 val;
+ int64_t val;
fpu2i (&val, f, is_64bit, sim_fpu_round_zero);
if (i >= MIN_INT32 && i <= MAX_INT32)
{
/* Convert a floating point into an integer. */
STATIC_INLINE_SIM_FPU (int)
-fpu2u (unsigned64 *u, const sim_fpu *s, int is_64bit)
+fpu2u (uint64_t *u, const sim_fpu *s, int is_64bit)
{
const int is_double = 1;
- unsigned64 tmp;
+ uint64_t tmp;
int shift;
if (sim_fpu_is_zero (s))
{
/* Convert an unsigned integer into a floating point. */
STATIC_INLINE_SIM_FPU (int)
-u2fpu (sim_fpu *f, unsigned64 u, int is_64bit)
+u2fpu (sim_fpu *f, uint64_t u, int is_64bit)
{
if (u == 0)
{
/* register <-> sim_fpu */
INLINE_SIM_FPU (void)
-sim_fpu_32to (sim_fpu *f, unsigned32 s)
+sim_fpu_32to (sim_fpu *f, uint32_t s)
{
unpack_fpu (f, s, 0);
}
INLINE_SIM_FPU (void)
-sim_fpu_232to (sim_fpu *f, unsigned32 h, unsigned32 l)
+sim_fpu_232to (sim_fpu *f, uint32_t h, uint32_t l)
{
- unsigned64 s = h;
+ uint64_t s = h;
s = (s << 32) | l;
unpack_fpu (f, s, 1);
}
INLINE_SIM_FPU (void)
-sim_fpu_64to (sim_fpu *f, unsigned64 s)
+sim_fpu_64to (sim_fpu *f, uint64_t s)
{
unpack_fpu (f, s, 1);
}
INLINE_SIM_FPU (void)
-sim_fpu_to32 (unsigned32 *s,
+sim_fpu_to32 (uint32_t *s,
const sim_fpu *f)
{
*s = pack_fpu (f, 0);
INLINE_SIM_FPU (void)
-sim_fpu_to232 (unsigned32 *h, unsigned32 *l,
+sim_fpu_to232 (uint32_t *h, uint32_t *l,
const sim_fpu *f)
{
- unsigned64 s = pack_fpu (f, 1);
+ uint64_t s = pack_fpu (f, 1);
*l = s;
*h = (s >> 32);
}
INLINE_SIM_FPU (void)
-sim_fpu_to64 (unsigned64 *u,
+sim_fpu_to64 (uint64_t *u,
const sim_fpu *f)
{
*u = pack_fpu (f, 1);
sim_fpu_fractionto (sim_fpu *f,
int sign,
int normal_exp,
- unsigned64 fraction,
+ uint64_t fraction,
int precision)
{
int shift = (NR_FRAC_GUARD - precision);
}
-INLINE_SIM_FPU (unsigned64)
+INLINE_SIM_FPU (uint64_t)
sim_fpu_tofraction (const sim_fpu *d,
int precision)
{
/* We have NR_FRAC_GUARD bits, we want only PRECISION bits. */
int shift = (NR_FRAC_GUARD - precision);
- unsigned64 fraction = (d->fraction & ~IMPLICIT_1);
+ uint64_t fraction = (d->fraction & ~IMPLICIT_1);
if (shift >= 0)
return fraction >> shift;
else
int nr_guards,
sim_fpu_round round)
{
- unsigned64 guardmask = LSMASK64 (nr_guards - 1, 0);
- unsigned64 guardmsb = LSBIT64 (nr_guards - 1);
- unsigned64 fraclsb = guardmsb << 1;
+ uint64_t guardmask = LSMASK64 (nr_guards - 1, 0);
+ uint64_t guardmsb = LSBIT64 (nr_guards - 1);
+ uint64_t fraclsb = guardmsb << 1;
if ((f->fraction & guardmask))
{
int status = sim_fpu_status_inexact;
{
int status = 0;
int shift = l->normal_exp - r->normal_exp;
- unsigned64 lfraction;
- unsigned64 rfraction;
+ uint64_t lfraction;
+ uint64_t rfraction;
/* use exp of larger */
if (shift >= NR_FRAC_GUARD)
{
/* sign? */
f->class = sim_fpu_class_number;
- if (((signed64) f->fraction) >= 0)
+ if (((int64_t) f->fraction) >= 0)
f->sign = 0;
else
{
{
int status = 0;
int shift = l->normal_exp - r->normal_exp;
- unsigned64 lfraction;
- unsigned64 rfraction;
+ uint64_t lfraction;
+ uint64_t rfraction;
/* use exp of larger */
if (shift >= NR_FRAC_GUARD)
{
/* sign? */
f->class = sim_fpu_class_number;
- if (((signed64) f->fraction) >= 0)
+ if (((int64_t) f->fraction) >= 0)
f->sign = 0;
else
{
/* Calculate the mantissa by multiplying both 64bit numbers to get a
128 bit number. */
{
- unsigned64 low;
- unsigned64 high;
- unsigned64 nl = l->fraction & 0xffffffff;
- unsigned64 nh = l->fraction >> 32;
- unsigned64 ml = r->fraction & 0xffffffff;
- unsigned64 mh = r->fraction >>32;
- unsigned64 pp_ll = ml * nl;
- unsigned64 pp_hl = mh * nl;
- unsigned64 pp_lh = ml * nh;
- unsigned64 pp_hh = mh * nh;
- unsigned64 res2 = 0;
- unsigned64 res0 = 0;
- unsigned64 ps_hh__ = pp_hl + pp_lh;
+ uint64_t low;
+ uint64_t high;
+ uint64_t nl = l->fraction & 0xffffffff;
+ uint64_t nh = l->fraction >> 32;
+ uint64_t ml = r->fraction & 0xffffffff;
+ uint64_t mh = r->fraction >>32;
+ uint64_t pp_ll = ml * nl;
+ uint64_t pp_hl = mh * nl;
+ uint64_t pp_lh = ml * nh;
+ uint64_t pp_hh = mh * nh;
+ uint64_t res2 = 0;
+ uint64_t res0 = 0;
+ uint64_t ps_hh__ = pp_hl + pp_lh;
if (ps_hh__ < pp_hl)
res2 += UNSIGNED64 (0x100000000);
pp_hl = (ps_hh__ << 32) & UNSIGNED64 (0xffffffff00000000);
/* quotient = ( ( numerator / denominator)
x 2^(numerator exponent - denominator exponent)
*/
- unsigned64 numerator;
- unsigned64 denominator;
- unsigned64 quotient;
- unsigned64 bit;
+ uint64_t numerator;
+ uint64_t denominator;
+ uint64_t quotient;
+ uint64_t bit;
f->class = sim_fpu_class_number;
f->sign = l->sign ^ r->sign;
{
/* Generate sqrt(x) bit by bit. */
- unsigned64 y;
- unsigned64 q;
- unsigned64 s;
- unsigned64 b;
+ uint64_t y;
+ uint64_t q;
+ uint64_t s;
+ uint64_t b;
f->class = sim_fpu_class_number;
f->sign = 0;
while (b)
{
- unsigned64 t = s + b;
+ uint64_t t = s + b;
if (t <= y)
{
s |= (b << 1);
INLINE_SIM_FPU (int)
sim_fpu_i32to (sim_fpu *f,
- signed32 i,
+ int32_t i,
sim_fpu_round round)
{
i2fpu (f, i, 0);
INLINE_SIM_FPU (int)
sim_fpu_u32to (sim_fpu *f,
- unsigned32 u,
+ uint32_t u,
sim_fpu_round round)
{
u2fpu (f, u, 0);
INLINE_SIM_FPU (int)
sim_fpu_i64to (sim_fpu *f,
- signed64 i,
+ int64_t i,
sim_fpu_round round)
{
i2fpu (f, i, 1);
INLINE_SIM_FPU (int)
sim_fpu_u64to (sim_fpu *f,
- unsigned64 u,
+ uint64_t u,
sim_fpu_round round)
{
u2fpu (f, u, 1);
INLINE_SIM_FPU (int)
-sim_fpu_to32i (signed32 *i,
+sim_fpu_to32i (int32_t *i,
const sim_fpu *f,
sim_fpu_round round)
{
- signed64 i64;
+ int64_t i64;
int status = fpu2i (&i64, f, 0, round);
*i = i64;
return status;
}
INLINE_SIM_FPU (int)
-sim_fpu_to32u (unsigned32 *u,
+sim_fpu_to32u (uint32_t *u,
const sim_fpu *f,
sim_fpu_round round)
{
- unsigned64 u64;
+ uint64_t u64;
int status = fpu2u (&u64, f, 0);
*u = u64;
return status;
}
INLINE_SIM_FPU (int)
-sim_fpu_to64i (signed64 *i,
+sim_fpu_to64i (int64_t *i,
const sim_fpu *f,
sim_fpu_round round)
{
INLINE_SIM_FPU (int)
-sim_fpu_to64u (unsigned64 *u,
+sim_fpu_to64u (uint64_t *u,
const sim_fpu *f,
sim_fpu_round round)
{
}
-INLINE_SIM_FPU (unsigned64)
+INLINE_SIM_FPU (uint64_t)
sim_fpu_fraction (const sim_fpu *d)
{
return d->fraction;
}
-INLINE_SIM_FPU (unsigned64)
+INLINE_SIM_FPU (uint64_t)
sim_fpu_guard (const sim_fpu *d, int is_double)
{
- unsigned64 rv;
- unsigned64 guardmask = LSMASK64 (NR_GUARDS - 1, 0);
+ uint64_t rv;
+ uint64_t guardmask = LSMASK64 (NR_GUARDS - 1, 0);
rv = (d->fraction & guardmask) >> NR_PAD;
return rv;
}
typedef struct _sim_fpu {
sim_fpu_class class;
int sign;
- unsigned64 fraction;
+ uint64_t fraction;
int normal_exp;
} sim_fpu;
emulating exact FPU behavior, sim_fpu_round_{32,64} should be
called before packing the sim_fpu value. */
-INLINE_SIM_FPU (void) sim_fpu_32to (sim_fpu *f, unsigned32 s);
-INLINE_SIM_FPU (void) sim_fpu_232to (sim_fpu *f, unsigned32 h, unsigned32 l);
-INLINE_SIM_FPU (void) sim_fpu_64to (sim_fpu *f, unsigned64 d);
+INLINE_SIM_FPU (void) sim_fpu_32to (sim_fpu *f, uint32_t s);
+INLINE_SIM_FPU (void) sim_fpu_232to (sim_fpu *f, uint32_t h, uint32_t l);
+INLINE_SIM_FPU (void) sim_fpu_64to (sim_fpu *f, uint64_t d);
-INLINE_SIM_FPU (void) sim_fpu_to32 (unsigned32 *s, const sim_fpu *f);
-INLINE_SIM_FPU (void) sim_fpu_to232 (unsigned32 *h, unsigned32 *l, const sim_fpu *f);
-INLINE_SIM_FPU (void) sim_fpu_to64 (unsigned64 *d, const sim_fpu *f);
+INLINE_SIM_FPU (void) sim_fpu_to32 (uint32_t *s, const sim_fpu *f);
+INLINE_SIM_FPU (void) sim_fpu_to232 (uint32_t *h, uint32_t *l, const sim_fpu *f);
+INLINE_SIM_FPU (void) sim_fpu_to64 (uint64_t *d, const sim_fpu *f);
/* Create a sim_fpu struct using raw information. (FRACTION & LSMASK
You can not specify zero using this function. */
-INLINE_SIM_FPU (void) sim_fpu_fractionto (sim_fpu *f, int sign, int normal_exp, unsigned64 fraction, int precision);
+INLINE_SIM_FPU (void) sim_fpu_fractionto (sim_fpu *f, int sign, int normal_exp, uint64_t fraction, int precision);
/* Reverse operation. If S is a non-zero number, discards the implied
leading one and returns PRECISION fraction bits. No rounding is
performed. */
-INLINE_SIM_FPU (unsigned64) sim_fpu_tofraction (const sim_fpu *s, int precision);
+INLINE_SIM_FPU (uint64_t) sim_fpu_tofraction (const sim_fpu *s, int precision);
/* Conversion of integer <-> floating point. */
-INLINE_SIM_FPU (int) sim_fpu_i32to (sim_fpu *f, signed32 i,
+INLINE_SIM_FPU (int) sim_fpu_i32to (sim_fpu *f, int32_t i,
sim_fpu_round round);
-INLINE_SIM_FPU (int) sim_fpu_u32to (sim_fpu *f, unsigned32 u,
+INLINE_SIM_FPU (int) sim_fpu_u32to (sim_fpu *f, uint32_t u,
sim_fpu_round round);
-INLINE_SIM_FPU (int) sim_fpu_i64to (sim_fpu *f, signed64 i,
+INLINE_SIM_FPU (int) sim_fpu_i64to (sim_fpu *f, int64_t i,
sim_fpu_round round);
-INLINE_SIM_FPU (int) sim_fpu_u64to (sim_fpu *f, unsigned64 u,
+INLINE_SIM_FPU (int) sim_fpu_u64to (sim_fpu *f, uint64_t u,
sim_fpu_round round);
#if 0
-INLINE_SIM_FPU (int) sim_fpu_i232to (sim_fpu *f, signed32 h, signed32 l,
+INLINE_SIM_FPU (int) sim_fpu_i232to (sim_fpu *f, int32_t h, int32_t l,
sim_fpu_round round);
#endif
#if 0
-INLINE_SIM_FPU (int) sim_fpu_u232to (sim_fpu *f, unsigned32 h, unsigned32 l,
+INLINE_SIM_FPU (int) sim_fpu_u232to (sim_fpu *f, uint32_t h, uint32_t l,
sim_fpu_round round);
#endif
-INLINE_SIM_FPU (int) sim_fpu_to32i (signed32 *i, const sim_fpu *f,
+INLINE_SIM_FPU (int) sim_fpu_to32i (int32_t *i, const sim_fpu *f,
sim_fpu_round round);
-INLINE_SIM_FPU (int) sim_fpu_to32u (unsigned32 *u, const sim_fpu *f,
+INLINE_SIM_FPU (int) sim_fpu_to32u (uint32_t *u, const sim_fpu *f,
sim_fpu_round round);
-INLINE_SIM_FPU (int) sim_fpu_to64i (signed64 *i, const sim_fpu *f,
+INLINE_SIM_FPU (int) sim_fpu_to64i (int64_t *i, const sim_fpu *f,
sim_fpu_round round);
-INLINE_SIM_FPU (int) sim_fpu_to64u (unsigned64 *u, const sim_fpu *f,
+INLINE_SIM_FPU (int) sim_fpu_to64u (uint64_t *u, const sim_fpu *f,
sim_fpu_round round);
#if 0
-INLINE_SIM_FPU (int) sim_fpu_to232i (signed64 *h, signed64 *l, const sim_fpu *f,
+INLINE_SIM_FPU (int) sim_fpu_to232i (int64_t *h, int64_t *l, const sim_fpu *f,
sim_fpu_round round);
#endif
#if 0
-INLINE_SIM_FPU (int) sim_fpu_to232u (unsigned64 *h, unsigned64 *l, const sim_fpu *f,
+INLINE_SIM_FPU (int) sim_fpu_to232u (uint64_t *h, uint64_t *l, const sim_fpu *f,
sim_fpu_round round);
#endif
INLINE_SIM_FPU (int) sim_fpu_sign (const sim_fpu *s);
INLINE_SIM_FPU (int) sim_fpu_exp (const sim_fpu *s);
-INLINE_SIM_FPU (unsigned64) sim_fpu_fraction (const sim_fpu *s);
-INLINE_SIM_FPU (unsigned64) sim_fpu_guard (const sim_fpu *s, int is_double);
+INLINE_SIM_FPU (uint64_t) sim_fpu_fraction (const sim_fpu *s);
+INLINE_SIM_FPU (uint64_t) sim_fpu_guard (const sim_fpu *s, int is_double);
#include "sim-options.h"
/* Memory fill byte. */
-static unsigned8 fill_byte_value;
+static uint8_t fill_byte_value;
static int fill_byte_flag = 0;
/* Memory mapping; see OPTION_MEMORY_MAPFILE. */
{
/* Allocate new well-aligned buffer, just as sim_core_attach(). */
void *aligned_buffer;
- int padding = (addr % sizeof (unsigned64));
+ int padding = (addr % sizeof (uint64_t));
unsigned long bytes;
#ifdef HAVE_MMAP
case OPTION_MEMORY_CLEAR:
{
- fill_byte_value = (unsigned8) 0;
+ fill_byte_value = (uint8_t) 0;
fill_byte_flag = 1;
return SIM_RC_OK;
break;
sim_io_eprintf (sd, "Missing fill value between 0 and 255\n");
return SIM_RC_FAIL;
}
- fill_byte_value = (unsigned8) fill_value;
+ fill_byte_value = (uint8_t) fill_value;
fill_byte_flag = 1;
return SIM_RC_OK;
break;
#endif
/* NOTE: See end of file for #undef */
-#define unsignedN XCONCAT2(unsigned,N)
-#define signedN XCONCAT2(signed,N)
+#define unsignedN XCONCAT3(uint,N,_t)
+#define signedN XCONCAT3(int,N,_t)
#define LSMASKn XCONCAT2(LSMASK,N)
#define MSMASKn XCONCAT2(MSMASK,N)
#define LSMASKEDn XCONCAT2(LSMASKED,N)
{
int ok;
/* FIXME: what if the target has a 64 bit PC? */
- unsigned32 header[3];
+ uint32_t header[3];
unsigned loop;
if (PROFILE_PC_END (profile) != 0)
{
ok && (loop < PROFILE_PC_NR_BUCKETS (profile));
loop++)
{
- signed16 sample;
+ int16_t sample;
if (PROFILE_PC_COUNT (profile) [loop] >= 0xffff)
sample = 0xffff;
else
{
switch (size)
{
- case sizeof (unsigned32):
- trace_printf (sd, cpu, " 0x%08lx", (long) * (unsigned32*) data);
+ case sizeof (uint32_t):
+ trace_printf (sd, cpu, " 0x%08lx", (long) * (uint32_t*) data);
break;
- case sizeof (unsigned64):
+ case sizeof (uint64_t):
trace_printf (sd, cpu, " 0x%08lx%08lx",
- (long) ((* (unsigned64*) data) >> 32),
- (long) * (unsigned64*) data);
+ (long) ((* (uint64_t*) data) >> 32),
+ (long) * (uint64_t*) data);
break;
default:
abort ();
{
/* FIXME: Assumes sizeof float == 4; sizeof double == 8 */
case 4:
- sim_fpu_32to (&fp, *(unsigned32*)data);
+ sim_fpu_32to (&fp, *(uint32_t*)data);
break;
case 8:
- sim_fpu_64to (&fp, *(unsigned64*)data);
+ sim_fpu_64to (&fp, *(uint64_t*)data);
break;
default:
abort ();
{
case 4:
trace_printf (sd, cpu, " (0x%08lx)",
- (long) *(unsigned32*)data);
+ (long) *(uint32_t*)data);
break;
case 8:
trace_printf (sd, cpu, " (0x%08lx%08lx)",
- (long) (*(unsigned64*)data >> 32),
- (long) (*(unsigned64*)data));
+ (long) (*(uint64_t*)data >> 32),
+ (long) (*(uint64_t*)data));
break;
default:
abort ();
/* Buffer to save the inputs for the current instruction. Use a
union to force the buffer into correct alignment */
union {
- unsigned8 i8;
- unsigned16 i16;
- unsigned32 i32;
- unsigned64 i64;
+ uint8_t i8;
+ uint16_t i16;
+ uint32_t i32;
+ uint64_t i64;
} trace_input_data[16];
- unsigned8 trace_input_fmt[16];
- unsigned8 trace_input_size[16];
+ uint8_t trace_input_fmt[16];
+ uint8_t trace_input_size[16];
int trace_input_idx;
#define TRACE_INPUT_DATA(t) ((t)->trace_input_data)
#define TRACE_INPUT_FMT(t) ((t)->trace_input_fmt)
TYPES:
- signed* signed type of the given size
- unsigned* The corresponding insigned type
+ intNN_t Signed type of the given bit size
+ uintNN_t The corresponding unsigned type
+
+ signed128 Non-standard type for 128-bit integers.
+ unsigned128 Likewise, but unsigned.
SIZES
# define SIGNED32(X) (X##i32)
# define SIGNED64(X) (X##i64)
#else
-# define UNSIGNED32(X) ((unsigned32) X##UL)
-# define UNSIGNED64(X) ((unsigned64) X##ULL)
-# define SIGNED32(X) ((signed32) X##L)
-# define SIGNED64(X) ((signed64) X##LL)
+# define UNSIGNED32(X) ((uint32_t) X##UL)
+# define UNSIGNED64(X) ((uint64_t) X##ULL)
+# define SIGNED32(X) ((int32_t) X##L)
+# define SIGNED64(X) ((int64_t) X##LL)
#endif
-typedef int8_t signed8;
-typedef int16_t signed16;
-typedef int32_t signed32;
-typedef int64_t signed64;
-
-typedef uint8_t unsigned8;
-typedef uint16_t unsigned16;
-typedef uint32_t unsigned32;
-typedef uint64_t unsigned64;
-
-typedef struct { unsigned64 a[2]; } unsigned128;
-typedef struct { signed64 a[2]; } signed128;
+typedef struct { uint64_t a[2]; } unsigned128;
+typedef struct { int64_t a[2]; } signed128;
/* byte based */
-typedef signed8 signed_1;
-typedef signed16 signed_2;
-typedef signed32 signed_4;
-typedef signed64 signed_8;
+typedef int8_t signed_1;
+typedef int16_t signed_2;
+typedef int32_t signed_4;
+typedef int64_t signed_8;
typedef signed128 signed_16;
-typedef unsigned8 unsigned_1;
-typedef unsigned16 unsigned_2;
-typedef unsigned32 unsigned_4;
-typedef unsigned64 unsigned_8;
+typedef uint8_t unsigned_1;
+typedef uint16_t unsigned_2;
+typedef uint32_t unsigned_4;
+typedef uint64_t unsigned_8;
typedef unsigned128 unsigned_16;
/* target architecture based */
#if (WITH_TARGET_WORD_BITSIZE == 64)
-typedef unsigned64 unsigned_word;
-typedef signed64 signed_word;
+typedef uint64_t unsigned_word;
+typedef int64_t signed_word;
#endif
#if (WITH_TARGET_WORD_BITSIZE == 32)
-typedef unsigned32 unsigned_word;
-typedef signed32 signed_word;
+typedef uint32_t unsigned_word;
+typedef int32_t signed_word;
#endif
#if (WITH_TARGET_WORD_BITSIZE == 16)
-typedef unsigned16 unsigned_word;
-typedef signed16 signed_word;
+typedef uint16_t unsigned_word;
+typedef int16_t signed_word;
#endif
#define PRI_TW(t) SIM_PRI_TB (t, WITH_TARGET_WORD_BITSIZE)
/* Other instructions */
#if (WITH_TARGET_ADDRESS_BITSIZE == 64)
-typedef unsigned64 unsigned_address;
-typedef signed64 signed_address;
+typedef uint64_t unsigned_address;
+typedef int64_t signed_address;
#endif
#if (WITH_TARGET_ADDRESS_BITSIZE == 32)
-typedef unsigned32 unsigned_address;
-typedef signed32 signed_address;
+typedef uint32_t unsigned_address;
+typedef int32_t signed_address;
#endif
#if (WITH_TARGET_ADDRESS_BITSIZE == 16)
-typedef unsigned16 unsigned_address;
-typedef signed16 signed_address;
+typedef uint16_t unsigned_address;
+typedef int16_t signed_address;
#endif
typedef unsigned_address address_word;
/* IEEE 1275 cell size */
#if (WITH_TARGET_CELL_BITSIZE == 64)
-typedef unsigned64 unsigned_cell;
-typedef signed64 signed_cell;
+typedef uint64_t unsigned_cell;
+typedef int64_t signed_cell;
#endif
#if (WITH_TARGET_CELL_BITSIZE == 32)
-typedef unsigned32 unsigned_cell;
-typedef signed32 signed_cell;
+typedef uint32_t unsigned_cell;
+typedef int32_t signed_cell;
#endif
typedef signed_cell cell_word; /* cells are normally signed */
/* Floating point registers */
#if (WITH_TARGET_FLOATING_POINT_BITSIZE == 64)
-typedef unsigned64 fp_word;
+typedef uint64_t fp_word;
#endif
#if (WITH_TARGET_FLOATING_POINT_BITSIZE == 32)
-typedef unsigned32 fp_word;
+typedef uint32_t fp_word;
#endif
#define PRI_TF(t) SIM_PRI_TB (t, WITH_TARGET_FLOATING_POINT_BITSIZE)