aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@issan.informatik.uni-dortmund.de>1998-02-27 02:10:47 +0000
committerAndreas Schwab <schwab@gcc.gnu.org>1998-02-27 02:10:47 +0000
commit0fd12b044999cb90ede68a0573445e2280de1a20 (patch)
tree27190d3c408b6cfd49db318cb0cb7ce9297e85d5
parentacbce66755fe7b7e252103c12102ef5d8b193321 (diff)
downloadgcc-0fd12b044999cb90ede68a0573445e2280de1a20.zip
gcc-0fd12b044999cb90ede68a0573445e2280de1a20.tar.gz
gcc-0fd12b044999cb90ede68a0573445e2280de1a20.tar.bz2
m68k.md (movsf+1): Optimize moving a CONST_DOUBLE zero.
* config/m68k/m68k.md (movsf+1): Optimize moving a CONST_DOUBLE zero. From-SVN: r18278
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/m68k/m68k.md36
2 files changed, 41 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ccd60ef..e4a4f98 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+Fri Feb 27 11:02:47 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * config/m68k/m68k.md (movsf+1): Optimize moving a CONST_DOUBLE
+ zero.
+
1998-02-26 Ken Raeburn <raeburn@cygnus.com>
* regclass.c (init_reg_sets): Move init of move cost tables...
diff --git a/gcc/config/m68k/m68k.md b/gcc/config/m68k/m68k.md
index ddcac65..183d130 100644
--- a/gcc/config/m68k/m68k.md
+++ b/gcc/config/m68k/m68k.md
@@ -1099,6 +1099,42 @@
return \"fmove%.s %1,%-\;move%.l %+,%0\";
return \"fmove%.s %f1,%0\";
}
+ if (operands[1] == CONST0_RTX (SFmode)
+ /* clr insns on 68000 read before writing.
+ This isn't so on the 68010, but we have no TARGET_68010. */
+ && ((TARGET_68020 || TARGET_5200)
+ || !(GET_CODE (operands[0]) == MEM && MEM_VOLATILE_P (operands[0]))))
+ {
+ if (ADDRESS_REG_P (operands[0]))
+ {
+ /* On the '040, 'subl an,an' takes 2 clocks while lea takes only 1 */
+ if (!TARGET_68040 && !TARGET_68060)
+ return \"sub%.l %0,%0\";
+ else
+ {
+#ifdef MOTOROLA
+#ifdef SGS
+ /* Many SGS assemblers croak on size specifiers for constants. */
+ return \"lea 0,%0\";
+#else
+ return \"lea 0.w,%0\";
+#endif
+#else
+ return \"lea 0:w,%0\";
+#endif
+ }
+ }
+ /* moveq is faster on the 68000. */
+ if (DATA_REG_P (operands[0]) && !(TARGET_68020 || TARGET_5200))
+ {
+#if defined(MOTOROLA) && !defined(CRDS)
+ return \"moveq%.l %#0,%0\";
+#else
+ return \"moveq %#0,%0\";
+#endif
+ }
+ return \"clr%.l %0\";
+ }
return \"move%.l %1,%0\";
}")