diff options
author | Trevor Saunders <tbsaunde+gcc@tbsaunde.org> | 2015-11-07 19:36:26 +0000 |
---|---|---|
committer | Trevor Saunders <tbsaunde@gcc.gnu.org> | 2015-11-07 19:36:26 +0000 |
commit | a153644f75bb7e5c7814eb2a7a4737108018748f (patch) | |
tree | 9febea399aa1894ed3141daf9c1b518b6631b55a /libgcc/libgcc2.c | |
parent | 3dee689d8fa82d36a83926931bb9ebaad18ee465 (diff) | |
download | gcc-a153644f75bb7e5c7814eb2a7a4737108018748f.zip gcc-a153644f75bb7e5c7814eb2a7a4737108018748f.tar.gz gcc-a153644f75bb7e5c7814eb2a7a4737108018748f.tar.bz2 |
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.
From-SVN: r229936
Diffstat (limited to 'libgcc/libgcc2.c')
-rw-r--r-- | libgcc/libgcc2.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/libgcc/libgcc2.c b/libgcc/libgcc2.c index c737620..90dba06 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; |