aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMichael Hayes <m.hayes@elec.canterbury.ac.nz>1999-02-08 14:50:03 +0000
committerMichael Hayes <m.hayes@gcc.gnu.org>1999-02-08 14:50:03 +0000
commitb2e9a2fdc876ea464044c9e2338313cff1a4a679 (patch)
tree1271eaa03ac0eb1486c3dea126ddd354cf9aaa6a /gcc
parent55310df79f85c115160cbf9dc505f8ca5df10fd4 (diff)
downloadgcc-b2e9a2fdc876ea464044c9e2338313cff1a4a679.zip
gcc-b2e9a2fdc876ea464044c9e2338313cff1a4a679.tar.gz
gcc-b2e9a2fdc876ea464044c9e2338313cff1a4a679.tar.bz2
c4x.md (all call patterns): Add constraints "Ur".
* config/c4x/c4x.md (all call patterns): Add constraints "Ur". (call, call_value): Force address into a register if not valid for a call instruction. (load_immed_address): Emit a USE of the SYMBOL_REF that is forced into memory. * config/c4x/c4x.c (c4x_print_operand): Fix 'C' and 'U' modifiers. From-SVN: r25090
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/config/c4x/c4x.c10
-rw-r--r--gcc/config/c4x/c4x.md41
3 files changed, 38 insertions, 22 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 131551e..8d18280 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,12 @@
+Tue Feb 9 11:34:15 1999 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
+
+ * config/c4x/c4x.md (all call patterns): Add constraints "Ur".
+ (call, call_value): Force address into a register if not valid
+ for a call instruction.
+ (load_immed_address): Emit a USE of the SYMBOL_REF that is
+ forced into memory.
+ * config/c4x/c4x.c (c4x_print_operand): Fix 'C' and 'U' modifiers.
+
Tue Feb 9 11:08:41 1999 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* config/c4x/c4x.c (call_address_operand, symbolic_address_operand):
diff --git a/gcc/config/c4x/c4x.c b/gcc/config/c4x/c4x.c
index 878eb1e..d12d985 100644
--- a/gcc/config/c4x/c4x.c
+++ b/gcc/config/c4x/c4x.c
@@ -1701,16 +1701,10 @@ c4x_print_operand (file, op, letter)
return;
case 'C': /* call */
- if (code != MEM)
- fatal_insn ("c4x_print_operand: %%C inconsistency", op);
- op = XEXP (op, 0);
- code = GET_CODE (op);
break;
case 'U': /* call/callu */
- if (code != MEM)
- fatal_insn ("c4x_print_operand: %%U inconsistency", op);
- if (GET_CODE (XEXP (op, 0)) != SYMBOL_REF)
+ if (code != SYMBOL_REF)
asm_fprintf (file, "u");
return;
@@ -2100,7 +2094,7 @@ c4x_process_after_reload (first)
if (1)
{
- char *template;
+ const char *template;
template = insn_template[insn_code_number];
if (template && template[0] == '#' && template[1] == '\0')
diff --git a/gcc/config/c4x/c4x.md b/gcc/config/c4x/c4x.md
index 7890cca..3d7b0f7 100644
--- a/gcc/config/c4x/c4x.md
+++ b/gcc/config/c4x/c4x.md
@@ -1158,14 +1158,15 @@
"TARGET_SMALL
&& (TARGET_C3X || (reload_completed
&& ! std_reg_operand (operands[0], QImode)))"
- [(set (match_dup 0) (match_dup 1))]
+ [(set (match_dup 0) (match_dup 2))
+ (use (match_dup 1))]
"
{
rtx dp_reg = gen_rtx_REG (Pmode, DP_REGNO);
- operands[1] = force_const_mem (Pmode, operands[1]);
- operands[1] = change_address (operands[1], QImode,
+ operands[2] = force_const_mem (Pmode, operands[1]);
+ operands[2] = change_address (operands[2], QImode,
gen_rtx_LO_SUM (Pmode, dp_reg,
- XEXP (operands[1], 0)));
+ XEXP (operands[2], 0)));
}")
(define_insn "load_immed_address"
@@ -4355,7 +4356,7 @@
; CALL
;
(define_insn "*call_c3x"
- [(call (mem:QI (match_operand:QI 0 "call_address_operand" ""))
+ [(call (mem:QI (match_operand:QI 0 "call_address_operand" "Ur"))
(match_operand:QI 1 "general_operand" ""))
(clobber (reg:QI 31))]
;; Operand 1 not really used on the C4x. The C30 doesn't have reg 31.
@@ -4366,7 +4367,7 @@
; LAJ requires R11 (31) for the return address
(define_insn "*laj"
- [(call (mem:QI (match_operand:QI 0 "call_address_operand" ""))
+ [(call (mem:QI (match_operand:QI 0 "call_address_operand" "Ur"))
(match_operand:QI 1 "general_operand" ""))
(clobber (reg:QI 31))]
;; Operand 1 not really used on the C4x.
@@ -4380,15 +4381,21 @@
[(set_attr "type" "laj")])
(define_expand "call"
- [(parallel [(call (mem:QI (match_operand:QI 0 "call_address_operand" ""))
+ [(parallel [(call (match_operand:QI 0 "" "")
(match_operand:QI 1 "general_operand" ""))
(clobber (reg:QI 31))])]
""
- "")
+ "
+{
+ if (GET_CODE (operands[0]) == MEM
+ && ! call_address_operand (XEXP (operands[0], 0), Pmode))
+ operands[0] = gen_rtx_MEM (GET_MODE (operands[0]),
+ force_reg (Pmode, XEXP (operands[0], 0)));
+}")
(define_insn "*callv_c3x"
[(set (match_operand 0 "" "=r")
- (call (mem:QI (match_operand:QI 1 "call_address_operand" ""))
+ (call (mem:QI (match_operand:QI 1 "call_address_operand" "Ur"))
(match_operand:QI 2 "general_operand" "")))
(clobber (reg:QI 31))]
;; Operand 0 and 2 not really used for the C4x.
@@ -4401,7 +4408,7 @@
; LAJ requires R11 (31) for the return address
(define_insn "*lajv"
[(set (match_operand 0 "" "=r")
- (call (mem:QI (match_operand:QI 1 "call_address_operand" ""))
+ (call (mem:QI (match_operand:QI 1 "call_address_operand" "Ur"))
(match_operand:QI 2 "general_operand" "")))
(clobber (reg:QI 31))]
;; Operand 0 and 2 not really used in the C30 instruction.
@@ -4416,11 +4423,17 @@
(define_expand "call_value"
[(parallel [(set (match_operand 0 "" "")
- (call (mem:QI (match_operand:QI 1 "call_address_operand" ""))
+ (call (match_operand:QI 1 "" "")
(match_operand:QI 2 "general_operand" "")))
(clobber (reg:QI 31))])]
""
- "")
+ "
+{
+ if (GET_CODE (operands[0]) == MEM
+ && ! call_address_operand (XEXP (operands[1], 0), Pmode))
+ operands[0] = gen_rtx_MEM (GET_MODE (operands[1]),
+ force_reg (Pmode, XEXP (operands[1], 0)));
+}")
(define_insn "return"
[(return)]
@@ -6229,7 +6242,7 @@
(return)]
"c4x_null_epilogue_p ()"
"*
- if (GET_CODE (XEXP (operands[0], 0)) == REG)
+ if (REG_P (operands[0]))
return \"bu%#\\t%C0\";
else
return \"br%#\\t%C0\";"
@@ -6243,7 +6256,7 @@
(return)]
"c4x_null_epilogue_p ()"
"*
- if (GET_CODE (XEXP (operands[1], 0)) == REG)
+ if (REG_P (operands[1]))
return \"bu%#\\t%C1\";
else
return \"br%#\\t%C1\";"