aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2002-04-12 18:57:47 +0200
committerDavid Edelsohn <dje@gcc.gnu.org>2002-04-12 12:57:47 -0400
commitcc4d5fec87941feae93ed070482e6c49a5ccf409 (patch)
treec88fc11f8038b8b4d356b75610723a4b4e769286 /gcc
parent2274b9b3fe136cee7184746a64b653d8a537cb67 (diff)
downloadgcc-cc4d5fec87941feae93ed070482e6c49a5ccf409.zip
gcc-cc4d5fec87941feae93ed070482e6c49a5ccf409.tar.gz
gcc-cc4d5fec87941feae93ed070482e6c49a5ccf409.tar.bz2
rs6000.c (call_operand): Allow LINK and COUNT registers.
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. Co-Authored-By: David Edelsohn <edelsohn@gnu.org> From-SVN: r52231
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/config/rs6000/rs6000.c21
-rw-r--r--gcc/config/rs6000/rs6000.h1
-rw-r--r--gcc/config/rs6000/rs6000.md8
4 files changed, 32 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6d15983..e875ba8 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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 ...
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index dd317b4..99e7af6 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -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
diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
index 54725c5..95d5143 100644
--- a/gcc/config/rs6000/rs6000.h
+++ b/gcc/config/rs6000/rs6000.h
@@ -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, \
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 53a03a4..46df793 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -9944,7 +9944,7 @@
(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"))]
@@ -9969,7 +9969,7 @@
(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"))]
@@ -9996,7 +9996,7 @@
(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"))]
@@ -10023,7 +10023,7 @@
(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"))]