From 2c290e47dcec60124c122dea071b18934b97ae93 Mon Sep 17 00:00:00 2001 From: dje Date: Fri, 12 Apr 2002 16:57:47 +0000 Subject: [PATCH] 2002-04-12 Jan Hubicka David Edelsohn * 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 | 9 +++++++++ gcc/config/rs6000/rs6000.c | 21 ++++++++++++++++++--- gcc/config/rs6000/rs6000.h | 1 + gcc/config/rs6000/rs6000.md | 8 ++++---- 4 files changed, 32 insertions(+), 7 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6d15983c299..e875ba84b36 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2002-04-12 Jan Hubicka + David Edelsohn + + * 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 * config/ia64/ia64.h (ASM_SPEC): Moved from here ... diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index dd317b43210..99e7af6cd30 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 54725c5598c..95d5143cbc3 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 53a03a46eb9..46df7938928 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"))] -- 2.11.0