]> gcc.gnu.org Git - gcc.git/commitdiff
pa.md (millicode expands): Change operand 3 in the expand pattern from a clobber...
authorJeff Law <law@gcc.gnu.org>
Wed, 6 Jan 1993 17:22:10 +0000 (10:22 -0700)
committerJeff Law <law@gcc.gnu.org>
Wed, 6 Jan 1993 17:22:10 +0000 (10:22 -0700)
* pa.md (millicode expands): Change operand 3 in the expand
pattern from a clobber of a match_scratch to a clobber of a
match_operand with a register predicate.  Make appropriate
change in the generated RTL.
(millicode insns): Clobber a match_operand with a register
predicate instead of a match_scratch expression.
* pa.c (emit_hpdiv_const): Likewise.

* pa.md (movsi, movhi, movqi, movdi): Use reg_or_0_operand
consistently.

From-SVN: r3121

gcc/config/pa/pa.md

index 6c4740d78f412241427a22084030dfa2697464ef..f249259e9237b9a6eace090a19099c514a95f1c9 100644 (file)
                          "=r,r,Q,!r,!fx,!fx")
        (match_operand:SI 1 "move_operand" "rM,Q,rM,!fxy,!r,!fx"))]
   "register_operand (operands[0], SImode)
-   || register_operand (operands[1], SImode)
-   || operands[1] == const0_rtx"
+   || reg_or_0_operand (operands[1], SImode)"
   "@
    copy %r1,%0
    ldw%M1 %1,%0
   [(set (match_operand:HI 0 "reg_or_nonsymb_mem_operand" "=r,r,Q,!r,!*fx,!*fx")
        (match_operand:HI 1 "move_operand" "rM,Q,rM,*fx,r,!*fx"))]
   "register_operand (operands[0], HImode)
-   || register_operand (operands[1], HImode)
-   || operands[1] == const0_rtx"
+   || reg_or_0_operand (operands[1], HImode)"
   "@
    copy %r1,%0
    ldh%M1 %1,%0
   [(set (match_operand:QI 0 "reg_or_nonsymb_mem_operand" "=r,r,Q,!r,!*fx,!*fx")
        (match_operand:QI 1 "move_operand" "rM,Q,rM,*fx,r,*fx"))]
   "register_operand (operands[0], QImode)
-   || register_operand (operands[1], QImode)
-   || operands[1] == const0_rtx"
+   || reg_or_0_operand (operands[1], QImode)"
   "@
    copy %r1,%0
    ldb%M1 %1,%0
        (match_operand:DI 1 "general_operand"
                          "r,r,Q,i,r,fx,fx"))]
   "register_operand (operands[0], DImode)
-   || register_operand (operands[1], DImode)
-   || operands[1] == const0_rtx"
+   || reg_or_0_operand (operands[1], DImode)"
   "*
 {
   if (FP_REG_P (operands[0]) || FP_REG_P (operands[1]))
    sub %1,%2,%0
    subi %1,%2,%0")
 
-;; The mulsi3 insns set up registers for the millicode call.
+;; Clobbering a "register_operand" instead of a match_scratch
+;; in operand3 of millicode calls avoids spilling %r1 and
+;; produces better code.
 
+;; The mulsi3 insns set up registers for the millicode call.
 (define_expand "mulsi3"
   [(set (reg:SI 26) (match_operand:SI 1 "srcsi_operand" ""))
    (set (reg:SI 25) (match_operand:SI 2 "srcsi_operand" ""))
    (parallel [(set (reg:SI 29) (mult:SI (reg:SI 26) (reg:SI 25)))
-             (clobber (match_scratch:SI 3 ""))
+             (clobber (match_operand:SI 3 "register_operand" ""))
              (clobber (reg:SI 26))
              (clobber (reg:SI 25))
              (clobber (reg:SI 31))])
                          gen_rtx (SUBREG, SImode, scratch, 1)));
       DONE;
     }
