Commit ec1e2a40 by Bernd Edlinger Committed by Bernd Edlinger

defaults.h (LOG2_BITS_PER_UNIT): Move from here...

2016-07-27  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * defaults.h (LOG2_BITS_PER_UNIT): Move from here...
        * tree.h (LOG2_BITS_PER_UNIT): ...to here.
        (BITS_PER_UNIT_LOG): Remove.
        (int_bit_position): Use LOG2_BITS_PER_UNIT instead of BITS_PER_UNIT_LOG.
        * expr.c (expand_assignment): Likewise. 
        * stor-layout.c (initialize_sizetypes): Likewise.

c-family:
2016-07-27  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * c-common.c (check_user_alignment): Use LOG2_BITS_PER_UNIT instead of
        BITS_PER_UNIT_LOG.

From-SVN: r238800
parent 98060bbe
2016-07-27 Bernd Edlinger <bernd.edlinger@hotmail.de>
* defaults.h (LOG2_BITS_PER_UNIT): Move from here...
* tree.h (LOG2_BITS_PER_UNIT): ...to here.
(BITS_PER_UNIT_LOG): Remove.
(int_bit_position): Use LOG2_BITS_PER_UNIT instead of BITS_PER_UNIT_LOG.
* expr.c (expand_assignment): Likewise.
* stor-layout.c (initialize_sizetypes): Likewise.
2016-07-27 Michael Meissner <meissner@linux.vnet.ibm.com> 2016-07-27 Michael Meissner <meissner@linux.vnet.ibm.com>
* config/rs6000/vector.md (vec_extract<mode>): Change the calling * config/rs6000/vector.md (vec_extract<mode>): Change the calling
......
2016-07-27 Bernd Edlinger <bernd.edlinger@hotmail.de>
* c-common.c (check_user_alignment): Use LOG2_BITS_PER_UNIT instead of
BITS_PER_UNIT_LOG.
2016-07-25 Jason Merrill <jason@redhat.com> 2016-07-25 Jason Merrill <jason@redhat.com>
PR c++/65970 PR c++/65970
......
...@@ -7679,7 +7679,7 @@ check_user_alignment (const_tree align, bool allow_zero) ...@@ -7679,7 +7679,7 @@ check_user_alignment (const_tree align, bool allow_zero)
error ("requested alignment is not a positive power of 2"); error ("requested alignment is not a positive power of 2");
return -1; return -1;
} }
else if (i >= HOST_BITS_PER_INT - BITS_PER_UNIT_LOG) else if (i >= HOST_BITS_PER_INT - LOG2_BITS_PER_UNIT)
{ {
error ("requested alignment is too large"); error ("requested alignment is too large");
return -1; return -1;
......
...@@ -491,14 +491,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see ...@@ -491,14 +491,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
your target, you should override these values by defining the your target, you should override these values by defining the
appropriate symbols in your tm.h file. */ appropriate symbols in your tm.h file. */
#if BITS_PER_UNIT == 8
#define LOG2_BITS_PER_UNIT 3
#elif BITS_PER_UNIT == 16
#define LOG2_BITS_PER_UNIT 4
#else
#error Unknown BITS_PER_UNIT
#endif
#ifndef BITS_PER_WORD #ifndef BITS_PER_WORD
#define BITS_PER_WORD (BITS_PER_UNIT * UNITS_PER_WORD) #define BITS_PER_WORD (BITS_PER_UNIT * UNITS_PER_WORD)
#endif #endif
......
...@@ -4990,8 +4990,7 @@ expand_assignment (tree to, tree from, bool nontemporal) ...@@ -4990,8 +4990,7 @@ expand_assignment (tree to, tree from, bool nontemporal)
if (bitpos < 0) if (bitpos < 0)
{ {
gcc_assert (offset == NULL_TREE); gcc_assert (offset == NULL_TREE);
offset = size_int (bitpos >> (BITS_PER_UNIT == 8 offset = size_int (bitpos >> LOG2_BITS_PER_UNIT);
? 3 : exact_log2 (BITS_PER_UNIT)));
bitpos &= BITS_PER_UNIT - 1; bitpos &= BITS_PER_UNIT - 1;
} }
......
...@@ -2572,7 +2572,7 @@ initialize_sizetypes (void) ...@@ -2572,7 +2572,7 @@ initialize_sizetypes (void)
} }
bprecision bprecision
= MIN (precision + BITS_PER_UNIT_LOG + 1, MAX_FIXED_MODE_SIZE); = MIN (precision + LOG2_BITS_PER_UNIT + 1, MAX_FIXED_MODE_SIZE);
bprecision bprecision
= GET_MODE_PRECISION (smallest_mode_for_size (bprecision, MODE_INT)); = GET_MODE_PRECISION (smallest_mode_for_size (bprecision, MODE_INT));
if (bprecision > HOST_BITS_PER_DOUBLE_INT) if (bprecision > HOST_BITS_PER_DOUBLE_INT)
......
...@@ -4235,6 +4235,8 @@ extern tree bit_position (const_tree); ...@@ -4235,6 +4235,8 @@ extern tree bit_position (const_tree);
extern tree byte_position (const_tree); extern tree byte_position (const_tree);
extern HOST_WIDE_INT int_byte_position (const_tree); extern HOST_WIDE_INT int_byte_position (const_tree);
/* Type for sizes of data-type. */
#define sizetype sizetype_tab[(int) stk_sizetype] #define sizetype sizetype_tab[(int) stk_sizetype]
#define bitsizetype sizetype_tab[(int) stk_bitsizetype] #define bitsizetype sizetype_tab[(int) stk_bitsizetype]
#define ssizetype sizetype_tab[(int) stk_ssizetype] #define ssizetype sizetype_tab[(int) stk_ssizetype]
...@@ -4244,12 +4246,15 @@ extern HOST_WIDE_INT int_byte_position (const_tree); ...@@ -4244,12 +4246,15 @@ extern HOST_WIDE_INT int_byte_position (const_tree);
#define bitsize_int(L) size_int_kind (L, stk_bitsizetype) #define bitsize_int(L) size_int_kind (L, stk_bitsizetype)
#define sbitsize_int(L) size_int_kind (L, stk_sbitsizetype) #define sbitsize_int(L) size_int_kind (L, stk_sbitsizetype)
/* Type for sizes of data-type. */ /* Log2 of BITS_PER_UNIT. */
#define BITS_PER_UNIT_LOG \ #if BITS_PER_UNIT == 8
((BITS_PER_UNIT > 1) + (BITS_PER_UNIT > 2) + (BITS_PER_UNIT > 4) \ #define LOG2_BITS_PER_UNIT 3
+ (BITS_PER_UNIT > 8) + (BITS_PER_UNIT > 16) + (BITS_PER_UNIT > 32) \ #elif BITS_PER_UNIT == 16
+ (BITS_PER_UNIT > 64) + (BITS_PER_UNIT > 128) + (BITS_PER_UNIT > 256)) #define LOG2_BITS_PER_UNIT 4
#else
#error Unknown BITS_PER_UNIT
#endif
/* Concatenate two lists (chains of TREE_LIST nodes) X and Y /* Concatenate two lists (chains of TREE_LIST nodes) X and Y
by making the last node in X point to Y. by making the last node in X point to Y.
...@@ -5400,8 +5405,8 @@ extern GTY(()) struct int_n_trees_t int_n_trees[NUM_INT_N_ENTS]; ...@@ -5400,8 +5405,8 @@ extern GTY(()) struct int_n_trees_t int_n_trees[NUM_INT_N_ENTS];
inline HOST_WIDE_INT inline HOST_WIDE_INT
int_bit_position (const_tree field) int_bit_position (const_tree field)
{ {
return ((wi::to_offset (DECL_FIELD_OFFSET (field)) << BITS_PER_UNIT_LOG) return ((wi::to_offset (DECL_FIELD_OFFSET (field)) << LOG2_BITS_PER_UNIT)
+ wi::to_offset (DECL_FIELD_BIT_OFFSET (field))).to_shwi (); + wi::to_offset (DECL_FIELD_BIT_OFFSET (field))).to_shwi ();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment