aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Hayes <m.hayes@elec.canterbury.ac.nz>2000-03-23 22:15:46 +0000
committerMichael Hayes <m.hayes@gcc.gnu.org>2000-03-23 22:15:46 +0000
commitcf92d7df1e41e30f234fb58ec575335113233a29 (patch)
tree57cfcca15c8ea370dacd238a58b8eeb4849165aa
parent25a1fcb433c7e1aef52102292a77483753418e32 (diff)
downloadgcc-cf92d7df1e41e30f234fb58ec575335113233a29.zip
gcc-cf92d7df1e41e30f234fb58ec575335113233a29.tar.gz
gcc-cf92d7df1e41e30f234fb58ec575335113233a29.tar.bz2
Clobber DP reg in case address needs to be loaded out of memory.
* config/c4x/c4x.md (load_immed_address): Add DP reg clobber. From-SVN: r32717
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/config/c4x/c4x.md34
2 files changed, 29 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 45bfc37..d4128b0 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+2000-03-24 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
+
+ * config/c4x/c4x.md (load_immed_address): Add DP reg clobber.
+
Thu Mar 23 17:10:48 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* calls.c (expand_call): If TARGET is passed by reference and
diff --git a/gcc/config/c4x/c4x.md b/gcc/config/c4x/c4x.md
index 9d58f32..89fe2d0 100644
--- a/gcc/config/c4x/c4x.md
+++ b/gcc/config/c4x/c4x.md
@@ -1245,13 +1245,35 @@
operands[5] = c4x_operand_subword (operands[1], 1, 1, HImode);
}")
+
+; We need to clobber the DP reg to be safe in case we
+; need to load this address from memory
+(define_insn "load_immed_address"
+ [(set (match_operand:QI 0 "reg_operand" "=a?x?c*r")
+ (match_operand:QI 1 "symbolic_address_operand" ""))
+ (clobber (reg:QI 16))]
+ "TARGET_LOAD_ADDRESS"
+ "#"
+ [(set_attr "type" "multi")])
+
+
+(define_split
+ [(set (match_operand:QI 0 "std_reg_operand" "")
+ (match_operand:QI 1 "symbolic_address_operand" ""))
+ (clobber (reg:QI 16))]
+ "! TARGET_C3X && ! TARGET_TI"
+ [(set (match_dup 0) (high:QI (match_dup 1)))
+ (set (match_dup 0) (lo_sum:QI (match_dup 0) (match_dup 1)))]
+ "")
+
; CC has been selected to load a symbolic address. We force the address
; into memory and then generate LDP and LDIU insns.
; This is also required for the C30 if we pretend that we can
; easily load symbolic addresses into a register.
(define_split
[(set (match_operand:QI 0 "reg_operand" "")
- (match_operand:QI 1 "symbolic_address_operand" ""))]
+ (match_operand:QI 1 "symbolic_address_operand" ""))
+ (clobber (reg:QI 16))]
"! TARGET_SMALL
&& (TARGET_C3X || TARGET_TI
|| (reload_completed
@@ -1274,7 +1296,8 @@
; for the small memory model.
(define_split
[(set (match_operand:QI 0 "reg_operand" "")
- (match_operand:QI 1 "symbolic_address_operand" ""))]
+ (match_operand:QI 1 "symbolic_address_operand" ""))
+ (clobber (reg:QI 16))]
"TARGET_SMALL
&& (TARGET_C3X || TARGET_TI
|| (reload_completed
@@ -1290,13 +1313,6 @@
XEXP (operands[2], 0)));
}")
-(define_insn "load_immed_address"
- [(set (match_operand:QI 0 "reg_operand" "=a?x?c*r")
- (match_operand:QI 1 "symbolic_address_operand" ""))]
- "TARGET_LOAD_ADDRESS"
- "#"
- [(set_attr "type" "multi")])
-
(define_insn "loadhi_big_constant"
[(set (match_operand:HI 0 "reg_operand" "=c*d")
(match_operand:HI 1 "const_int_operand" ""))]