aboutsummaryrefslogtreecommitdiff
path: root/libgcc
diff options
context:
space:
mode:
authorTrevor Saunders <tbsaunde+gcc@tbsaunde.org>2015-11-07 19:36:26 +0000
committerTrevor Saunders <tbsaunde+gcc@tbsaunde.org>2015-11-07 19:36:26 +0000
commit94ac607fd273b1e5c23e8864c8eca18f912f64f0 (patch)
tree9febea399aa1894ed3141daf9c1b518b6631b55a /libgcc
parent79d168ec1470e895005aaef3c5a6547729e12c97 (diff)
replace BITS_PER_UNIT with __CHAR_BIT__ in target libs
libgcc/ChangeLog: 2015-11-07 Trevor Saunders <tbsaunde+gcc@tbsaunde.org> * config/visium/lib2funcs.c (__set_trampoline_parity): Use __CHAR_BIT__ instead of BITS_PER_UNIT. * fixed-bit.h: Likewise. * fp-bit.h: Likewise. * libgcc2.c (__popcountSI2): Likewise. (__popcountDI2): Likewise. * libgcc2.h: Likewise. * libgcov.h: Likewise. libobjc/ChangeLog: 2015-11-07 Trevor Saunders <tbsaunde+gcc@tbsaunde.org> PR libobjc/24775 * encoding.c (_darwin_rs6000_special_round_type_align): Use __CHAR_BIT__ instead of BITS_PER_UNIT. (objc_sizeof_type): Likewise. (objc_layout_structure): Likewise. (objc_layout_structure_next_member): Likewise. (objc_layout_finish_structure): Likewise. (objc_layout_structure_get_info): Likewise. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@229936 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgcc')
-rw-r--r--libgcc/ChangeLog11
-rw-r--r--libgcc/config/visium/lib2funcs.c2
-rw-r--r--libgcc/fixed-bit.h10
-rw-r--r--libgcc/fp-bit.h4
-rw-r--r--libgcc/libgcc2.c24
-rw-r--r--libgcc/libgcc2.h8
-rw-r--r--libgcc/libgcov.h4
7 files changed, 37 insertions, 26 deletions
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
index cc5f9f28c07..e4fb81bad0b 100644
--- a/libgcc/ChangeLog
+++ b/libgcc/ChangeLog
@@ -1,3 +1,14 @@
+2015-11-07 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
+
+ * config/visium/lib2funcs.c (__set_trampoline_parity): Use
+ __CHAR_BIT__ instead of BITS_PER_UNIT.
+ * fixed-bit.h: Likewise.
+ * fp-bit.h: Likewise.
+ * libgcc2.c (__popcountSI2): Likewise.
+ (__popcountDI2): Likewise.
+ * libgcc2.h: Likewise.
+ * libgcov.h: Likewise.
+
2015-11-07 David Edelsohn <dje.gcc@gmail.com>
* config/rs6000/atexit.c: New file.
diff --git a/libgcc/config/visium/lib2funcs.c b/libgcc/config/visium/lib2funcs.c
index ba720a36d9e..ed9561f20f1 100644
--- a/libgcc/config/visium/lib2funcs.c
+++ b/libgcc/config/visium/lib2funcs.c
@@ -315,7 +315,7 @@ __set_trampoline_parity (UWtype *addr)
{
int i;
- for (i = 0; i < (TRAMPOLINE_SIZE * BITS_PER_UNIT) / W_TYPE_SIZE; i++)
+ for (i = 0; i < (TRAMPOLINE_SIZE * __CHAR_BIT__) / W_TYPE_SIZE; i++)
addr[i] |= parity_bit (addr[i]);
}
#endif
diff --git a/libgcc/fixed-bit.h b/libgcc/fixed-bit.h
index 2efe01d3d36..7f51f7b1111 100644
--- a/libgcc/fixed-bit.h
+++ b/libgcc/fixed-bit.h
@@ -434,7 +434,7 @@ typedef union
} INTunion;
#endif
-#define FIXED_WIDTH (FIXED_SIZE * BITS_PER_UNIT) /* in bits. */
+#define FIXED_WIDTH (FIXED_SIZE * __CHAR_BIT__) /* in bits. */
#define FIXED_C_TYPE1(NAME) NAME ## type
#define FIXED_C_TYPE2(NAME) FIXED_C_TYPE1(NAME)
#define FIXED_C_TYPE FIXED_C_TYPE2(MODE_NAME)
@@ -1108,17 +1108,17 @@ extern FIXED_C_TYPE FIXED_USASHL (FIXED_C_TYPE, word_type);
#if defined (FROM_MODE_NAME_S) && defined (TO_MODE_NAME_S)
#if FROM_TYPE == 1 /* Signed integer. */
-#define FROM_INT_WIDTH (FROM_INT_SIZE * BITS_PER_UNIT)
+#define FROM_INT_WIDTH (FROM_INT_SIZE * __CHAR_BIT__)
#endif
#if FROM_TYPE == 2 /* Unsigned integer. */
-#define FROM_INT_WIDTH (FROM_INT_SIZE * BITS_PER_UNIT)
+#define FROM_INT_WIDTH (FROM_INT_SIZE * __CHAR_BIT__)
#endif
#if FROM_TYPE == 4 /* Fixed-point. */
#define FROM_FIXED_C_TYPE FIXED_C_TYPE2(FROM_MODE_NAME)
#define FROM_FBITS FBITS2(FROM_MODE_NAME)
-#define FROM_FIXED_WIDTH (FROM_FIXED_SIZE * BITS_PER_UNIT)
+#define FROM_FIXED_WIDTH (FROM_FIXED_SIZE * __CHAR_BIT__)
#define FROM_FBITS FBITS2(FROM_MODE_NAME)
#define FROM_IBITS IBITS2(FROM_MODE_NAME)
#define FROM_I_F_BITS (FROM_FBITS + FROM_IBITS)
@@ -1136,7 +1136,7 @@ extern FIXED_C_TYPE FIXED_USASHL (FIXED_C_TYPE, word_type);
#if TO_TYPE == 4 /* Fixed-point. */
#define TO_FIXED_C_TYPE FIXED_C_TYPE2(TO_MODE_NAME)
#define TO_FBITS FBITS2(TO_MODE_NAME)
-#define TO_FIXED_WIDTH (TO_FIXED_SIZE * BITS_PER_UNIT)
+#define TO_FIXED_WIDTH (TO_FIXED_SIZE * __CHAR_BIT__)
#define TO_FBITS FBITS2(TO_MODE_NAME)
#define TO_IBITS IBITS2(TO_MODE_NAME)
#define TO_I_F_BITS (TO_FBITS + TO_IBITS)
diff --git a/libgcc/fp-bit.h b/libgcc/fp-bit.h
index d844f420fc6..29661be8a31 100644
--- a/libgcc/fp-bit.h
+++ b/libgcc/fp-bit.h
@@ -117,11 +117,11 @@ typedef unsigned int UTItype __attribute__ ((mode (TI)));
#define MAX_USI_INT (~(USItype)0)
#define MAX_SI_INT ((SItype) (MAX_USI_INT >> 1))
-#define BITS_PER_SI (4 * BITS_PER_UNIT)
+#define BITS_PER_SI (4 * __CHAR_BIT__)
#ifdef TMODES
#define MAX_UDI_INT (~(UDItype)0)
#define MAX_DI_INT ((DItype) (MAX_UDI_INT >> 1))
-#define BITS_PER_DI (8 * BITS_PER_UNIT)
+#define BITS_PER_DI (8 * __CHAR_BIT__)
#endif
#ifdef FLOAT_ONLY
diff --git a/libgcc/libgcc2.c b/libgcc/libgcc2.c
index c7376206d64..90dba06ed72 100644
--- a/libgcc/libgcc2.c
+++ b/libgcc/libgcc2.c
@@ -160,7 +160,7 @@ __mulvSI3 (Wtype a, Wtype b)
}
#ifdef COMPAT_SIMODE_TRAPPING_ARITHMETIC
#undef WORD_SIZE
-#define WORD_SIZE (sizeof (SItype) * BITS_PER_UNIT)
+#define WORD_SIZE (sizeof (SItype) * __CHAR_BIT__)
SItype
__mulvsi3 (SItype a, SItype b)
{
@@ -820,16 +820,16 @@ const UQItype __popcount_tab[256] =
#endif
#if defined(L_popcountsi2) || defined(L_popcountdi2)
-#define POPCOUNTCST2(x) (((UWtype) x << BITS_PER_UNIT) | x)
-#define POPCOUNTCST4(x) (((UWtype) x << (2 * BITS_PER_UNIT)) | x)
-#define POPCOUNTCST8(x) (((UWtype) x << (4 * BITS_PER_UNIT)) | x)
-#if W_TYPE_SIZE == BITS_PER_UNIT
+#define POPCOUNTCST2(x) (((UWtype) x << __CHAR_BIT__) | x)
+#define POPCOUNTCST4(x) (((UWtype) x << (2 * __CHAR_BIT__)) | x)
+#define POPCOUNTCST8(x) (((UWtype) x << (4 * __CHAR_BIT__)) | x)
+#if W_TYPE_SIZE == __CHAR_BIT__
#define POPCOUNTCST(x) x
-#elif W_TYPE_SIZE == 2 * BITS_PER_UNIT
+#elif W_TYPE_SIZE == 2 * __CHAR_BIT__
#define POPCOUNTCST(x) POPCOUNTCST2 (x)
-#elif W_TYPE_SIZE == 4 * BITS_PER_UNIT
+#elif W_TYPE_SIZE == 4 * __CHAR_BIT__
#define POPCOUNTCST(x) POPCOUNTCST4 (POPCOUNTCST2 (x))
-#elif W_TYPE_SIZE == 8 * BITS_PER_UNIT
+#elif W_TYPE_SIZE == 8 * __CHAR_BIT__
#define POPCOUNTCST(x) POPCOUNTCST8 (POPCOUNTCST4 (POPCOUNTCST2 (x)))
#endif
#endif
@@ -842,11 +842,11 @@ __popcountSI2 (UWtype x)
/* Force table lookup on targets like AVR and RL78 which only
pretend they have LIBGCC2_UNITS_PER_WORD 4, but actually
have 1, and other small word targets. */
-#if __SIZEOF_INT__ > 2 && defined (POPCOUNTCST) && BITS_PER_UNIT == 8
+#if __SIZEOF_INT__ > 2 && defined (POPCOUNTCST) && __CHAR_BIT__ == 8
x = x - ((x >> 1) & POPCOUNTCST (0x55));
x = (x & POPCOUNTCST (0x33)) + ((x >> 2) & POPCOUNTCST (0x33));
x = (x + (x >> 4)) & POPCOUNTCST (0x0F);
- return (x * POPCOUNTCST (0x01)) >> (W_TYPE_SIZE - BITS_PER_UNIT);
+ return (x * POPCOUNTCST (0x01)) >> (W_TYPE_SIZE - __CHAR_BIT__);
#else
int i, ret = 0;
@@ -866,7 +866,7 @@ __popcountDI2 (UDWtype x)
/* Force table lookup on targets like AVR and RL78 which only
pretend they have LIBGCC2_UNITS_PER_WORD 4, but actually
have 1, and other small word targets. */
-#if __SIZEOF_INT__ > 2 && defined (POPCOUNTCST) && BITS_PER_UNIT == 8
+#if __SIZEOF_INT__ > 2 && defined (POPCOUNTCST) && __CHAR_BIT__ == 8
const DWunion uu = {.ll = x};
UWtype x1 = uu.s.low, x2 = uu.s.high;
x1 = x1 - ((x1 >> 1) & POPCOUNTCST (0x55));
@@ -876,7 +876,7 @@ __popcountDI2 (UDWtype x)
x1 = (x1 + (x1 >> 4)) & POPCOUNTCST (0x0F);
x2 = (x2 + (x2 >> 4)) & POPCOUNTCST (0x0F);
x1 += x2;
- return (x1 * POPCOUNTCST (0x01)) >> (W_TYPE_SIZE - BITS_PER_UNIT);
+ return (x1 * POPCOUNTCST (0x01)) >> (W_TYPE_SIZE - __CHAR_BIT__);
#else
int i, ret = 0;
diff --git a/libgcc/libgcc2.h b/libgcc/libgcc2.h
index 98bb2742582..d689f3433da 100644
--- a/libgcc/libgcc2.h
+++ b/libgcc/libgcc2.h
@@ -178,7 +178,7 @@ typedef int shift_count_type __attribute__((mode (__libgcc_shift_count__)));
if it existed. */
#if LIBGCC2_UNITS_PER_WORD == 8
-#define W_TYPE_SIZE (8 * BITS_PER_UNIT)
+#define W_TYPE_SIZE (8 * __CHAR_BIT__)
#define Wtype DItype
#define UWtype UDItype
#define HWtype DItype
@@ -194,7 +194,7 @@ typedef int shift_count_type __attribute__((mode (__libgcc_shift_count__)));
#endif
#define COMPAT_SIMODE_TRAPPING_ARITHMETIC
#elif LIBGCC2_UNITS_PER_WORD == 4
-#define W_TYPE_SIZE (4 * BITS_PER_UNIT)
+#define W_TYPE_SIZE (4 * __CHAR_BIT__)
#define Wtype SItype
#define UWtype USItype
#define HWtype SItype
@@ -209,7 +209,7 @@ typedef int shift_count_type __attribute__((mode (__libgcc_shift_count__)));
#define __NDW(a,b) __ ## a ## di ## b
#endif
#elif LIBGCC2_UNITS_PER_WORD == 2
-#define W_TYPE_SIZE (2 * BITS_PER_UNIT)
+#define W_TYPE_SIZE (2 * __CHAR_BIT__)
#define Wtype HItype
#define UWtype UHItype
#define HWtype HItype
@@ -224,7 +224,7 @@ typedef int shift_count_type __attribute__((mode (__libgcc_shift_count__)));
#define __NDW(a,b) __ ## a ## si ## b
#endif
#else
-#define W_TYPE_SIZE BITS_PER_UNIT
+#define W_TYPE_SIZE __CHAR_BIT__
#define Wtype QItype
#define UWtype UQItype
#define HWtype QItype
diff --git a/libgcc/libgcov.h b/libgcc/libgcov.h
index 5f54907029b..363492ea2ad 100644
--- a/libgcc/libgcov.h
+++ b/libgcc/libgcov.h
@@ -43,7 +43,7 @@
#include "tm.h"
#include "libgcc_tm.h"
-#if BITS_PER_UNIT == 8
+#if __CHAR_BIT__ == 8
typedef unsigned gcov_unsigned_t __attribute__ ((mode (SI)));
typedef unsigned gcov_position_t __attribute__ ((mode (SI)));
#if LONG_LONG_TYPE_SIZE > 32
@@ -54,7 +54,7 @@ typedef signed gcov_type __attribute__ ((mode (SI)));
typedef unsigned gcov_type_unsigned __attribute__ ((mode (SI)));
#endif
#else
-#if BITS_PER_UNIT == 16
+#if __CHAR_BIT__ == 16
typedef unsigned gcov_unsigned_t __attribute__ ((mode (HI)));
typedef unsigned gcov_position_t __attribute__ ((mode (HI)));
#if LONG_LONG_TYPE_SIZE > 32