]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
sparc.c (sparc_do_work_around_errata): Speed up and use proper constant for the store...
authorEric Botcazou <ebotcazou@adacore.com>
Tue, 18 Mar 2014 10:49:59 +0000 (10:49 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Tue, 18 Mar 2014 10:49:59 +0000 (10:49 +0000)
* config/sparc/sparc.c (sparc_do_work_around_errata): Speed up and use
proper constant for the store mode.

From-SVN: r208639

gcc/ChangeLog
gcc/config/sparc/sparc.c

index 4602749d38165d9949e30a90f8a6d59a4dc8315a..740cf785bc73de3689a228f85a5ac731673fb77a 100644 (file)
@@ -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-17  Mikael Pettersson  <mikpelinux@gmail.com>
            Committed by Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
 
index 829dc70f9a4abdbd5c0978bab2e2ab7475a5b0a7..5353ffa6454d40ca2c2571f1d5f5e6dceb3b2442 100644 (file)
@@ -881,15 +881,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);
@@ -953,11 +953,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.  */
@@ -975,13 +975,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;
            }
        }