+2007-05-22 Richard Sandiford <richard@codesourcery.com>
+
+ * hard-reg-set.h (GO_IF_HARD_REG_SUBSET, GO_IF_HARD_REG_EQUAL): Delete
+ in favor of...
+ (hard_reg_subset_p, hard_reg_sets_equal_p, hard_reg_sets_intersect_p)
+ (hard_reg_set_empty_p): ...these new functions.
+ * bt-load.c (choose_btr): Use hard_reg_subset_p instead of
+ GO_IF_HARD_REG_SUBSET.
+ * cfgcleanup.c (old_insns_match_p): Use hard_reg_sets_equal_p
+ instead of GO_IF_HARD_REG_EQUAL.
+ * df-problems.c (df_urec_local_compute): Use hard_reg_set_empty_p
+ instead of GO_IF_HARD_REG_EQUAL.
+ * global.c (find_reg): Use hard_reg_set_empty_p instead of
+ GO_IF_HARD_REG_SUBSET.
+ (modify_reg_pav): Use hard_reg_set_empty_p instead of
+ GO_IF_HARD_REG_EQUAL.
+ * local-alloc.c (find_free_reg): Use hard_reg_subset_p instead
+ of GO_IF_HARD_REG_SUBSET.
+ * reg-stack.c (change_stack, convert_regs_1): Use hard_reg_sets_equal_p
+ instead of GO_IF_HARD_REG_EQUAL.
+ * regclass.c (init_reg_sets_1, reg_scan_mark_refs): Use
+ hard_reg_subset_p instead of GO_IF_HARD_REG_SUBSET.
+ (reg_classes_intersect_p): Use hard_reg_sets_intersect_p instead
+ of GO_IF_HARD_REG_SUBSET,
+ * reload1.c (finish_spills): Use hard_reg_subset_p instead of
+ GO_IF_HARD_REG_SUBSET.
+ * struct-equiv.c (death_notes_match_p): Use hard_reg_sets_equal_p
+ instead of GO_IF_HARD_REG_EQUAL.
+ * config/sh/sh.c (push_regs, calc_live_regs): Use
+ hard_reg_sets_intersect_p instead of hard_regs_intersect_p.
+ (hard_regs_intersect_p): Delete.
+
2007-05-22 Janis Johnson <janis187@us.ibm.com>
* doc/sourcebuild.texi (Test Directives) Add dg-message.
choose_btr (HARD_REG_SET used_btrs)
{
int i;
- GO_IF_HARD_REG_SUBSET (all_btrs, used_btrs, give_up);
- for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- {
+ if (!hard_reg_set_subset_p (all_btrs, used_btrs))
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ {
#ifdef REG_ALLOC_ORDER
- int regno = reg_alloc_order[i];
+ int regno = reg_alloc_order[i];
#else
- int regno = i;
+ int regno = i;
#endif
- if (TEST_HARD_REG_BIT (all_btrs, regno)
- && !TEST_HARD_REG_BIT (used_btrs, regno))
- return regno;
- }
-give_up:
+ if (TEST_HARD_REG_BIT (all_btrs, regno)
+ && !TEST_HARD_REG_BIT (used_btrs, regno))
+ return regno;
+ }
return -1;
}
if (REG_NOTE_KIND (note) == REG_DEAD && STACK_REG_P (XEXP (note, 0)))
SET_HARD_REG_BIT (i2_regset, REGNO (XEXP (note, 0)));
- GO_IF_HARD_REG_EQUAL (i1_regset, i2_regset, done);
-
- return false;
-
- done:
- ;
+ if (!hard_reg_set_equal_p (i1_regset, i2_regset))
+ return false;
}
#endif
static int sh_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode,
tree, bool);
static int sh_dwarf_calling_convention (tree);
-static int hard_regs_intersect_p (HARD_REG_SET *, HARD_REG_SET *);
\f
/* Initialize the GCC target structure. */
and we have to push any floating point register, we need
to switch to the correct precision first. */
if (i == FIRST_FP_REG && interrupt_handler && TARGET_FMOVD
- && hard_regs_intersect_p (mask, ®_class_contents[DF_REGS]))
+ && hard_reg_set_intersect_p (*mask, reg_class_contents[DF_REGS]))
{
HARD_REG_SET unsaved;
Make sure we save at least one general purpose register when we need
to save target registers. */
if (interrupt_handler
- && hard_regs_intersect_p (live_regs_mask,
- ®_class_contents[TARGET_REGS])
- && ! hard_regs_intersect_p (live_regs_mask,
- ®_class_contents[GENERAL_REGS]))
+ && hard_reg_set_intersect_p (*live_regs_mask,
+ reg_class_contents[TARGET_REGS])
+ && ! hard_reg_set_intersect_p (*live_regs_mask,
+ reg_class_contents[GENERAL_REGS]))
{
SET_HARD_REG_BIT (*live_regs_mask, R0_REG);
count += GET_MODE_SIZE (REGISTER_NATURAL_MODE (R0_REG));
int j = (FIRST_PSEUDO_REGISTER - 1) - i;
if (j == FPSCR_REG && current_function_interrupt && TARGET_FMOVD
- && hard_regs_intersect_p (&live_regs_mask,
- ®_class_contents[DF_REGS]))
+ && hard_reg_set_intersect_p (live_regs_mask,
+ reg_class_contents[DF_REGS]))
fpscr_deferred = 1;
else if (j != PR_REG && TEST_HARD_REG_BIT (live_regs_mask, j))
pop (j);
}
}
-/* Determine if two hard register sets intersect.
- Return 1 if they do. */
-
-static int
-hard_regs_intersect_p (HARD_REG_SET *a, HARD_REG_SET *b)
-{
- HARD_REG_SET c;
- COPY_HARD_REG_SET (c, *a);
- AND_HARD_REG_SET (c, *b);
- GO_IF_HARD_REG_SUBSET (c, reg_class_contents[(int) NO_REGS], lose);
- return 1;
-lose:
- return 0;
-}
-
/* Replace any occurrence of FROM(n) in X with TO(n). The function does
not enter into CONST_DOUBLE for the replace.
bitmap_iterator bi;
#ifdef STACK_REGS
int i;
- HARD_REG_SET zero, stack_hard_regs, used;
+ HARD_REG_SET stack_hard_regs, used;
struct df_urec_problem_data *problem_data
= (struct df_urec_problem_data *) dflow->problem_data;
FIXME: This seems like an incredibly poor idea. */
- CLEAR_HARD_REG_SET (zero);
CLEAR_HARD_REG_SET (stack_hard_regs);
for (i = FIRST_STACK_REG; i <= LAST_STACK_REG; i++)
SET_HARD_REG_BIT (stack_hard_regs, i);
COPY_HARD_REG_SET (used, reg_class_contents[reg_preferred_class (i)]);
IOR_HARD_REG_SET (used, reg_class_contents[reg_alternate_class (i)]);
AND_HARD_REG_SET (used, stack_hard_regs);
- GO_IF_HARD_REG_EQUAL (used, zero, skip);
- bitmap_set_bit (problem_data->stack_regs, i);
- skip:
- ;
+ if (!hard_reg_set_empty_p (used))
+ bitmap_set_bit (problem_data->stack_regs, i);
}
#endif
preferred registers. */
AND_COMPL_HARD_REG_SET (allocno[num].hard_reg_copy_preferences, used);
- GO_IF_HARD_REG_SUBSET (allocno[num].hard_reg_copy_preferences,
- reg_class_contents[(int) NO_REGS], no_copy_prefs);
-
- if (best_reg >= 0)
+ if (!hard_reg_set_empty_p (allocno[num].hard_reg_copy_preferences)
+ && best_reg >= 0)
{
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
if (TEST_HARD_REG_BIT (allocno[num].hard_reg_copy_preferences, i)
}
}
}
- no_copy_prefs:
AND_COMPL_HARD_REG_SET (allocno[num].hard_reg_preferences, used);
- GO_IF_HARD_REG_SUBSET (allocno[num].hard_reg_preferences,
- reg_class_contents[(int) NO_REGS], no_prefs);
-
- if (best_reg >= 0)
+ if (!hard_reg_set_empty_p (allocno[num].hard_reg_preferences)
+ && best_reg >= 0)
{
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
if (TEST_HARD_REG_BIT (allocno[num].hard_reg_preferences, i)
struct bb_info *bb_info;
#ifdef STACK_REGS
int i;
- HARD_REG_SET zero, stack_hard_regs, used;
+ HARD_REG_SET stack_hard_regs, used;
bitmap stack_regs;
- CLEAR_HARD_REG_SET (zero);
CLEAR_HARD_REG_SET (stack_hard_regs);
for (i = FIRST_STACK_REG; i <= LAST_STACK_REG; i++)
SET_HARD_REG_BIT(stack_hard_regs, i);
COPY_HARD_REG_SET (used, reg_class_contents[reg_preferred_class (i)]);
IOR_HARD_REG_SET (used, reg_class_contents[reg_alternate_class (i)]);
AND_HARD_REG_SET (used, stack_hard_regs);
- GO_IF_HARD_REG_EQUAL(used, zero, skip);
- bitmap_set_bit (stack_regs, i);
- skip:
- ;
+ if (!hard_reg_set_empty_p (used))
+ bitmap_set_bit (stack_regs, i);
}
#endif
FOR_EACH_BB (bb)
IOR_COMPL_HARD_REG_SET and AND_COMPL_HARD_REG_SET
which use the complement of the set FROM.
- Also define GO_IF_HARD_REG_SUBSET (X, Y, TO):
- if X is a subset of Y, go to TO.
-*/
+ Also define:
+
+ hard_reg_set_subset_p (X, Y), which returns true if X is a subset of Y.
+ hard_reg_set_equal_p (X, Y), which returns true if X and Y are equal.
+ hard_reg_set_intersect_p (X, Y), which returns true if X and Y intersect.
+ hard_reg_set_empty_p (X), which returns true if X is empty. */
#ifdef HARD_REG_SET
#define AND_HARD_REG_SET(TO, FROM) ((TO) &= (FROM))
#define AND_COMPL_HARD_REG_SET(TO, FROM) ((TO) &= ~ (FROM))
-#define GO_IF_HARD_REG_SUBSET(X,Y,TO) if (HARD_CONST (0) == ((X) & ~(Y))) goto TO
-
-#define GO_IF_HARD_REG_EQUAL(X,Y,TO) if ((X) == (Y)) goto TO
+static inline bool
+hard_reg_set_subset_p (const HARD_REG_SET x, const HARD_REG_SET y)
+{
+ return (x & ~y) == HARD_CONST (0);
+}
+
+static inline bool
+hard_reg_set_equal_p (const HARD_REG_SET x, const HARD_REG_SET y)
+{
+ return x == y;
+}
+
+static inline bool
+hard_reg_set_intersect_p (const HARD_REG_SET x, const HARD_REG_SET y)
+{
+ return (x & y) != HARD_CONST (0);
+}
+
+static inline bool
+hard_reg_set_empty_p (const HARD_REG_SET x)
+{
+ return x == HARD_CONST (0);
+}
#else
scan_tp_[0] |= ~ scan_fp_[0]; \
scan_tp_[1] |= ~ scan_fp_[1]; } while (0)
-#define GO_IF_HARD_REG_SUBSET(X,Y,TO) \
-do { HARD_REG_ELT_TYPE *scan_xp_ = (X), *scan_yp_ = (Y); \
- if ((0 == (scan_xp_[0] & ~ scan_yp_[0])) \
- && (0 == (scan_xp_[1] & ~ scan_yp_[1]))) \
- goto TO; } while (0)
-
-#define GO_IF_HARD_REG_EQUAL(X,Y,TO) \
-do { HARD_REG_ELT_TYPE *scan_xp_ = (X), *scan_yp_ = (Y); \
- if ((scan_xp_[0] == scan_yp_[0]) \
- && (scan_xp_[1] == scan_yp_[1])) \
- goto TO; } while (0)
+static inline bool
+hard_reg_set_subset_p (const HARD_REG_SET x, const HARD_REG_SET y)
+{
+ return (x[0] & ~y[0]) == 0 && (x[1] & ~y[1]) == 0;
+}
+
+static inline bool
+hard_reg_set_equal_p (const HARD_REG_SET x, const HARD_REG_SET y)
+{
+ return x[0] == y[0] && x[1] == y[1];
+}
+
+static inline bool
+hard_reg_set_intersect_p (const HARD_REG_SET x, const HARD_REG_SET y)
+{
+ return (x[0] & y[0]) != 0 || (x[1] & y[1]) != 0;
+}
+
+static inline bool
+hard_reg_set_empty_p (const HARD_REG_SET x)
+{
+ return x[0] == 0 && x[1] == 0;
+}
#else
#if FIRST_PSEUDO_REGISTER <= 3*HOST_BITS_PER_WIDEST_FAST_INT
scan_tp_[1] |= ~ scan_fp_[1]; \
scan_tp_[2] |= ~ scan_fp_[2]; } while (0)
-#define GO_IF_HARD_REG_SUBSET(X,Y,TO) \
-do { HARD_REG_ELT_TYPE *scan_xp_ = (X), *scan_yp_ = (Y); \
- if ((0 == (scan_xp_[0] & ~ scan_yp_[0])) \
- && (0 == (scan_xp_[1] & ~ scan_yp_[1])) \
- && (0 == (scan_xp_[2] & ~ scan_yp_[2]))) \
- goto TO; } while (0)
-
-#define GO_IF_HARD_REG_EQUAL(X,Y,TO) \
-do { HARD_REG_ELT_TYPE *scan_xp_ = (X), *scan_yp_ = (Y); \
- if ((scan_xp_[0] == scan_yp_[0]) \
- && (scan_xp_[1] == scan_yp_[1]) \
- && (scan_xp_[2] == scan_yp_[2])) \
- goto TO; } while (0)
+static inline bool
+hard_reg_set_subset_p (const HARD_REG_SET x, const HARD_REG_SET y)
+{
+ return ((x[0] & ~y[0]) == 0
+ && (x[1] & ~y[1]) == 0
+ && (x[2] & ~y[2]) == 0);
+}
+
+static inline bool
+hard_reg_set_equal_p (const HARD_REG_SET x, const HARD_REG_SET y)
+{
+ return x[0] == y[0] && x[1] == y[1] && x[2] == y[2];
+}
+
+static inline bool
+hard_reg_set_intersect_p (const HARD_REG_SET x, const HARD_REG_SET y)
+{
+ return ((x[0] & y[0]) != 0
+ || (x[1] & y[1]) != 0
+ || (x[2] & y[2]) != 0);
+}
+
+static inline bool
+hard_reg_set_empty_p (const HARD_REG_SET x)
+{
+ return x[0] == 0 && x[1] == 0 && x[2] == 0;
+}
#else
#if FIRST_PSEUDO_REGISTER <= 4*HOST_BITS_PER_WIDEST_FAST_INT
scan_tp_[2] |= ~ scan_fp_[2]; \
scan_tp_[3] |= ~ scan_fp_[3]; } while (0)
-#define GO_IF_HARD_REG_SUBSET(X,Y,TO) \
-do { HARD_REG_ELT_TYPE *scan_xp_ = (X), *scan_yp_ = (Y); \
- if ((0 == (scan_xp_[0] & ~ scan_yp_[0])) \
- && (0 == (scan_xp_[1] & ~ scan_yp_[1])) \
- && (0 == (scan_xp_[2] & ~ scan_yp_[2])) \
- && (0 == (scan_xp_[3] & ~ scan_yp_[3]))) \
- goto TO; } while (0)
-
-#define GO_IF_HARD_REG_EQUAL(X,Y,TO) \
-do { HARD_REG_ELT_TYPE *scan_xp_ = (X), *scan_yp_ = (Y); \
- if ((scan_xp_[0] == scan_yp_[0]) \
- && (scan_xp_[1] == scan_yp_[1]) \
- && (scan_xp_[2] == scan_yp_[2]) \
- && (scan_xp_[3] == scan_yp_[3])) \
- goto TO; } while (0)
+static inline bool
+hard_reg_set_subset_p (const HARD_REG_SET x, const HARD_REG_SET y)
+{
+ return ((x[0] & ~y[0]) == 0
+ && (x[1] & ~y[1]) == 0
+ && (x[2] & ~y[2]) == 0
+ && (x[3] & ~y[3]) == 0);
+}
+
+static inline bool
+hard_reg_set_equal_p (const HARD_REG_SET x, const HARD_REG_SET y)
+{
+ return x[0] == y[0] && x[1] == y[1] && x[2] == y[2] && x[3] == y[3];
+}
+
+static inline bool
+hard_reg_set_intersect_p (const HARD_REG_SET x, const HARD_REG_SET y)
+{
+ return ((x[0] & y[0]) != 0
+ || (x[1] & y[1]) != 0
+ || (x[2] & y[2]) != 0
+ || (x[3] & y[3]) != 0);
+}
+
+static inline bool
+hard_reg_set_empty_p (const HARD_REG_SET x)
+{
+ return x[0] == 0 && x[1] == 0 && x[2] == 0 && x[3] == 0;
+}
#else /* FIRST_PSEUDO_REGISTER > 3*HOST_BITS_PER_WIDEST_FAST_INT */
for (i = 0; i < HARD_REG_SET_LONGS; i++) \
*scan_tp_++ |= ~ *scan_fp_++; } while (0)
-#define GO_IF_HARD_REG_SUBSET(X,Y,TO) \
-do { HARD_REG_ELT_TYPE *scan_xp_ = (X), *scan_yp_ = (Y); \
- int i; \
- for (i = 0; i < HARD_REG_SET_LONGS; i++) \
- if (0 != (*scan_xp_++ & ~ *scan_yp_++)) break; \
- if (i == HARD_REG_SET_LONGS) goto TO; } while (0)
-
-#define GO_IF_HARD_REG_EQUAL(X,Y,TO) \
-do { HARD_REG_ELT_TYPE *scan_xp_ = (X), *scan_yp_ = (Y); \
- int i; \
- for (i = 0; i < HARD_REG_SET_LONGS; i++) \
- if (*scan_xp_++ != *scan_yp_++) break; \
- if (i == HARD_REG_SET_LONGS) goto TO; } while (0)
+static inline bool
+hard_reg_set_subset_p (const HARD_REG_SET x, const HARD_REG_SET y)
+{
+ int i;
+
+ for (i = 0; i < HARD_REG_SET_LONGS; i++)
+ if ((x[i] & ~y[i]) != 0)
+ return false;
+ return true;
+}
+
+static inline bool
+hard_reg_set_equal_p (const HARD_REG_SET x, const HARD_REG_SET y)
+{
+ int i;
+
+ for (i = 0; i < HARD_REG_SET_LONGS; i++)
+ if (x[i] != y[i])
+ return false;
+ return true;
+}
+
+static inline bool
+hard_reg_set_intersect_p (const HARD_REG_SET x, const HARD_REG_SET y)
+{
+ int i;
+
+ for (i = 0; i < HARD_REG_SET_LONGS; i++)
+ if ((x[i] & y[i]) != 0)
+ return true;
+ return false;
+}
+
+static inline bool
+hard_reg_set_empty_p (const HARD_REG_SET x)
+{
+ int i;
+
+ for (i = 0; i < HARD_REG_SET_LONGS; i++)
+ if (x[i] != 0)
+ return false;
+ return true;
+}
#endif
#endif
IOR_COMPL_HARD_REG_SET (first_used, qty_phys_sugg[qtyno]);
}
- /* If all registers are excluded, we can't do anything. */
- GO_IF_HARD_REG_SUBSET (reg_class_contents[(int) ALL_REGS], first_used, fail);
-
/* If at least one would be suitable, test each hard reg. */
-
- for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- {
+ if (!hard_reg_set_subset_p (reg_class_contents[(int) ALL_REGS], first_used))
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ {
#ifdef REG_ALLOC_ORDER
- int regno = reg_alloc_order[i];
+ int regno = reg_alloc_order[i];
#else
- int regno = i;
+ int regno = i;
#endif
- if (! TEST_HARD_REG_BIT (first_used, regno)
- && HARD_REGNO_MODE_OK (regno, mode)
- && (qty[qtyno].n_calls_crossed == 0
- || accept_call_clobbered
- || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
- {
- int j;
- int size1 = hard_regno_nregs[regno][mode];
- for (j = 1; j < size1 && ! TEST_HARD_REG_BIT (used, regno + j); j++);
- if (j == size1)
- {
- /* Mark that this register is in use between its birth and death
- insns. */
- post_mark_life (regno, mode, 1, born_index, dead_index);
- return regno;
- }
+ if (!TEST_HARD_REG_BIT (first_used, regno)
+ && HARD_REGNO_MODE_OK (regno, mode)
+ && (qty[qtyno].n_calls_crossed == 0
+ || accept_call_clobbered
+ || !HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
+ {
+ int j;
+ int size1 = hard_regno_nregs[regno][mode];
+ j = 1;
+ while (j < size1 && !TEST_HARD_REG_BIT (used, regno + j))
+ j++;
+ if (j == size1)
+ {
+ /* Mark that this register is in use between its birth
+ and death insns. */
+ post_mark_life (regno, mode, 1, born_index, dead_index);
+ return regno;
+ }
#ifndef REG_ALLOC_ORDER
- /* Skip starting points we know will lose. */
- i += j;
+ /* Skip starting points we know will lose. */
+ i += j;
#endif
- }
- }
+ }
+ }
- fail:
/* If we are just trying suggested register, we have just tried copy-
suggested registers, and there are arithmetic-suggested registers,
try them. */
/* By now, the only difference should be the order of the stack,
not their depth or liveliness. */
- GO_IF_HARD_REG_EQUAL (old->reg_set, new->reg_set, win);
- gcc_unreachable ();
- win:
+ gcc_assert (hard_reg_set_equal_p (old->reg_set, new->reg_set));
gcc_assert (old->top == new->top);
/* If the stack is not empty (new->top != -1), loop here emitting
/* Something failed if the stack lives don't match. If we had malformed
asms, we zapped the instruction itself, but that didn't produce the
same pattern of register kills as before. */
- GO_IF_HARD_REG_EQUAL (regstack.reg_set, bi->out_reg_set, win);
- gcc_assert (any_malformed_asm);
- win:
+ gcc_assert (hard_reg_set_equal_p (regstack.reg_set, bi->out_reg_set)
+ || any_malformed_asm);
bi->stack_out = regstack;
bi->done = true;
}
COPY_HARD_REG_SET (c, reg_class_contents[i]);
IOR_HARD_REG_SET (c, reg_class_contents[j]);
for (k = 0; k < N_REG_CLASSES; k++)
- {
- GO_IF_HARD_REG_SUBSET (reg_class_contents[k], c,
- subclass1);
- continue;
-
- subclass1:
- /* Keep the largest subclass. */ /* SPEE 900308 */
- GO_IF_HARD_REG_SUBSET (reg_class_contents[k],
- reg_class_contents[(int) reg_class_subunion[i][j]],
- subclass2);
+ if (hard_reg_set_subset_p (reg_class_contents[k], c)
+ && !hard_reg_set_subset_p (reg_class_contents[k],
+ reg_class_contents
+ [(int) reg_class_subunion[i][j]]))
reg_class_subunion[i][j] = (enum reg_class) k;
- subclass2:
- ;
- }
}
}
COPY_HARD_REG_SET (c, reg_class_contents[i]);
IOR_HARD_REG_SET (c, reg_class_contents[j]);
for (k = 0; k < N_REG_CLASSES; k++)
- GO_IF_HARD_REG_SUBSET (c, reg_class_contents[k], superclass);
+ if (hard_reg_set_subset_p (c, reg_class_contents[k]))
+ break;
- superclass:
reg_class_superunion[i][j] = (enum reg_class) k;
}
}
continue;
for (j = i + 1; j < N_REG_CLASSES; j++)
- {
- enum reg_class *p;
-
- GO_IF_HARD_REG_SUBSET (reg_class_contents[i], reg_class_contents[j],
- subclass);
- continue;
- subclass:
- /* Reg class I is a subclass of J.
- Add J to the table of superclasses of I. */
- p = ®_class_superclasses[i][0];
- while (*p != LIM_REG_CLASSES) p++;
- *p = (enum reg_class) j;
- /* Add I to the table of superclasses of J. */
- p = ®_class_subclasses[j][0];
- while (*p != LIM_REG_CLASSES) p++;
- *p = (enum reg_class) i;
- }
+ if (hard_reg_set_subset_p (reg_class_contents[i],
+ reg_class_contents[j]))
+ {
+ /* Reg class I is a subclass of J.
+ Add J to the table of superclasses of I. */
+ enum reg_class *p;
+
+ p = ®_class_superclasses[i][0];
+ while (*p != LIM_REG_CLASSES) p++;
+ *p = (enum reg_class) j;
+ /* Add I to the table of superclasses of J. */
+ p = ®_class_subclasses[j][0];
+ while (*p != LIM_REG_CLASSES) p++;
+ *p = (enum reg_class) i;
+ }
}
/* Initialize "constant" tables. */
int
reg_class_subset_p (enum reg_class c1, enum reg_class c2)
{
- if (c1 == c2) return 1;
-
- if (c2 == ALL_REGS)
- win:
- return 1;
- GO_IF_HARD_REG_SUBSET (reg_class_contents[(int) c1],
- reg_class_contents[(int) c2],
- win);
- return 0;
+ return (c1 == c2
+ || c2 == ALL_REGS
+ || hard_reg_set_subset_p (reg_class_contents[(int) c1],
+ reg_class_contents[(int) c2]));
}
/* Return nonzero if there is a register that is in both C1 and C2. */
int
reg_classes_intersect_p (enum reg_class c1, enum reg_class c2)
{
- HARD_REG_SET c;
-
- if (c1 == c2) return 1;
-
- if (c1 == ALL_REGS || c2 == ALL_REGS)
- return 1;
-
- COPY_HARD_REG_SET (c, reg_class_contents[(int) c1]);
- AND_HARD_REG_SET (c, reg_class_contents[(int) c2]);
-
- GO_IF_HARD_REG_SUBSET (c, reg_class_contents[(int) NO_REGS], lose);
- return 1;
-
- lose:
- return 0;
+ return (c1 == c2
+ || c1 == ALL_REGS
+ || c2 == ALL_REGS
+ || hard_reg_set_intersect_p (reg_class_contents[(int) c1],
+ reg_class_contents[(int) c2]));
}
#ifdef CANNOT_CHANGE_MODE_CLASS
AND_HARD_REG_SET (chain->used_spill_regs, used_spill_regs);
/* Make sure we only enlarge the set. */
- GO_IF_HARD_REG_SUBSET (used_by_pseudos2, chain->used_spill_regs, ok);
- gcc_unreachable ();
- ok:;
+ gcc_assert (hard_reg_set_subset_p (used_by_pseudos2,
+ chain->used_spill_regs));
}
}
SET_HARD_REG_BIT (i2_regset, regno);
}
- GO_IF_HARD_REG_EQUAL (i1_regset, i2_regset, done);
-
- return false;
-
- done:
- ;
+ if (!hard_reg_set_equal_p (i1_regset, i2_regset))
+ return false;
}
#endif
return true;