2002-04-12 Jan Hubicka <jh@suse.cz>
authordje <dje@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 12 Apr 2002 16:57:47 +0000 (16:57 +0000)
committerdje <dje@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 12 Apr 2002 16:57:47 +0000 (16:57 +0000)
            David Edelsohn  <edelsohn@gnu.org>

        * config/rs6000/rs6000.c (call_operand): Allow LINK and COUNT
        registers.
        (symbol_ref_operand): New.
        * config/rs6000/rs6000.h (PREDICATE_CODES): Add symbol_ref_operand.
        * config/rs6000/rs6000.md (call_nonlocal_aix): Use symbol_ref_operand.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@52231 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/rs6000/rs6000.c
gcc/config/rs6000/rs6000.h
gcc/config/rs6000/rs6000.md

index 6d15983..e875ba8 100644 (file)
@@ -1,3 +1,12 @@
+2002-04-12  Jan Hubicka  <jh@suse.cz>
+           David Edelsohn  <edelsohn@gnu.org>
+
+       * config/rs6000/rs6000.c (call_operand): Allow LINK and COUNT
+       registers.
+       (symbol_ref_operand): New.
+       * config/rs6000/rs6000.h (PREDICATE_CODES): Add symbol_ref_operand.
+       * config/rs6000/rs6000.md (call_nonlocal_aix): Use symbol_ref_operand.
+
 2002-04-12  Andreas Schwab  <schwab@suse.de>
 
        * config/ia64/ia64.h (ASM_SPEC): Moved from here ...
index dd317b4..99e7af6 100644 (file)
@@ -1552,9 +1552,21 @@ lwa_operand (op, mode)
            || INTVAL (XEXP (XEXP (inner, 0), 1)) % 4 == 0));
 }
 
+/* Return 1 if the operand, used inside a MEM, is a SYMBOL_REF.  */
+
+int
+symbol_ref_operand (op, mode)
+     rtx op;
+     enum machine_mode mode;
+{
+  if (mode != VOIDmode && GET_MODE (op) != mode)
+    return 0;
+
+  return (GET_CODE (op) == SYMBOL_REF);
+}
+
 /* Return 1 if the operand, used inside a MEM, is a valid first argument
-   to CALL.  This is a SYMBOL_REF or a pseudo-register, which will be
-   forced to lr.  */
+   to CALL.  This is a SYMBOL_REF, a pseudo-register, LR or CTR.  */
 
 int
 call_operand (op, mode)
@@ -1565,7 +1577,10 @@ call_operand (op, mode)
     return 0;
 
   return (GET_CODE (op) == SYMBOL_REF
-         || (GET_CODE (op) == REG && REGNO (op) >= FIRST_PSEUDO_REGISTER));
+         || (GET_CODE (op) == REG
+             && (REGNO (op) == LINK_REGISTER_REGNUM
+                 || REGNO (op) == COUNT_REGISTER_REGNUM
+                 || REGNO (op) >= FIRST_PSEUDO_REGISTER)));
 }
 
 /* Return 1 if the operand is a SYMBOL_REF for a function known to be in
index 54725c5..95d5143 100644 (file)
@@ -2771,6 +2771,7 @@ extern char rs6000_reg_names[][8];        /* register names (0 vs. %r0).  */
   {"mask64_operand", {CONST_INT, CONST_DOUBLE}},                          \
   {"count_register_operand", {REG}},                                      \
   {"xer_operand", {REG}},                                                 \
+  {"symbol_ref_operand", {SYMBOL_REF}},                                           \
   {"call_operand", {SYMBOL_REF, REG}},                                    \
   {"current_file_function_operand", {SYMBOL_REF}},                        \
   {"input_operand", {SUBREG, MEM, REG, CONST_INT,                         \
index 53a03a4..46df793 100644 (file)
    (set_attr "length" "8")])
 
 (define_insn "*call_nonlocal_aix32"
-  [(call (mem:SI (match_operand:SI 0 "call_operand" "s"))
+  [(call (mem:SI (match_operand:SI 0 "symbol_ref_operand" "s"))
         (match_operand 1 "" "g"))
    (use (match_operand:SI 2 "immediate_operand" "O"))
    (clobber (match_scratch:SI 3 "=l"))]
    (set_attr "length" "8")])
 
 (define_insn "*call_nonlocal_aix64"
-  [(call (mem:SI (match_operand:DI 0 "call_operand" "s"))
+  [(call (mem:SI (match_operand:DI 0 "symbol_ref_operand" "s"))
         (match_operand 1 "" "g"))
    (use (match_operand:SI 2 "immediate_operand" "O"))
    (clobber (match_scratch:SI 3 "=l"))]
 
 (define_insn "*call_value_nonlocal_aix32"
   [(set (match_operand 0 "" "")
-       (call (mem:SI (match_operand:SI 1 "call_operand" "s"))
+       (call (mem:SI (match_operand:SI 1 "symbol_ref_operand" "s"))
              (match_operand 2 "" "g")))
    (use (match_operand:SI 3 "immediate_operand" "O"))
    (clobber (match_scratch:SI 4 "=l"))]
 
 (define_insn "*call_value_nonlocal_aix64"
   [(set (match_operand 0 "" "")
-       (call (mem:SI (match_operand:DI 1 "call_operand" "s"))
+       (call (mem:SI (match_operand:DI 1 "symbol_ref_operand" "s"))
              (match_operand 2 "" "g")))
    (use (match_operand:SI 3 "immediate_operand" "O"))
    (clobber (match_scratch:SI 4 "=l"))]