aboutsummaryrefslogtreecommitdiff
path: root/gcc/hard-reg-set.h
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2019-09-09 17:59:14 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2019-09-09 17:59:14 +0000
commitdc333d8ff60909dbed89126443e3024f1592f8a4 (patch)
tree8cb63764fe33068c8b53a63d5441237984aa4aa7 /gcc/hard-reg-set.h
parent50b3f54d551787e0a066451ef60ef3b055a893e6 (diff)
downloadgcc-dc333d8ff60909dbed89126443e3024f1592f8a4.zip
gcc-dc333d8ff60909dbed89126443e3024f1592f8a4.tar.gz
gcc-dc333d8ff60909dbed89126443e3024f1592f8a4.tar.bz2
Remove AND_HARD_REG_SET
Use "x &= y" instead of "AND_HARD_REG_SET (x, y)" (or just "x & y" if the result is a temporary). 2019-09-09 Richard Sandiford <richard.sandiford@arm.com> gcc/ * hard-reg-set.h (HARD_REG_SET::operator&): New function. (HARD_REG_SET::operator&): Likewise. (AND_HARD_REG_SET): Delete. * caller-save.c (setup_save_areas): Use "&" instead of AND_HARD_REG_SET. (save_call_clobbered_regs): Likewise. * config/gcn/gcn.c (gcn_md_reorg): Likewise. * config/m32c/m32c.c (reduce_class): Likewise. * config/rs6000/rs6000.c (rs6000_register_move_cost): Likewise. * final.c (get_call_reg_set_usage): Likewise. * ira-color.c (add_allocno_hard_regs_to_forest): Likewise. (setup_left_conflict_sizes_p): Likewise. * ira-conflicts.c (print_allocno_conflicts): Likewise. (ira_build_conflicts): Likewise. * ira-costs.c (restrict_cost_classes): Likewise. * ira.c (setup_stack_reg_pressure_class, setup_class_translate_array) (setup_reg_class_relations): Likewise. * reginfo.c (init_reg_sets_1, record_subregs_of_mode): Likewise. * reload1.c (maybe_fix_stack_asms, finish_spills): Likewise. * resource.c (find_dead_or_set_registers): Likewise. * sel-sched.c (mark_unavailable_hard_regs): Likewise. From-SVN: r275530
Diffstat (limited to 'gcc/hard-reg-set.h')
-rw-r--r--gcc/hard-reg-set.h33
1 files changed, 21 insertions, 12 deletions
diff --git a/gcc/hard-reg-set.h b/gcc/hard-reg-set.h
index ca663e8..5733782 100644
--- a/gcc/hard-reg-set.h
+++ b/gcc/hard-reg-set.h
@@ -62,6 +62,23 @@ struct HARD_REG_SET
return res;
}
+ HARD_REG_SET
+ operator& (const HARD_REG_SET &other) const
+ {
+ HARD_REG_SET res;
+ for (unsigned int i = 0; i < ARRAY_SIZE (elts); ++i)
+ res.elts[i] = elts[i] & other.elts[i];
+ return res;
+ }
+
+ HARD_REG_SET &
+ operator&= (const HARD_REG_SET &other)
+ {
+ for (unsigned int i = 0; i < ARRAY_SIZE (elts); ++i)
+ elts[i] &= other.elts[i];
+ return *this;
+ }
+
HARD_REG_ELT_TYPE elts[HARD_REG_SET_LONGS];
};
typedef const HARD_REG_SET &const_hard_reg_set;
@@ -92,10 +109,10 @@ struct hard_reg_set_container
CLEAR_HARD_REG_SET and SET_HARD_REG_SET.
These take just one argument.
- 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
- and combine bitwise into TO. Define also two variants
+ Also define a macro for combining hard reg sets:
+ IOR_HARD_REG_SET
+ This takes two arguments TO and FROM; it reads from FROM
+ and combines bitwise into TO. Define also
IOR_COMPL_HARD_REG_SET and AND_COMPL_HARD_REG_SET
which use the complement of the set FROM.
@@ -122,7 +139,6 @@ struct hard_reg_set_container
#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))
#define AND_COMPL_HARD_REG_SET(TO, FROM) ((TO) &= ~ (FROM))
static inline bool
@@ -187,13 +203,6 @@ SET_HARD_REG_SET (HARD_REG_SET &set)
}
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)
- to.elts[i] &= from.elts[i];
-}
-
-inline void
AND_COMPL_HARD_REG_SET (HARD_REG_SET &to, const_hard_reg_set from)
{
for (unsigned int i = 0; i < ARRAY_SIZE (to.elts); ++i)