Commit 42ce1cc4 by Bernd Schmidt Committed by Bernd Schmidt

ira-int.h (SET_MINMAX_SET_BIT, [...]): Renamed from SET_ALLOCNO_SET_BIT...

	* ira-int.h (SET_MINMAX_SET_BIT, CLEAR_MINMAX_SET_BIT,
	TEST_MINMAX_SET_BIT, minmax_set_iterator, minmax_set_iter_init,
	minmax_set_iter_cond, minmax_set_iter_next,
	FOR_EACH_BIT_IN_MINMAX_SET): Renamed from SET_ALLOCNO_SET_BIT,
	CLEAR_ALLOCNO_SET_BIT, TEST_ALLOCNO_SET_BIT, ira_allocno_set_iterator,
	ira_allocno_set_iter_init, ira_allocno_set_iter_cond,
	ira_allocno_set_iter_Next and FOR_EACH_ALLOCNO_IN_ALLOCNO_SET.  All
	uses changed.

From-SVN: r161349
parent 6300cb73
...@@ -36,6 +36,15 @@ ...@@ -36,6 +36,15 @@
* ira-color.c (assign_hard_reg): Improve formatting of multi-line for * ira-color.c (assign_hard_reg): Improve formatting of multi-line for
statement. statement.
* ira-int.h (SET_MINMAX_SET_BIT, CLEAR_MINMAX_SET_BIT,
TEST_MINMAX_SET_BIT, minmax_set_iterator, minmax_set_iter_init,
minmax_set_iter_cond, minmax_set_iter_next,
FOR_EACH_BIT_IN_MINMAX_SET): Renamed from SET_ALLOCNO_SET_BIT,
CLEAR_ALLOCNO_SET_BIT, TEST_ALLOCNO_SET_BIT, ira_allocno_set_iterator,
ira_allocno_set_iter_init, ira_allocno_set_iter_cond,
ira_allocno_set_iter_Next and FOR_EACH_ALLOCNO_IN_ALLOCNO_SET. All
uses changed.
2010-06-24 Richard Earnshaw <rearnsha@arm.com> 2010-06-24 Richard Earnshaw <rearnsha@arm.com>
* thumb2.md (thumb2_tlobits_cbranch): Delete. * thumb2.md (thumb2_tlobits_cbranch): Delete.
......
...@@ -670,7 +670,7 @@ add_to_allocno_conflicts (ira_allocno_t a1, ira_allocno_t a2) ...@@ -670,7 +670,7 @@ add_to_allocno_conflicts (ira_allocno_t a1, ira_allocno_t a2)
} }
ALLOCNO_MAX (a1) = id; ALLOCNO_MAX (a1) = id;
} }
SET_ALLOCNO_SET_BIT (vec, id, ALLOCNO_MIN (a1), ALLOCNO_MAX (a1)); SET_MINMAX_SET_BIT (vec, id, ALLOCNO_MIN (a1), ALLOCNO_MAX (a1));
} }
} }
......
...@@ -54,10 +54,10 @@ static IRA_INT_TYPE **conflicts; ...@@ -54,10 +54,10 @@ static IRA_INT_TYPE **conflicts;
#define CONFLICT_ALLOCNO_P(A1, A2) \ #define CONFLICT_ALLOCNO_P(A1, A2) \
(ALLOCNO_MIN (A1) <= ALLOCNO_CONFLICT_ID (A2) \ (ALLOCNO_MIN (A1) <= ALLOCNO_CONFLICT_ID (A2) \
&& ALLOCNO_CONFLICT_ID (A2) <= ALLOCNO_MAX (A1) \ && ALLOCNO_CONFLICT_ID (A2) <= ALLOCNO_MAX (A1) \
&& TEST_ALLOCNO_SET_BIT (conflicts[ALLOCNO_NUM (A1)], \ && TEST_MINMAX_SET_BIT (conflicts[ALLOCNO_NUM (A1)], \
ALLOCNO_CONFLICT_ID (A2), \ ALLOCNO_CONFLICT_ID (A2), \
ALLOCNO_MIN (A1), \ ALLOCNO_MIN (A1), \
ALLOCNO_MAX (A1))) ALLOCNO_MAX (A1)))
...@@ -142,13 +142,13 @@ build_conflict_bit_table (void) ...@@ -142,13 +142,13 @@ build_conflict_bit_table (void)
/* Don't set up conflict for the allocno with itself. */ /* Don't set up conflict for the allocno with itself. */
&& num != (int) j) && num != (int) j)
{ {
SET_ALLOCNO_SET_BIT (conflicts[num], SET_MINMAX_SET_BIT (conflicts[num],
ALLOCNO_CONFLICT_ID (live_a), ALLOCNO_CONFLICT_ID (live_a),
ALLOCNO_MIN (allocno), ALLOCNO_MIN (allocno),
ALLOCNO_MAX (allocno)); ALLOCNO_MAX (allocno));
SET_ALLOCNO_SET_BIT (conflicts[j], id, SET_MINMAX_SET_BIT (conflicts[j], id,
ALLOCNO_MIN (live_a), ALLOCNO_MIN (live_a),
ALLOCNO_MAX (live_a)); ALLOCNO_MAX (live_a));
} }
} }
} }
...@@ -560,12 +560,12 @@ build_allocno_conflicts (ira_allocno_t a) ...@@ -560,12 +560,12 @@ build_allocno_conflicts (ira_allocno_t a)
ira_allocno_t parent_a, another_a, another_parent_a; ira_allocno_t parent_a, another_a, another_parent_a;
ira_allocno_t *vec; ira_allocno_t *vec;
IRA_INT_TYPE *allocno_conflicts; IRA_INT_TYPE *allocno_conflicts;
ira_allocno_set_iterator asi; minmax_set_iterator asi;
allocno_conflicts = conflicts[ALLOCNO_NUM (a)]; allocno_conflicts = conflicts[ALLOCNO_NUM (a)];
px = 0; px = 0;
FOR_EACH_ALLOCNO_IN_SET (allocno_conflicts, FOR_EACH_BIT_IN_MINMAX_SET (allocno_conflicts,
ALLOCNO_MIN (a), ALLOCNO_MAX (a), i, asi) ALLOCNO_MIN (a), ALLOCNO_MAX (a), i, asi)
{ {
another_a = ira_conflict_id_allocno_map[i]; another_a = ira_conflict_id_allocno_map[i];
ira_assert (ira_reg_classes_intersect_p ira_assert (ira_reg_classes_intersect_p
...@@ -597,8 +597,8 @@ build_allocno_conflicts (ira_allocno_t a) ...@@ -597,8 +597,8 @@ build_allocno_conflicts (ira_allocno_t a)
return; return;
ira_assert (ALLOCNO_COVER_CLASS (a) == ALLOCNO_COVER_CLASS (parent_a)); ira_assert (ALLOCNO_COVER_CLASS (a) == ALLOCNO_COVER_CLASS (parent_a));
parent_num = ALLOCNO_NUM (parent_a); parent_num = ALLOCNO_NUM (parent_a);
FOR_EACH_ALLOCNO_IN_SET (allocno_conflicts, FOR_EACH_BIT_IN_MINMAX_SET (allocno_conflicts,
ALLOCNO_MIN (a), ALLOCNO_MAX (a), i, asi) ALLOCNO_MIN (a), ALLOCNO_MAX (a), i, asi)
{ {
another_a = ira_conflict_id_allocno_map[i]; another_a = ira_conflict_id_allocno_map[i];
ira_assert (ira_reg_classes_intersect_p ira_assert (ira_reg_classes_intersect_p
...@@ -609,10 +609,10 @@ build_allocno_conflicts (ira_allocno_t a) ...@@ -609,10 +609,10 @@ build_allocno_conflicts (ira_allocno_t a)
ira_assert (ALLOCNO_NUM (another_parent_a) >= 0); ira_assert (ALLOCNO_NUM (another_parent_a) >= 0);
ira_assert (ALLOCNO_COVER_CLASS (another_a) ira_assert (ALLOCNO_COVER_CLASS (another_a)
== ALLOCNO_COVER_CLASS (another_parent_a)); == ALLOCNO_COVER_CLASS (another_parent_a));
SET_ALLOCNO_SET_BIT (conflicts[parent_num], SET_MINMAX_SET_BIT (conflicts[parent_num],
ALLOCNO_CONFLICT_ID (another_parent_a), ALLOCNO_CONFLICT_ID (another_parent_a),
ALLOCNO_MIN (parent_a), ALLOCNO_MIN (parent_a),
ALLOCNO_MAX (parent_a)); ALLOCNO_MAX (parent_a));
} }
} }
......
...@@ -567,10 +567,16 @@ extern int ira_move_loops_num, ira_additional_jumps_num; ...@@ -567,10 +567,16 @@ extern int ira_move_loops_num, ira_additional_jumps_num;
/* Maximal value of element of array ira_reg_class_nregs. */ /* Maximal value of element of array ira_reg_class_nregs. */
extern int ira_max_nregs; extern int ira_max_nregs;
/* The number of bits in each element of array used to implement a bit /* This page contains a bitset implementation called 'min/max sets' used to
vector of allocnos and what type that element has. We use the record conflicts in IRA.
largest integer format on the host machine. */ They are named min/maxs set since we keep track of a minimum and a maximum
bit number for each set representing the bounds of valid elements. Otherwise,
the implementation resembles sbitmaps in that we store an array of integers
whose bits directly represent the members of the set. */
/* The type used as elements in the array, and the number of bits in
this type. */
#define IRA_INT_BITS HOST_BITS_PER_WIDE_INT #define IRA_INT_BITS HOST_BITS_PER_WIDE_INT
#define IRA_INT_TYPE HOST_WIDE_INT #define IRA_INT_TYPE HOST_WIDE_INT
...@@ -579,7 +585,7 @@ extern int ira_max_nregs; ...@@ -579,7 +585,7 @@ extern int ira_max_nregs;
MAX. */ MAX. */
#if defined ENABLE_IRA_CHECKING && (GCC_VERSION >= 2007) #if defined ENABLE_IRA_CHECKING && (GCC_VERSION >= 2007)
#define SET_ALLOCNO_SET_BIT(R, I, MIN, MAX) __extension__ \ #define SET_MINMAX_SET_BIT(R, I, MIN, MAX) __extension__ \
(({ int _min = (MIN), _max = (MAX), _i = (I); \ (({ int _min = (MIN), _max = (MAX), _i = (I); \
if (_i < _min || _i > _max) \ if (_i < _min || _i > _max) \
{ \ { \
...@@ -592,7 +598,7 @@ extern int ira_max_nregs; ...@@ -592,7 +598,7 @@ extern int ira_max_nregs;
|= ((IRA_INT_TYPE) 1 << ((unsigned) (_i - _min) % IRA_INT_BITS))); })) |= ((IRA_INT_TYPE) 1 << ((unsigned) (_i - _min) % IRA_INT_BITS))); }))
#define CLEAR_ALLOCNO_SET_BIT(R, I, MIN, MAX) __extension__ \ #define CLEAR_MINMAX_SET_BIT(R, I, MIN, MAX) __extension__ \
(({ int _min = (MIN), _max = (MAX), _i = (I); \ (({ int _min = (MIN), _max = (MAX), _i = (I); \
if (_i < _min || _i > _max) \ if (_i < _min || _i > _max) \
{ \ { \
...@@ -604,7 +610,7 @@ extern int ira_max_nregs; ...@@ -604,7 +610,7 @@ extern int ira_max_nregs;
((R)[(unsigned) (_i - _min) / IRA_INT_BITS] \ ((R)[(unsigned) (_i - _min) / IRA_INT_BITS] \
&= ~((IRA_INT_TYPE) 1 << ((unsigned) (_i - _min) % IRA_INT_BITS))); })) &= ~((IRA_INT_TYPE) 1 << ((unsigned) (_i - _min) % IRA_INT_BITS))); }))
#define TEST_ALLOCNO_SET_BIT(R, I, MIN, MAX) __extension__ \ #define TEST_MINMAX_SET_BIT(R, I, MIN, MAX) __extension__ \
(({ int _min = (MIN), _max = (MAX), _i = (I); \ (({ int _min = (MIN), _max = (MAX), _i = (I); \
if (_i < _min || _i > _max) \ if (_i < _min || _i > _max) \
{ \ { \
...@@ -618,25 +624,24 @@ extern int ira_max_nregs; ...@@ -618,25 +624,24 @@ extern int ira_max_nregs;
#else #else
#define SET_ALLOCNO_SET_BIT(R, I, MIN, MAX) \ #define SET_MINMAX_SET_BIT(R, I, MIN, MAX) \
((R)[(unsigned) ((I) - (MIN)) / IRA_INT_BITS] \ ((R)[(unsigned) ((I) - (MIN)) / IRA_INT_BITS] \
|= ((IRA_INT_TYPE) 1 << ((unsigned) ((I) - (MIN)) % IRA_INT_BITS))) |= ((IRA_INT_TYPE) 1 << ((unsigned) ((I) - (MIN)) % IRA_INT_BITS)))
#define CLEAR_ALLOCNO_SET_BIT(R, I, MIN, MAX) \ #define CLEAR_MINMAX_SET_BIT(R, I, MIN, MAX) \
((R)[(unsigned) ((I) - (MIN)) / IRA_INT_BITS] \ ((R)[(unsigned) ((I) - (MIN)) / IRA_INT_BITS] \
&= ~((IRA_INT_TYPE) 1 << ((unsigned) ((I) - (MIN)) % IRA_INT_BITS))) &= ~((IRA_INT_TYPE) 1 << ((unsigned) ((I) - (MIN)) % IRA_INT_BITS)))
#define TEST_ALLOCNO_SET_BIT(R, I, MIN, MAX) \ #define TEST_MINMAX_SET_BIT(R, I, MIN, MAX) \
((R)[(unsigned) ((I) - (MIN)) / IRA_INT_BITS] \ ((R)[(unsigned) ((I) - (MIN)) / IRA_INT_BITS] \
& ((IRA_INT_TYPE) 1 << ((unsigned) ((I) - (MIN)) % IRA_INT_BITS))) & ((IRA_INT_TYPE) 1 << ((unsigned) ((I) - (MIN)) % IRA_INT_BITS)))
#endif #endif
/* The iterator for allocno set implemented ed as allocno bit /* The iterator for min/max sets. */
vector. */
typedef struct { typedef struct {
/* Array containing the allocno bit vector. */ /* Array containing the bit vector. */
IRA_INT_TYPE *vec; IRA_INT_TYPE *vec;
/* The number of the current element in the vector. */ /* The number of the current element in the vector. */
...@@ -653,13 +658,13 @@ typedef struct { ...@@ -653,13 +658,13 @@ typedef struct {
/* The word of the bit vector currently visited. */ /* The word of the bit vector currently visited. */
unsigned IRA_INT_TYPE word; unsigned IRA_INT_TYPE word;
} ira_allocno_set_iterator; } minmax_set_iterator;
/* Initialize the iterator I for allocnos bit vector VEC containing /* Initialize the iterator I for bit vector VEC containing minimal and
minimal and maximal values MIN and MAX. */ maximal values MIN and MAX. */
static inline void static inline void
ira_allocno_set_iter_init (ira_allocno_set_iterator *i, minmax_set_iter_init (minmax_set_iterator *i, IRA_INT_TYPE *vec, int min,
IRA_INT_TYPE *vec, int min, int max) int max)
{ {
i->vec = vec; i->vec = vec;
i->word_num = 0; i->word_num = 0;
...@@ -669,11 +674,11 @@ ira_allocno_set_iter_init (ira_allocno_set_iterator *i, ...@@ -669,11 +674,11 @@ ira_allocno_set_iter_init (ira_allocno_set_iterator *i,
i->word = i->nel == 0 ? 0 : vec[0]; i->word = i->nel == 0 ? 0 : vec[0];
} }
/* Return TRUE if we have more allocnos to visit, in which case *N is /* Return TRUE if we have more elements to visit, in which case *N is
set to the allocno number to be visited. Otherwise, return set to the number of the element to be visited. Otherwise, return
FALSE. */ FALSE. */
static inline bool static inline bool
ira_allocno_set_iter_cond (ira_allocno_set_iterator *i, int *n) minmax_set_iter_cond (minmax_set_iterator *i, int *n)
{ {
/* Skip words that are zeros. */ /* Skip words that are zeros. */
for (; i->word == 0; i->word = i->vec[i->word_num]) for (; i->word == 0; i->word = i->vec[i->word_num])
...@@ -695,23 +700,23 @@ ira_allocno_set_iter_cond (ira_allocno_set_iterator *i, int *n) ...@@ -695,23 +700,23 @@ ira_allocno_set_iter_cond (ira_allocno_set_iterator *i, int *n)
return true; return true;
} }
/* Advance to the next allocno in the set. */ /* Advance to the next element in the set. */
static inline void static inline void
ira_allocno_set_iter_next (ira_allocno_set_iterator *i) minmax_set_iter_next (minmax_set_iterator *i)
{ {
i->word >>= 1; i->word >>= 1;
i->bit_num++; i->bit_num++;
} }
/* Loop over all elements of allocno set given by bit vector VEC and /* Loop over all elements of a min/max set given by bit vector VEC and
their minimal and maximal values MIN and MAX. In each iteration, N their minimal and maximal values MIN and MAX. In each iteration, N
is set to the number of next allocno. ITER is an instance of is set to the number of next allocno. ITER is an instance of
ira_allocno_set_iterator used to iterate the allocnos in the set. */ minmax_set_iterator used to iterate over the set. */
#define FOR_EACH_ALLOCNO_IN_SET(VEC, MIN, MAX, N, ITER) \ #define FOR_EACH_BIT_IN_MINMAX_SET(VEC, MIN, MAX, N, ITER) \
for (ira_allocno_set_iter_init (&(ITER), (VEC), (MIN), (MAX)); \ for (minmax_set_iter_init (&(ITER), (VEC), (MIN), (MAX)); \
ira_allocno_set_iter_cond (&(ITER), &(N)); \ minmax_set_iter_cond (&(ITER), &(N)); \
ira_allocno_set_iter_next (&(ITER))) minmax_set_iter_next (&(ITER)))
/* ira.c: */ /* ira.c: */
/* Map: hard regs X modes -> set of hard registers for storing value /* Map: hard regs X modes -> set of hard registers for storing value
......
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