OSDN Git Service

* config/h8300/h8300.c (output_logical_op): Use extu.w if we
authorkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 30 Dec 2002 15:28:31 +0000 (15:28 +0000)
committerkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 30 Dec 2002 15:28:31 +0000 (15:28 +0000)
are clearing the most significant byte.
(compute_logical_op_length): Update to reflect the change in
output_logical_op.
(compute_logical_op_cc): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@60632 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/h8300/h8300.c

index 74e2a1a..022ef30 100644 (file)
@@ -1,3 +1,11 @@
+2002-12-30  Kazu Hirata  <kazu@cs.umass.edu>
+
+       * config/h8300/h8300.c (output_logical_op): Use extu.w if we
+       are clearing the most significant byte.
+       (compute_logical_op_length): Update to reflect the change in
+       output_logical_op.
+       (compute_logical_op_cc): Likewise.
+
 2002-12-29  Kazu Hirata  <kazu@cs.umass.edu>
 
        * config/h8300/h8300.md: Give internal names to anonymous
index afa43c1..e77edaf 100644 (file)
@@ -2151,7 +2151,9 @@ output_logical_op (mode, operands)
          && ((det & 0x0000ffff) != 0)
          && ((det & 0xffff0000) != 0)
          && (code == IOR || det != 0xffffff00)
-         && (code == IOR || det != 0xffff00ff))
+         && (code == IOR || det != 0xffff00ff)
+         && (code != AND || det != 0xff00ff00)
+         && (code != AND || det != 0xff0000ff))
        {
          sprintf (insn_buf, "%s.l\t%%S2,%%S0", opname);
          output_asm_insn (insn_buf, operands);
@@ -2195,6 +2197,13 @@ output_logical_op (mode, operands)
            output_asm_insn ((code == AND)
                             ? "sub.w\t%e0,%e0" : "not.w\t%e0",
                             operands);
+         else if ((TARGET_H8300H || TARGET_H8300S)
+                  && code == AND
+                  && (det & 0xffff0000) == 0xff000000)
+           {
+             sprintf (insn_buf, "extu.w\t%%e0", opname);
+             output_asm_insn (insn_buf, operands);
+           }
          else if (TARGET_H8300H || TARGET_H8300S)
            {
              if ((det & 0xffff0000) != 0)
@@ -2275,7 +2284,9 @@ compute_logical_op_length (mode, operands)
          && ((det & 0x0000ffff) != 0)
          && ((det & 0xffff0000) != 0)
          && (code == IOR || det != 0xffffff00)
-         && (code == IOR || det != 0xffff00ff))
+         && (code == IOR || det != 0xffff00ff)
+         && (code != AND || det != 0xff00ff00)
+         && (code != AND || det != 0xff0000ff))
        {
          if (REG_P (operands[2]))
            length += 4;
@@ -2315,6 +2326,12 @@ compute_logical_op_length (mode, operands)
            {
              length += 2;
            }
+         else if ((TARGET_H8300H || TARGET_H8300S)
+                  && code == AND
+                  && (det & 0xffff0000) == 0xff000000)
+           {
+             length += 2;
+           }
          else if (TARGET_H8300H || TARGET_H8300S)
            {
              if ((det & 0xffff0000) != 0)
@@ -2374,7 +2391,9 @@ compute_logical_op_cc (mode, operands)
          && ((det & 0x0000ffff) != 0)
          && ((det & 0xffff0000) != 0)
          && (code == IOR || det != 0xffffff00)
-         && (code == IOR || det != 0xffff00ff))
+         && (code == IOR || det != 0xffff00ff)
+         && (code != AND || det != 0xff00ff00)
+         && (code != AND || det != 0xff0000ff))
        {
          cc = CC_SET_ZNV;
        }