]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: pa.md (reload_inhi, [...]): New patterns.
authorJohn David Anglin <dave.anglin@nrc-cnrc.gc.ca>
Fri, 23 Oct 2009 20:15:45 +0000 (20:15 +0000)
committerJohn David Anglin <danglin@gcc.gnu.org>
Fri, 23 Oct 2009 20:15:45 +0000 (20:15 +0000)
Backport from mainline:
2009-08-19  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>

* pa.md (reload_inhi, reload_outhi, reload_inqi, reload_outqi): New
patterns.
* pa.c (emit_move_sequence): Check if address of operand1 is valid
for mode mode of operand0 when doing secondary reload for SAR.

From-SVN: r153514

gcc/ChangeLog
gcc/config/pa/pa.c
gcc/config/pa/pa.md

index 85d4ff694d407837ed3d389a1b8c95c956bd0958..e32dbd38d0cd14992d30da78d9c697562cccf3d4 100644 (file)
@@ -1,3 +1,13 @@
+2009-10-23  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+
+       Backport from mainline:
+       2009-08-19  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+
+       * pa.md (reload_inhi, reload_outhi, reload_inqi, reload_outqi): New
+       patterns.
+       * pa.c (emit_move_sequence): Check if address of operand1 is valid
+       for mode mode of operand0 when doing secondary reload for SAR.
+
 2009-10-20  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
 
         Backport from mainline:
index 57df9f2ff307591c2aca56e22efe3c9c0cf98db6..77597475ef1f1f68df098a6ee882cf244027779f 100644 (file)
@@ -1618,7 +1618,7 @@ emit_move_sequence (rtx *operands, enum machine_mode mode, rtx scratch_reg)
       /* D might not fit in 14 bits either; for such cases load D into
         scratch reg.  */
       if (GET_CODE (operand1) == MEM
-         && !memory_address_p (Pmode, XEXP (operand1, 0)))
+         && !memory_address_p (GET_MODE (operand0), XEXP (operand1, 0)))
        {
          /* We are reloading the address into the scratch register, so we
             want to make sure the scratch register is a full register.  */
index 69fd58a1bb6fdeb147f8ae7bfaf0be0069b4ec92..0bd2e0a4748f5b94d45f9ce09539b41ed95bffa5 100644 (file)
     DONE;
 }")
 
+;; Handle HImode input reloads requiring a general register as a
+;; scratch register.
+(define_expand "reload_inhi"
+  [(set (match_operand:HI 0 "register_operand" "=Z")
+       (match_operand:HI 1 "non_hard_reg_operand" ""))
+   (clobber (match_operand:HI 2 "register_operand" "=&r"))]
+  ""
+  "
+{
+  if (emit_move_sequence (operands, HImode, operands[2]))
+    DONE;
+
+  /* We don't want the clobber emitted, so handle this ourselves.  */
+  emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[1]));
+  DONE;
+}")
+
+;; Handle HImode output reloads requiring a general register as a
+;; scratch register.
+(define_expand "reload_outhi"
+  [(set (match_operand:HI 0 "non_hard_reg_operand" "")
+       (match_operand:HI 1  "register_operand" "Z"))
+   (clobber (match_operand:HI 2 "register_operand" "=&r"))]
+  ""
+  "
+{
+  if (emit_move_sequence (operands, HImode, operands[2]))
+    DONE;
+
+  /* We don't want the clobber emitted, so handle this ourselves.  */
+  emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[1]));
+  DONE;
+}")
+
 (define_insn ""
   [(set (match_operand:HI 0 "move_dest_operand"
                          "=r,r,r,r,r,Q,!*q,!r")
     DONE;
 }")
 
+;; Handle QImode input reloads requiring a general register as a
+;; scratch register.
+(define_expand "reload_inqi"
+  [(set (match_operand:QI 0 "register_operand" "=Z")
+       (match_operand:QI 1 "non_hard_reg_operand" ""))
+   (clobber (match_operand:QI 2 "register_operand" "=&r"))]
+  ""
+  "
+{
+  if (emit_move_sequence (operands, QImode, operands[2]))
+    DONE;
+
+  /* We don't want the clobber emitted, so handle this ourselves.  */
+  emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[1]));
+  DONE;
+}")
+
+;; Handle QImode output reloads requiring a general register as a
+;; scratch register.
+(define_expand "reload_outqi"
+  [(set (match_operand:QI 0 "non_hard_reg_operand" "")
+       (match_operand:QI 1  "register_operand" "Z"))
+   (clobber (match_operand:QI 2 "register_operand" "=&r"))]
+  ""
+  "
+{
+  if (emit_move_sequence (operands, QImode, operands[2]))
+    DONE;
+
+  /* We don't want the clobber emitted, so handle this ourselves.  */
+  emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[1]));
+  DONE;
+}")
+
 (define_insn ""
   [(set (match_operand:QI 0 "move_dest_operand"
                          "=r,r,r,r,r,Q,!*q,!r")