]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
sim: ppc: drop natural types
authorMike Frysinger <vapier@gentoo.org>
Mon, 6 Dec 2021 07:39:42 +0000 (02:39 -0500)
committerMike Frysinger <vapier@gentoo.org>
Sat, 1 Jan 2022 18:31:34 +0000 (13:31 -0500)
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.

sim/ppc/bits.h
sim/ppc/emul_netbsd.c
sim/ppc/idecode_expression.h
sim/ppc/words.h

index 58173f78cd5c3c0fe15d6daf3dd527d8fd34b472..d3b765addb50181557bef426e1d9653438e73e3a 100644 (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)
index d1595c5985f16c6db5be4f92e8162f82e12560d4..322b584a3f13085779f0e09b9269610b03d339aa 100644 (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);
index 28d39a75ce6a5fbcb0d926e79e4282f5c76b4e2c..01b7ebb74a3bb0fcb2ab9c8f2d227dbb64a59400 100644 (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)
index 406bb1fdfaeabbbfee5ce4bfc7b39128a3504c4e..df9278ad11669a16c6097d2a10ecd81b621817fc 100644 (file)
@@ -27,7 +27,6 @@
 
 /* TYPES:
 
-     natural*  sign determined by host
      signed*    signed type of the given size
      unsigned*  The corresponding insigned type
 
 #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;