+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.
{
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
} 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)
#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)
#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)
#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
}
#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)
{
#endif
\f
#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
/* 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;
/* 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));
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;
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
#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
#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
#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
#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
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
+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.
+
2015-11-03 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
PR libobjc/24775
/* Some ports (eg ARM) allow the structure size boundary to be
selected at compile-time. We override the normal definition with
one that has a constant value for this compilation. */
-#ifndef BITS_PER_UNIT
-#define BITS_PER_UNIT 8
-#endif
#undef STRUCTURE_SIZE_BOUNDARY
-#define STRUCTURE_SIZE_BOUNDARY (BITS_PER_UNIT * sizeof (struct{char a;}))
+#define STRUCTURE_SIZE_BOUNDARY (__CHAR_BIT__ * sizeof (struct{char a;}))
/* Some ROUND_TYPE_ALIGN macros use TARGET_foo, and consequently
target_flags. Define a dummy entry here to so we don't die.
{
case RECORD_TYPE:
case UNION_TYPE:
- return MAX (MAX (comp, spec), objc_alignof_type (_stp) * BITS_PER_UNIT);
+ return MAX (MAX (comp, spec), objc_alignof_type (_stp) * __CHAR_BIT__);
break;
case DFmode:
case _C_LNG_LNG:
;
size = atoi (type + 1);
- startByte = position / BITS_PER_UNIT;
- endByte = (position + size) / BITS_PER_UNIT;
+ startByte = position / __CHAR_BIT__;
+ endByte = (position + size) / __CHAR_BIT__;
return endByte - startByte;
}
layout->type = type;
layout->prev_type = NULL;
layout->record_size = 0;
- layout->record_align = BITS_PER_UNIT;
+ layout->record_align = __CHAR_BIT__;
layout->record_align = MAX (layout->record_align, STRUCTURE_SIZE_BOUNDARY);
}
type = objc_skip_type_qualifiers (layout->prev_type);
if (unionp)
layout->record_size = MAX (layout->record_size,
- objc_sizeof_type (type) * BITS_PER_UNIT);
+ objc_sizeof_type (type) * __CHAR_BIT__);
else if (*type != _C_BFLD)
- layout->record_size += objc_sizeof_type (type) * BITS_PER_UNIT;
+ layout->record_size += objc_sizeof_type (type) * __CHAR_BIT__;
else {
/* Get the bitfield's type */
for (bfld_type = type + 1;
bfld_type++)
/* do nothing */;
- bfld_type_align = objc_alignof_type (bfld_type) * BITS_PER_UNIT;
+ bfld_type_align = objc_alignof_type (bfld_type) * __CHAR_BIT__;
bfld_field_size = atoi (objc_skip_typespec (bfld_type));
layout->record_size += bfld_field_size;
}
type = objc_skip_type_qualifiers (layout->type);
if (*type != _C_BFLD)
- desired_align = objc_alignof_type (type) * BITS_PER_UNIT;
+ desired_align = objc_alignof_type (type) * __CHAR_BIT__;
else
{
desired_align = 1;
bfld_type++)
/* do nothing */;
- bfld_type_align = objc_alignof_type (bfld_type) * BITS_PER_UNIT;
+ bfld_type_align = objc_alignof_type (bfld_type) * __CHAR_BIT__;
bfld_field_size = atoi (objc_skip_typespec (bfld_type));
}
if (bfld_field_size)
layout->record_align = MAX (layout->record_align, desired_align);
else
- desired_align = objc_alignof_type (bfld_type) * BITS_PER_UNIT;
+ desired_align = objc_alignof_type (bfld_type) * __CHAR_BIT__;
/* A named bit field of declared type `int'
forces the entire structure to have `int' alignment.
if (maximum_field_alignment != 0)
type_align = MIN (type_align, maximum_field_alignment);
else if (DECL_PACKED (field))
- type_align = MIN (type_align, BITS_PER_UNIT);
+ type_align = MIN (type_align, __CHAR_BIT__);
#endif
layout->record_align = MAX (layout->record_align, type_align);
layout->type = NULL;
}
if (size)
- *size = layout->record_size / BITS_PER_UNIT;
+ *size = layout->record_size / __CHAR_BIT__;
if (align)
- *align = layout->record_align / BITS_PER_UNIT;
+ *align = layout->record_align / __CHAR_BIT__;
}
void objc_layout_structure_get_info (struct objc_struct_layout *layout,
const char **type)
{
if (offset)
- *offset = layout->record_size / BITS_PER_UNIT;
+ *offset = layout->record_size / __CHAR_BIT__;
if (align)
- *align = layout->record_align / BITS_PER_UNIT;
+ *align = layout->record_align / __CHAR_BIT__;
if (type)
*type = layout->prev_type;
}