"COMPL_HARD_REG_SET (x, y)" becomes "x = ~y".
2019-09-09 Richard Sandiford <richard.sandiford@arm.com>
gcc/
* hard-reg-set.h (HARD_REG_SET::operator~): New function.
(COMPL_HARD_REG_SET): Delete.
* config/c6x/c6x.c (c6x_call_saved_register_used): Use ~ instead
of COMPL_HARD_REG_SET.
(try_rename_operands): Likewise.
* config/sh/sh.c (push_regs): Likewise.
* lra-assigns.c (find_hard_regno_for_1): Likewise.
* lra-constraints.c (contains_reg_p): Likewise.
* reload1.c (finish_spills, choose_reload_regs_init): Likewise.
From-SVN: r275529
2019-09-09 Richard Sandiford <richard.sandiford@arm.com>
+ * hard-reg-set.h (HARD_REG_SET::operator~): New function.
+ (COMPL_HARD_REG_SET): Delete.
+ * config/c6x/c6x.c (c6x_call_saved_register_used): Use ~ instead
+ of COMPL_HARD_REG_SET.
+ (try_rename_operands): Likewise.
+ * config/sh/sh.c (push_regs): Likewise.
+ * lra-assigns.c (find_hard_regno_for_1): Likewise.
+ * lra-constraints.c (contains_reg_p): Likewise.
+ * reload1.c (finish_spills, choose_reload_regs_init): Likewise.
+
+2019-09-09 Richard Sandiford <richard.sandiford@arm.com>
+
* hard-reg-set.h (COPY_HARD_REG_SET): Delete.
* caller-save.c (save_call_clobbered_regs): Use assignment instead
of COPY_HARD_REG_SET.
INIT_CUMULATIVE_ARGS (cum_v, NULL, NULL, 0, 0);
cum = pack_cumulative_args (&cum_v);
- COMPL_HARD_REG_SET (call_saved_regset, call_used_reg_set);
+ call_saved_regset = ~call_used_reg_set;
for (i = 0; i < call_expr_nargs (call_expr); i++)
{
parameter = CALL_EXPR_ARG (call_expr, i);
}
/* If we get here, we can do the renaming. */
- COMPL_HARD_REG_SET (unavailable, reg_class_contents[(int) super_class]);
+ unavailable = ~reg_class_contents[super_class];
old_reg = this_head->regno;
best_reg =
if (i == FIRST_FP_REG && interrupt_handler && TARGET_FMOVD
&& hard_reg_set_intersect_p (*mask, reg_class_contents[DF_REGS]))
{
- HARD_REG_SET unsaved;
-
push (FPSCR_REG);
- COMPL_HARD_REG_SET (unsaved, *mask);
- fpscr_set_from_mem (NORMAL_MODE (FP_MODE), unsaved);
+ fpscr_set_from_mem (NORMAL_MODE (FP_MODE), ~*mask);
skip_fpscr = true;
}
if (i != PR_REG
struct HARD_REG_SET
{
+ HARD_REG_SET
+ operator~ () const
+ {
+ HARD_REG_SET res;
+ for (unsigned int i = 0; i < ARRAY_SIZE (elts); ++i)
+ res.elts[i] = ~elts[i];
+ return res;
+ }
+
HARD_REG_ELT_TYPE elts[HARD_REG_SET_LONGS];
};
typedef const HARD_REG_SET &const_hard_reg_set;
CLEAR_HARD_REG_SET and SET_HARD_REG_SET.
These take just one argument.
- Also define macros for copying the complement of a hard reg set:
- COMPL_HARD_REG_SET.
- This takes two arguments TO and FROM; it reads from FROM
- and stores into TO.
-
Also define macros for combining hard reg sets:
IOR_HARD_REG_SET and AND_HARD_REG_SET.
These take two arguments TO and FROM; they read from FROM
#define CLEAR_HARD_REG_SET(TO) ((TO) = HARD_CONST (0))
#define SET_HARD_REG_SET(TO) ((TO) = ~ HARD_CONST (0))
-#define COMPL_HARD_REG_SET(TO, FROM) ((TO) = ~(FROM))
-
#define IOR_HARD_REG_SET(TO, FROM) ((TO) |= (FROM))
#define IOR_COMPL_HARD_REG_SET(TO, FROM) ((TO) |= ~ (FROM))
#define AND_HARD_REG_SET(TO, FROM) ((TO) &= (FROM))
}
inline void
-COMPL_HARD_REG_SET (HARD_REG_SET &to, const_hard_reg_set from)
-{
- for (unsigned int i = 0; i < ARRAY_SIZE (to.elts); ++i)
- to.elts[i] = ~from.elts[i];
-}
-
-inline void
AND_HARD_REG_SET (HARD_REG_SET &to, const_hard_reg_set from)
{
for (unsigned int i = 0; i < ARRAY_SIZE (to.elts); ++i)
conflict_set = lra_no_alloc_regs;
else
{
- COMPL_HARD_REG_SET (conflict_set, regno_set);
+ conflict_set = ~regno_set;
IOR_HARD_REG_SET (conflict_set, lra_no_alloc_regs);
}
rclass = regno_allocno_class_array[regno];
regno = lra_get_regno_hard_regno (regno);
if (regno < 0)
return false;
- COMPL_HARD_REG_SET (alloc_regs, lra_no_alloc_regs);
+ alloc_regs = ~lra_no_alloc_regs;
return overlaps_hard_reg_set_p (alloc_regs, GET_MODE (x), regno);
}
else
may be not included in the value calculated here because
of possible removing caller-saves insns (see function
delete_caller_save_insns. */
- COMPL_HARD_REG_SET (chain->used_spill_regs, used_by_pseudos);
+ chain->used_spill_regs = ~used_by_pseudos;
AND_HARD_REG_SET (chain->used_spill_regs, used_spill_regs);
}
}
CLEAR_HARD_REG_SET (reload_reg_used_in_outaddr_addr[i]);
}
- COMPL_HARD_REG_SET (reload_reg_unavailable, chain->used_spill_regs);
+ reload_reg_unavailable = ~chain->used_spill_regs;
CLEAR_HARD_REG_SET (reload_reg_used_for_inherit);