pa.md (call, call_value): If flag_pic, emit restore of PIC table register.
authorJeff Law <law@gcc.gnu.org>
Sun, 3 Jan 1993 18:58:36 +0000 (11:58 -0700)
committerJeff Law <law@gcc.gnu.org>
Sun, 3 Jan 1993 18:58:36 +0000 (11:58 -0700)
* pa.md (call, call_value): If flag_pic, emit restore of PIC table
register.
(call_interal, call_value_internal): Name matching insns.
(movsi, movhi, movqi, movdi, movsf, movdf patterns): Don't
match memory to memory moves.

From-SVN: r3066

gcc/config/pa/pa.md

index 5ccc83dc5354dfb230e82c0fdbea99f16d1a1ecd..1743b3db1f46eca79bab311a60fadd3dd8c4dd3f 100644 (file)
   [(set (match_operand:SI 0 "reg_or_nonsymb_mem_operand"
                          "=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"
   "@
    copy %r1,%0
    ldw%M1 %1,%0
 (define_insn ""
   [(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"
   "@
    copy %r1,%0
    ldh%M1 %1,%0
 (define_insn ""
   [(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"
   "@
    copy %r1,%0
    ldb%M1 %1,%0
                          "=r,Q,&r,&r,fx,fx,r")
        (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"
   "*
 {
   if (FP_REG_P (operands[0]) || FP_REG_P (operands[1]))
                          "=fx,r,r,fx,fx,r,Q,Q")
        (match_operand:SF 1 "reg_or_nonsymb_mem_operand"
                          "fx,r,!fx,!r,Q,Q,fx,r"))]
-  ""
+  "register_operand (operands[0], SFmode)
+   || register_operand (operands[1], SFmode)"
   "@
    fcpy,sgl %1,%0
    copy %1,%0
  ""
  "
 {
+  rtx op;
+  
   if (TARGET_LONG_CALLS) 
-    operands[0] = gen_rtx (MEM, SImode, 
-                 force_reg (SImode, XEXP (operands[0], 0)));
+    op = force_reg (SImode, XEXP (operands[0], 0));
   else
-    operands[0] = gen_rtx (MEM, SImode, XEXP (operands[0], 0));
+    op = XEXP (operands[0], 0);
+  emit_call_insn (gen_call_internal (op, operands[1]));
+  if (flag_pic)
+    {
+      if (!hppa_save_pic_table_rtx)
+       hppa_save_pic_table_rtx = gen_reg_rtx (Pmode);
+      emit_insn (gen_rtx (SET, VOIDmode,
+                         gen_rtx (REG, Pmode, 19), hppa_save_pic_table_rtx));
+    }
+  DONE;
 }")
 
-(define_insn ""
+(define_insn "call_internal"
  [(call (mem:SI (match_operand:SI 0 "call_operand_address" "r,S"))
        (match_operand 1 "" "i,i"))
   (clobber (reg:SI 31))
   ""
   "
 {
+  rtx op;
+  
   if (TARGET_LONG_CALLS) 
-    operands[1] = gen_rtx (MEM, SImode, 
-                          force_reg (SImode, XEXP (operands[1], 0)));
+    op = force_reg (SImode, XEXP (operands[1], 0));
   else
-    operands[1] = gen_rtx (MEM, SImode, XEXP (operands[1], 0));
+    op = XEXP (operands[1], 0);
+  emit_call_insn (gen_call_value_internal (operands[0], op, operands[2]));
+  if (flag_pic)
+    {
+      if (!hppa_save_pic_table_rtx)
+       hppa_save_pic_table_rtx = gen_reg_rtx (Pmode);
+      emit_insn (gen_rtx (SET, VOIDmode,
+                         gen_rtx (REG, Pmode, 19), hppa_save_pic_table_rtx));
+    }
+  DONE;
 }")
 
-(define_insn ""
+(define_insn "call_value_internal"
   [(set (match_operand 0 "" "=rfx,rfx")
        (call (mem:SI (match_operand:SI 1 "call_operand_address" "r,S"))
              (match_operand 2 "" "i,i")))