aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKazu Hirata <kazu@cs.umass.edu>2002-12-30 15:28:31 +0000
committerKazu Hirata <kazu@gcc.gnu.org>2002-12-30 15:28:31 +0000
commita6e8d1139de77569a6dfaba1dda8b223afc278a7 (patch)
tree9cd4741ccc8e1f36dd7317a63b7f1d833ab7ea60
parent37bc6ca2649bfa025cede18d9b4a3b3fbc6a4c35 (diff)
downloadgcc-a6e8d1139de77569a6dfaba1dda8b223afc278a7.zip
gcc-a6e8d1139de77569a6dfaba1dda8b223afc278a7.tar.gz
gcc-a6e8d1139de77569a6dfaba1dda8b223afc278a7.tar.bz2
h8300.c (output_logical_op): Use extu.w if we are clearing the most significant byte.
* 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. From-SVN: r60632
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/config/h8300/h8300.c25
2 files changed, 30 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 74e2a1a..022ef30 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c
index afa43c1..e77edaf 100644
--- a/gcc/config/h8300/h8300.c
+++ b/gcc/config/h8300/h8300.c
@@ -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;
}