This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[m32c patch] moves to the stack
- From: DJ Delorie <dj at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 15 Aug 2005 20:32:00 -0400
- Subject: [m32c patch] moves to the stack
2005-08-15 DJ Delorie <dj@redhat.com>
* config/m32c/mov.md (movqi_op): Immediates can't be moved to
the stack.
(movsi_splittable): Allow, but split, moves to the stack.
* config/m32c/m32c.c (m32c_split_move): Always split moves to the
stack.
Index: config/m32c/m32c.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/m32c/m32c.c,v
retrieving revision 1.2
diff -p -U3 -r1.2 config/m32c/m32c.c
--- config/m32c/m32c.c 26 Jul 2005 13:53:52 -0000 1.2
+++ config/m32c/m32c.c 16 Aug 2005 00:30:20 -0000
@@ -2663,6 +2663,13 @@ m32c_split_move (rtx * operands, enum ma
debug_rtx (operands[1]);
#endif
+ /* Note that split_all is not used to select the api after this
+ point, so it's safe to set it to 3 even with define_insn. */
+ /* None of the chips can move SI operands to sp-relative addresses,
+ so we always split those. */
+ if (m32c_extra_constraint_p (operands[0], 'S', "Ss"))
+ split_all = 3;
+
/* We don't need to split these. */
if (TARGET_A24
&& split_all != 3
Index: config/m32c/mov.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/m32c/mov.md,v
retrieving revision 1.1
diff -p -U3 -r1.1 config/m32c/mov.md
--- config/m32c/mov.md 20 Jul 2005 23:26:47 -0000 1.1
+++ config/m32c/mov.md 16 Aug 2005 00:30:20 -0000
@@ -33,9 +33,9 @@
;; e.g. stdlib/efgcvt.c.
(define_insn "movqi_op"
[(set (match_operand:QI 0 "mra_qi_operand"
- "=Rqi*Rmm, <, RqiSd*Rmm, SdSs, Rqi*Rmm, Sd")
+ "=Rqi*Rmm, <, RqiSd*Rmm, SdSs, Rqi*Rmm, Sd")
(match_operand:QI 1 "mrai_qi_operand"
- "iRqi*Rmm, iRqiSd*Rmm, >, iRqi*Rmm, SdSs, i"))]
+ "iRqi*Rmm, iRqiSd*Rmm, >, Rqi*Rmm, SdSs, i"))]
"m32c_mov_ok (operands, QImode)"
"@
mov.b\t%1,%0
@@ -168,8 +168,8 @@
; All SI moves are split if TARGET_A16
(define_insn_and_split "movsi_splittable"
- [(set (match_operand:SI 0 "mras_operand" "=Rsi<*Rmm,RsiSd*Rmm")
- (match_operand:SI 1 "mrasi_operand" "iRsiSd*Rmm,iRsi>*Rmm"))]
+ [(set (match_operand:SI 0 "mras_operand" "=Rsi<*Rmm,RsiSd*Rmm,Ss")
+ (match_operand:SI 1 "mrasi_operand" "iRsiSd*Rmm,iRsi>*Rmm,Rsi*Rmm"))]
"TARGET_A16"
"#"
"TARGET_A16 && reload_completed"