aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2000-11-23 06:20:16 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2000-11-23 06:20:16 +0000
commit43c05634539cbdb4162ac6e067891e8f01ac2f62 (patch)
treef8110cfbc374f4abd66b6b9a9615c8f25897ba28
parent5e18f6d629b6956b5e669921073fe951f93d1fac (diff)
downloadgcc-43c05634539cbdb4162ac6e067891e8f01ac2f62.zip
gcc-43c05634539cbdb4162ac6e067891e8f01ac2f62.tar.gz
gcc-43c05634539cbdb4162ac6e067891e8f01ac2f62.tar.bz2
sh.md (mova_const): New pattern.
* config/sh/sh.md (mova_const): New pattern. (GOTaddr2picreg): Use it. * config/sh/sh.c (broken_move): Match it. (mova_p): Don't match it. (machine_dependent_reorg): Adjust it. From-SVN: r37690
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/config/sh/sh.c21
-rw-r--r--gcc/config/sh/sh.md13
3 files changed, 31 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3ea935b..3bb689c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+Thu Nov 23 04:10:30 2000 Alexandre Oliva <aoliva@redhat.com>
+
+ * config/sh/sh.md (mova_const): New pattern.
+ (GOTaddr2picreg): Use it.
+ * config/sh/sh.c (broken_move): Match it.
+ (mova_p): Don't match it.
+ (machine_dependent_reorg): Adjust it.
+
Thu Nov 23 02:09:09 2000 Alexandre Oliva <aoliva@redhat.com>
* config/sh/sh.h (FIRST_GENERAL_REG, LAST_GENERAL_REG): New.
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index 8087eda..e41ae32 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -2071,7 +2071,11 @@ broken_move (insn)
/* We can load any 8 bit value if we don't care what the high
order bits end up as. */
&& GET_MODE (SET_DEST (pat)) != QImode
- && CONSTANT_P (SET_SRC (pat))
+ && (CONSTANT_P (SET_SRC (pat))
+ /* Match mova_const. */
+ || (GET_CODE (SET_SRC (pat)) == UNSPEC
+ && XINT (SET_SRC (pat), 1) == UNSPEC_MOVA
+ && GET_CODE (XVECEXP (SET_SRC (pat), 0, 0)) == CONST))
&& ! (TARGET_SH3E
&& GET_CODE (SET_SRC (pat)) == CONST_DOUBLE
&& (fp_zero_operand (SET_SRC (pat))
@@ -2097,7 +2101,9 @@ mova_p (insn)
return (GET_CODE (insn) == INSN
&& GET_CODE (PATTERN (insn)) == SET
&& GET_CODE (SET_SRC (PATTERN (insn))) == UNSPEC
- && XINT (SET_SRC (PATTERN (insn)), 1) == UNSPEC_MOVA);
+ && XINT (SET_SRC (PATTERN (insn)), 1) == UNSPEC_MOVA
+ /* Don't match mova_const. */
+ && XVECEXP (SET_SRC (PATTERN (insn)), 0, 0) == LABEL_REF);
}
/* Find the last barrier from insn FROM which is close enough to hold the
@@ -3280,14 +3286,11 @@ machine_dependent_reorg (first)
XEXP (clobber, 0) = gen_rtx_SCRATCH (Pmode);
}
/* This is a mova needing a label. Create it. */
- else if (GET_CODE (src) == CONST
- && GET_CODE (XEXP (src, 0)) == UNSPEC
- && XINT (XEXP (src, 0), 1) == UNSPEC_MOVA
- && GET_CODE (XVECEXP (XEXP (src, 0),
- 0, 0)) == CONST)
+ else if (GET_CODE (src) == UNSPEC
+ && XINT (src, 1) == UNSPEC_MOVA
+ && GET_CODE (XVECEXP (src, 0, 0)) == CONST)
{
- lab = add_constant (XVECEXP (XEXP (src, 0),
- 0, 0), mode, 0);
+ lab = add_constant (XVECEXP (src, 0, 0), mode, 0);
newsrc = gen_rtx_LABEL_REF (VOIDmode, lab);
newsrc = gen_rtx_UNSPEC (VOIDmode,
gen_rtvec (1, newsrc),
diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md
index c09775e..34649e0 100644
--- a/gcc/config/sh/sh.md
+++ b/gcc/config/sh/sh.md
@@ -3570,10 +3570,19 @@
[(set_attr "in_delay_slot" "no")
(set_attr "type" "arith")])
+;; machine_dependent_reorg() will make this a `mova'.
+(define_insn "mova_const"
+ [(set (reg:SI R0_REG)
+ (unspec [(match_operand 0 "immediate_operand" "i")] 1))]
+ ""
+ "#"
+ [(set_attr "in_delay_slot" "no")
+ (set_attr "type" "arith")])
+
(define_expand "GOTaddr2picreg"
[(set (reg:SI R0_REG)
- (const (unspec [(const (unspec [(match_dup 1)] UNSPEC_PIC))]
- UNSPEC_MOVA)))
+ (unspec [(const (unspec [(match_dup 1)] UNSPEC_PIC))]
+ UNSPEC_MOVA))
(set (match_dup 0) (const (unspec [(match_dup 1)] UNSPEC_PIC)))
(set (match_dup 0) (plus:SI (match_dup 0) (reg:SI R0_REG)))]
"" "