diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2014-11-10 19:51:57 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2014-11-10 19:51:57 +0000 |
commit | cc665e5670eee5d0a1170bb93f74e3f58be325cb (patch) | |
tree | 7e032e0f0d5ef9baae3d06af4cbdcbf7e6b29e1d | |
parent | 7e8e4cf945564580bb3dced55d12619a2e48664a (diff) | |
download | gcc-cc665e5670eee5d0a1170bb93f74e3f58be325cb.zip gcc-cc665e5670eee5d0a1170bb93f74e3f58be325cb.tar.gz gcc-cc665e5670eee5d0a1170bb93f74e3f58be325cb.tar.bz2 |
frv.c: Include rtl-iter.h.
gcc/
* config/frv/frv.c: Include rtl-iter.h.
(frv_acc_group_1): Delete.
(frv_acc_group): Use FOR_EACH_SUBRTX.
From-SVN: r217309
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/frv/frv.c | 40 |
2 files changed, 24 insertions, 22 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 67ff64e..505d8cf 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2014-11-10 Richard Sandiford <richard.sandiford@arm.com> + * config/frv/frv.c: Include rtl-iter.h. + (frv_acc_group_1): Delete. + (frv_acc_group): Use FOR_EACH_SUBRTX. + +2014-11-10 Richard Sandiford <richard.sandiford@arm.com> + * config/frv/frv.c: Move include of rtl.h after hard-reg-set.h. (frv_clear_registers_used): Delete. (frv_ifcvt_modify_tests): Use find_all_hard_regs. diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c index 6469708..46ada4c 100644 --- a/gcc/config/frv/frv.c +++ b/gcc/config/frv/frv.c @@ -67,6 +67,7 @@ along with GCC; see the file COPYING3. If not see #include "dumpfile.h" #include "builtins.h" #include "ifcvt.h" +#include "rtl-iter.h" #ifndef FRV_INLINE #define FRV_INLINE inline @@ -338,7 +339,6 @@ static rtx frv_emit_comparison (enum rtx_code, rtx, rtx); static void frv_ifcvt_add_insn (rtx, rtx, int); static rtx frv_ifcvt_rewrite_mem (rtx, machine_mode, rtx); static rtx frv_ifcvt_load_value (rtx, rtx); -static int frv_acc_group_1 (rtx *, void *); static unsigned int frv_insn_unit (rtx_insn *); static bool frv_issues_to_branch_unit_p (rtx_insn *); static int frv_cond_flags (rtx); @@ -7013,33 +7013,29 @@ frv_issue_rate (void) } } -/* A for_each_rtx callback. If X refers to an accumulator, return - ACC_GROUP_ODD if the bit 2 of the register number is set and - ACC_GROUP_EVEN if it is clear. Return 0 (ACC_GROUP_NONE) - otherwise. */ - -static int -frv_acc_group_1 (rtx *x, void *data ATTRIBUTE_UNUSED) -{ - if (REG_P (*x)) - { - if (ACC_P (REGNO (*x))) - return (REGNO (*x) - ACC_FIRST) & 4 ? ACC_GROUP_ODD : ACC_GROUP_EVEN; - if (ACCG_P (REGNO (*x))) - return (REGNO (*x) - ACCG_FIRST) & 4 ? ACC_GROUP_ODD : ACC_GROUP_EVEN; - } - return 0; -} - /* Return the value of INSN's acc_group attribute. */ int frv_acc_group (rtx insn) { /* This distinction only applies to the FR550 packing constraints. */ - if (frv_cpu_type != FRV_CPU_FR550) - return ACC_GROUP_NONE; - return for_each_rtx (&PATTERN (insn), frv_acc_group_1, 0); + if (frv_cpu_type == FRV_CPU_FR550) + { + subrtx_iterator::array_type array; + FOR_EACH_SUBRTX (iter, array, PATTERN (insn), NONCONST) + if (REG_P (*iter)) + { + unsigned int regno = REGNO (*iter); + /* If REGNO refers to an accumulator, return ACC_GROUP_ODD if + the bit 2 of the register number is set and ACC_GROUP_EVEN if + it is clear. */ + if (ACC_P (regno)) + return (regno - ACC_FIRST) & 4 ? ACC_GROUP_ODD : ACC_GROUP_EVEN; + if (ACCG_P (regno)) + return (regno - ACCG_FIRST) & 4 ? ACC_GROUP_ODD : ACC_GROUP_EVEN; + } + } + return ACC_GROUP_NONE; } /* Return the index of the DFA unit in FRV_UNIT_NAMES[] that instruction |