diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2014-03-18 10:49:38 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2014-03-18 10:49:38 +0000 |
commit | e33da4a1131dd198a2fc13b1a839a06397763855 (patch) | |
tree | 0cd17fa846bed6ab3d2c7334ead4caf9b7c3e064 /gcc | |
parent | 1fed15fc7951b67eca06afe1eb573d5213ad41cb (diff) | |
download | gcc-e33da4a1131dd198a2fc13b1a839a06397763855.zip gcc-e33da4a1131dd198a2fc13b1a839a06397763855.tar.gz gcc-e33da4a1131dd198a2fc13b1a839a06397763855.tar.bz2 |
sparc.c (sparc_do_work_around_errata): Speed up and use proper constant for the store mode.
* config/sparc/sparc.c (sparc_do_work_around_errata): Speed up and use
proper constant for the store mode.
From-SVN: r208638
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/config/sparc/sparc.c | 18 |
2 files changed, 14 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2d9e05a..681ec52 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2014-03-18 Eric Botcazou <ebotcazou@adacore.com> + + * config/sparc/sparc.c (sparc_do_work_around_errata): Speed up and use + proper constant for the store mode. + 2014-03-18 Ilya Enkovich <ilya.enkovich@intel.com> * symtab.c (change_decl_assembler_name): Fix transparent alias diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index 134dfd4..12b35f3 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -907,15 +907,15 @@ sparc_do_work_around_errata (void) && REGNO (SET_DEST (set)) % 2 != 0) { /* The wrong dependency is on the enclosing double register. */ - unsigned int x = REGNO (SET_DEST (set)) - 1; + const unsigned int x = REGNO (SET_DEST (set)) - 1; unsigned int src1, src2, dest; int code; - /* If the insn has a delay slot, then it cannot be problematic. */ next = next_active_insn (insn); if (!next) break; - if (NONJUMP_INSN_P (next) && GET_CODE (PATTERN (next)) == SEQUENCE) + /* If the insn is a branch, then it cannot be problematic. */ + if (!NONJUMP_INSN_P (next) || GET_CODE (PATTERN (next)) == SEQUENCE) continue; extract_insn (next); @@ -979,11 +979,11 @@ sparc_do_work_around_errata (void) dependency on the first single-cycle load. */ rtx x = SET_DEST (set); - /* If the insn has a delay slot, then it cannot be problematic. */ next = next_active_insn (insn); if (!next) break; - if (NONJUMP_INSN_P (next) && GET_CODE (PATTERN (next)) == SEQUENCE) + /* If the insn is a branch, then it cannot be problematic. */ + if (!NONJUMP_INSN_P (next) || GET_CODE (PATTERN (next)) == SEQUENCE) continue; /* Look for a second memory access to/from an integer register. */ @@ -1001,13 +1001,13 @@ sparc_do_work_around_errata (void) insert_nop = true; /* STD is *not* affected. */ - else if ((mem = mem_ref (dest)) != NULL_RTX - && GET_MODE_SIZE (GET_MODE (mem)) <= 4 - && (src == const0_rtx + else if (MEM_P (dest) + && GET_MODE_SIZE (GET_MODE (dest)) <= 4 + && (src == CONST0_RTX (GET_MODE (dest)) || (REG_P (src) && REGNO (src) < 32 && REGNO (src) != REGNO (x))) - && !reg_mentioned_p (x, XEXP (mem, 0))) + && !reg_mentioned_p (x, XEXP (dest, 0))) insert_nop = true; } } |