aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKazu Hirata <kazu@cs.umass.edu>2002-12-20 04:05:14 +0000
committerKazu Hirata <kazu@gcc.gnu.org>2002-12-20 04:05:14 +0000
commit539dbd15f3e90c346a11bea734b069e93dd14a55 (patch)
tree49b6a4cac00cbb10871a121852da3548f4fa1a0b
parent7a163ec05c76c710d246c56ef8076a2cd38baf32 (diff)
downloadgcc-539dbd15f3e90c346a11bea734b069e93dd14a55.zip
gcc-539dbd15f3e90c346a11bea734b069e93dd14a55.tar.gz
gcc-539dbd15f3e90c346a11bea734b069e93dd14a55.tar.bz2
h8300.md (output_a_shift): Clean up the code to output shifts using rotation.
* config/h8300/h8300.md (output_a_shift): Clean up the code to output shifts using rotation. From-SVN: r60353
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/h8300/h8300.c36
2 files changed, 22 insertions, 19 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 22112f0..209e12f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2002-12-19 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (output_a_shift): Clean up the code to
+ output shifts using rotation.
+
2002-12-20 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
* flow.c (allocate_reg_life_data): Reset REG_FREQ.
diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c
index 078c4a9..ab2cc15 100644
--- a/gcc/config/h8300/h8300.c
+++ b/gcc/config/h8300/h8300.c
@@ -3026,30 +3026,28 @@ output_a_shift (operands)
output_asm_insn (info.shift1, operands);
/* Now mask off the high bits. */
- if (TARGET_H8300)
+ switch (mode)
{
- switch (mode)
+ case QImode:
+ sprintf (insn_buf, "and\t#%d,%%X0", mask);
+ cc_status.value1 = operands[0];
+ cc_status.flags |= CC_NO_CARRY;
+ break;
+ case HImode:
+ if (TARGET_H8300)
{
- case QImode:
- sprintf (insn_buf, "and\t#%d,%%X0", mask);
- cc_status.value1 = operands[0];
- cc_status.flags |= CC_NO_CARRY;
- break;
- case HImode:
sprintf (insn_buf, "and\t#%d,%%s0\n\tand\t#%d,%%t0",
mask & 255, mask >> 8);
- break;
- default:
- abort ();
}
- }
- else
- {
- sprintf (insn_buf, "and.%c\t#%d,%%%c0",
- "bwl"[shift_mode], mask,
- mode == QImode ? 'X' : mode == HImode ? 'T' : 'S');
- cc_status.value1 = operands[0];
- cc_status.flags |= CC_NO_CARRY;
+ else
+ {
+ sprintf (insn_buf, "and.w\t#%d,%%T0", mask);
+ cc_status.value1 = operands[0];
+ cc_status.flags |= CC_NO_CARRY;
+ }
+ break;
+ default:
+ abort ();
}
output_asm_insn (insn_buf, operands);
return "";