h8300.md (*extzv_8_8): Use shorter code when operands[0] and operands[1] are different.
authorKazu Hirata <kazu@cs.umass.edu>
Mon, 3 Mar 2003 12:49:38 +0000 (12:49 +0000)
committerKazu Hirata <kazu@gcc.gnu.org>
Mon, 3 Mar 2003 12:49:38 +0000 (12:49 +0000)
* config/h8300/h8300.md (*extzv_8_8): Use shorter code when
operands[0] and operands[1] are different.

From-SVN: r63718

gcc/ChangeLog
gcc/config/h8300/h8300.md

index 79429c287305fa2531fb245bf69123c0fa82d10b..8b81f7e31eb8c379fb1f38538901212138f72399 100644 (file)
@@ -1,4 +1,9 @@
-2003-03-02  Kazu Hirata  <kazu@cs.umass.edu>
+2003-03-03  Kazu Hirata  <kazu@cs.umass.edu>
+
+       * config/h8300/h8300.md (*extzv_8_8): Use shorter code when
+       operands[0] and operands[1] are different.
+
+2003-03-03  Kazu Hirata  <kazu@cs.umass.edu>
 
        * reload1.c (reload_cse_move2add): Remove variable success.
 
index 61ae4b6553286bde1e898a12bc11efae5996ae50..28cb87ec7ff461cbe7049cb6bd5e992e8a67baf6 100644 (file)
                         (const_int 8)
                         (const_int 8)))]
   "TARGET_H8300H || TARGET_H8300S"
-  "mov.b\\t%x1,%w0\;extu.w\\t%f0\;extu.l\\t%S0"
+  "*
+{
+  if (REG_P (operands[0]) && REG_P (operands[1])
+      && REGNO (operands[0]) != REGNO (operands[1]))
+    return \"sub.l\\t%S0,%S0\;mov.b\\t%x1,%w0\";
+  else
+    return \"mov.b\\t%x1,%w0\;extu.w\\t%f0\;extu.l\\t%S0\";
+}"
   [(set_attr "cc" "set_znv")
    (set_attr "length" "6")])