sim: ppc: drop natural types

These are almost entirely unused.  For the very few places using them,
replace with explicit signed types.  This matches what was done in the
common sim code.
This commit is contained in:
Mike Frysinger 2021-12-06 02:39:42 -05:00
parent d3eb0aa287
commit 03b46de590
4 changed files with 10 additions and 31 deletions

View File

@ -89,7 +89,7 @@
/* MakeBit */
#define _BITn(WIDTH, pos) (((natural##WIDTH)(1)) \
#define _BITn(WIDTH, pos) (((uint##WIDTH##_t)(1)) \
<< _MAKE_SHIFT(WIDTH, pos))
#define BIT4(POS) (1 << _MAKE_SHIFT(4, POS))
@ -177,7 +177,7 @@ INLINE_BITS\
/* extract the required bits aligning them with the lsb */
#define _EXTRACTEDn(WIDTH, WORD, START, STOP) \
((((natural##WIDTH)(WORD)) >> (WIDTH - (STOP) - 1)) \
((((uint##WIDTH##_t)(WORD)) >> (WIDTH - (STOP) - 1)) \
& _MASKn(WIDTH, WIDTH-1+(START)-(STOP), WIDTH-1))
/* #define EXTRACTED10(WORD, START, STOP) _EXTRACTEDn(10, WORD, START, STOP) */
@ -215,7 +215,7 @@ INLINE_BITS\
/* move a group of bits around */
#define _INSERTEDn(N, WORD, START, STOP) \
(((natural##N)(WORD) << _MAKE_SHIFT(N, STOP)) & _MASKn(N, START, STOP))
(((uint##N##_t)(WORD) << _MAKE_SHIFT(N, STOP)) & _MASKn(N, START, STOP))
#define INSERTED32(WORD, START, STOP) _INSERTEDn(32, WORD, START, STOP)
#define INSERTED64(WORD, START, STOP) _INSERTEDn(64, WORD, START, STOP)

View File

@ -631,7 +631,7 @@ do_sigprocmask(os_emul_data *emul,
cpu *processor,
unsigned_word cia)
{
natural_word how = cpu_registers(processor)->gpr[arg0];
signed_word how = cpu_registers(processor)->gpr[arg0];
unsigned_word set = cpu_registers(processor)->gpr[arg0+1];
unsigned_word oset = cpu_registers(processor)->gpr[arg0+2];
#ifdef SYS_sigprocmask
@ -1010,12 +1010,12 @@ do___sysctl(os_emul_data *emul,
{
/* call the arguments by their real name */
unsigned_word name = cpu_registers(processor)->gpr[arg0];
natural_word namelen = cpu_registers(processor)->gpr[arg0+1];
signed_word namelen = cpu_registers(processor)->gpr[arg0+1];
unsigned_word oldp = cpu_registers(processor)->gpr[arg0+2];
unsigned_word oldlenp = cpu_registers(processor)->gpr[arg0+3];
natural_word oldlen;
natural_word mib;
natural_word int_val;
signed_word oldlen;
signed_word mib;
signed_word int_val;
SYS(__sysctl);
/* pluck out the management information base id */
@ -1049,7 +1049,7 @@ do___sysctl(os_emul_data *emul,
oldlenp,
processor,
cia);
if (sizeof(natural_word) > oldlen)
if (sizeof(signed_word) > oldlen)
error("system_call()sysctl - CTL_HW.HW_PAGESIZE - to small\n");
int_val = 8192;
oldlen = sizeof(int_val);

View File

@ -65,7 +65,7 @@
#define ALU_BEGIN(val) \
{ \
natural_word alu_val; \
signed_word alu_val; \
unsigned64 alu_carry_val; \
signed64 alu_overflow_val; \
ALU_SET(val)

View File

@ -27,7 +27,6 @@
/* TYPES:
natural* sign determined by host
signed* signed type of the given size
unsigned* The corresponding insigned type
@ -49,18 +48,6 @@
#include <stdint.h>
/* bit based */
typedef char natural8;
typedef short natural16;
typedef int natural32;
#ifdef __GNUC__
typedef long long natural64;
#endif
#ifdef _MSC_VER
typedef __int64 natural64;
#endif
typedef int8_t signed8;
typedef int16_t signed16;
typedef int32_t signed32;
@ -72,11 +59,6 @@ typedef uint32_t unsigned32;
typedef uint64_t unsigned64;
/* byte based */
typedef natural8 natural_1;
typedef natural16 natural_2;
typedef natural32 natural_4;
typedef natural64 natural_8;
typedef signed8 signed_1;
typedef signed16 signed_2;
typedef signed32 signed_4;
@ -96,11 +78,9 @@ typedef unsigned64 unsigned_8;
/* target architecture based */
#if (WITH_TARGET_WORD_BITSIZE == 64)
typedef natural64 natural_word;
typedef unsigned64 unsigned_word;
typedef signed64 signed_word;
#else
typedef natural32 natural_word;
typedef unsigned32 unsigned_word;
typedef signed32 signed_word;
#endif
@ -110,7 +90,6 @@ typedef signed32 signed_word;
typedef unsigned32 instruction_word;
/* IEEE 1275 cell size - only support 32bit mode at present */
typedef natural32 natural_cell;
typedef unsigned32 unsigned_cell;
typedef signed32 signed_cell;