+  operands[3] = gen_reg_rtx(SImode);
 }")
 
 (define_insn "umulsidi3"
 
 (define_insn ""
   [(set (reg:SI 29) (mult:SI (reg:SI 26) (reg:SI 25)))
-   (clobber (match_scratch:SI 0 "=a"))
+   (clobber (match_operand:SI 0 "register_operand" "=a"))
    (clobber (reg:SI 26))
    (clobber (reg:SI 25))
    (clobber (reg:SI 31))]
   [(set_attr "type" "milli")])
 
 ;;; Division and mod.
-
 (define_expand "divsi3"
   [(set (reg:SI 26) (match_operand:SI 1 "srcsi_operand" ""))
    (set (reg:SI 25) (match_operand:SI 2 "srcsi_operand" ""))
    (parallel [(set (reg:SI 29) (div:SI (reg:SI 26) (reg:SI 25)))
-             (clobber (match_scratch:SI 3 ""))
+             (clobber (match_operand:SI 3 "register_operand" ""))
              (clobber (reg:SI 26))
              (clobber (reg:SI 25))
              (clobber (reg:SI 31))])
   ""
   "
 {
+  operands[3] = gen_reg_rtx(SImode);
   if (!(GET_CODE (operands[2]) == CONST_INT && emit_hpdiv_const(operands, 0)))
     {
       emit_move_insn (gen_rtx (REG, SImode, 26), operands[1]);
                                 gen_rtx (DIV, SImode,
                                          gen_rtx (REG, SImode, 26),
                                          gen_rtx (REG, SImode, 25))),
-                    gen_rtx (CLOBBER, VOIDmode, gen_rtx (SCRATCH, SImode, 0)),
+                    gen_rtx (CLOBBER, VOIDmode, operands[3]),
                     gen_rtx (CLOBBER, VOIDmode, gen_rtx (REG, SImode, 26)),
                     gen_rtx (CLOBBER, VOIDmode, gen_rtx (REG, SImode, 25)),
                     gen_rtx (CLOBBER, VOIDmode, gen_rtx (REG, SImode, 31)))));
 (define_insn ""
   [(set (reg:SI 29)
     (div:SI (reg:SI 26) (match_operand:SI 0 "div_operand" "")))
-   (clobber (match_scratch:SI 1 "=a"))
+   (clobber (match_operand:SI 1 "register_operand" "=a"))
    (clobber (reg:SI 26))
    (clobber (reg:SI 25))
    (clobber (reg:SI 31))]
   [(set (reg:SI 26) (match_operand:SI 1 "srcsi_operand" ""))
    (set (reg:SI 25) (match_operand:SI 2 "srcsi_operand" ""))
    (parallel [(set (reg:SI 29) (udiv:SI (reg:SI 26) (reg:SI 25)))
-             (clobber (match_scratch:SI 3 ""))
+             (clobber (match_operand:SI 3 "register_operand" ""))
              (clobber (reg:SI 26))
              (clobber (reg:SI 25))
              (clobber (reg:SI 31))])
   ""
   "
 {
+  operands[3] = gen_reg_rtx(SImode);
   if (!(GET_CODE (operands[2]) == CONST_INT && emit_hpdiv_const(operands, 1)))
     {
       emit_move_insn (gen_rtx (REG, SImode, 26), operands[1]);
                                 gen_rtx (UDIV, SImode,
                                          gen_rtx (REG, SImode, 26),
                                          gen_rtx (REG, SImode, 25))),
-                    gen_rtx (CLOBBER, VOIDmode, gen_rtx (SCRATCH, SImode, 0)),
+                    gen_rtx (CLOBBER, VOIDmode, operands[3]), 
                     gen_rtx (CLOBBER, VOIDmode, gen_rtx (REG, SImode, 26)),
                     gen_rtx (CLOBBER, VOIDmode, gen_rtx (REG, SImode, 25)),
                     gen_rtx (CLOBBER, VOIDmode, gen_rtx (REG, SImode, 31)))));
 (define_insn ""
   [(set (reg:SI 29)
     (udiv:SI (reg:SI 26) (match_operand:SI 0 "div_operand" "")))
-   (clobber (match_scratch:SI 1 "=a"))
+   (clobber (match_operand:SI 1 "register_operand" "=a"))
    (clobber (reg:SI 26))
    (clobber (reg:SI 25))
    (clobber (reg:SI 31))]
   [(set (reg:SI 26) (match_operand:SI 1 "srcsi_operand" ""))
    (set (reg:SI 25) (match_operand:SI 2 "srcsi_operand" ""))
    (parallel [(set (reg:SI 29) (mod:SI (reg:SI 26) (reg:SI 25)))
-             (clobber (match_scratch:SI 3 ""))
+             (clobber (match_operand:SI 3 "register_operand" ""))
              (clobber (reg:SI 26))
              (clobber (reg:SI 25))
              (clobber (reg:SI 31))])
   ""
   "
 {
+  operands[3] = gen_reg_rtx(SImode);
   emit_move_insn (gen_rtx (REG, SImode, 26), operands[1]);
   emit_move_insn (gen_rtx (REG, SImode, 25), operands[2]);
   emit
                             gen_rtx (MOD, SImode,
                                      gen_rtx (REG, SImode, 26),
                                      gen_rtx (REG, SImode, 25))),
-                gen_rtx (CLOBBER, VOIDmode, gen_rtx (SCRATCH, SImode, 0)),
+                gen_rtx (CLOBBER, VOIDmode, operands[3]), 
                 gen_rtx (CLOBBER, VOIDmode, gen_rtx (REG, SImode, 26)),
                 gen_rtx (CLOBBER, VOIDmode, gen_rtx (REG, SImode, 25)),
                 gen_rtx (CLOBBER, VOIDmode, gen_rtx (REG, SImode, 31)))));
 
 (define_insn ""
   [(set (reg:SI 29) (mod:SI (reg:SI 26) (reg:SI 25)))
-   (clobber (match_scratch:SI 0 "=a"))
+   (clobber (match_operand:SI 0 "register_operand" "=a"))
    (clobber (reg:SI 26))
    (clobber (reg:SI 25))
    (clobber (reg:SI 31))]
   [(set (reg:SI 26) (match_operand:SI 1 "srcsi_operand" ""))
    (set (reg:SI 25) (match_operand:SI 2 "srcsi_operand" ""))
    (parallel [(set (reg:SI 29) (umod:SI (reg:SI 26) (reg:SI 25)))
-             (clobber (match_scratch:SI 3 ""))
+             (clobber (match_operand:SI 3 "register_operand" ""))
              (clobber (reg:SI 26))
              (clobber (reg:SI 25))
              (clobber (reg:SI 31))])
   ""
   "
 {
+  operands[3] = gen_reg_rtx(SImode);
   emit_move_insn (gen_rtx (REG, SImode, 26), operands[1]);
   emit_move_insn (gen_rtx (REG, SImode, 25), operands[2]);
   emit
                             gen_rtx (UMOD, SImode,
                                      gen_rtx (REG, SImode, 26),
                                      gen_rtx (REG, SImode, 25))),
-                gen_rtx (CLOBBER, VOIDmode, gen_rtx (SCRATCH, SImode, 0)),
+                gen_rtx (CLOBBER, VOIDmode, operands[3]), 
                 gen_rtx (CLOBBER, VOIDmode, gen_rtx (REG, SImode, 26)),
                 gen_rtx (CLOBBER, VOIDmode, gen_rtx (REG, SImode, 25)),
                 gen_rtx (CLOBBER, VOIDmode, gen_rtx (REG, SImode, 31)))));
 
 (define_insn ""
   [(set (reg:SI 29) (umod:SI (reg:SI 26) (reg:SI 25)))
-   (clobber (match_scratch:SI 0 "=a"))
+   (clobber (match_operand:SI 0 "register_operand" "=a"))
    (clobber (reg:SI 26))
    (clobber (reg:SI 25))
    (clobber (reg:SI 31))]
This page took 0.075024 seconds and 5 git commands to generate.