This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch 2.95.3] Fix a 12-bit ASHIFTRT in the h8300 port.
- To: gcc-patches at gcc dot gnu dot org
- Subject: [patch 2.95.3] Fix a 12-bit ASHIFTRT in the h8300 port.
- From: Kazu Hirata <kazu at hxi dot com>
Hi,
Attached is a patch for gcc-2.95.3 to fix the generation of 12-bit
shift ASHIFTRT:HI in the h8300 port. If you do the shift, the
unpatched gcc generates an assembly opcode that does not exist
anywhere in the instruction set.
The attached patch was regenerated to avoid patch offsets. The
original can be obtained by
cvs diff -u -r1.46 -r1.47 gcc/config/h8300/h8300.c
I hope this will make it in 2.95.3.
Thanks,
Kazu Hirata
2000-12-26 Kazu Hirata <kazu@hxi.com>
* config/h8300/h8300.c (get_shift_alg): Fix a typo in the
assembly code for 12-bit ASHIFTRT in HImode.
Index: h8300.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/h8300/h8300.c,v
retrieving revision 1.16.4.1
diff -u -r1.16.4.1 h8300.c
--- h8300.c 2000/12/18 14:43:08 1.16.4.1
+++ h8300.c 2000/12/27 14:22:32
@@ -2313,9 +2313,9 @@
if (TARGET_H8300)
*assembler_p = "mov.b\t%t0,%s0\n\tbld\t#7,%s0\n\tsubx\t%t0,%t0\n\tshar.b\t%s0\n\tshar.b\t%s0\n\tshar.b\t%s0\n\tshar.b\t%s0";
else if (TARGET_H8300H)
- *assembler_p = "mov.b\t%t0,%s0\n\textw.w\t%T0\n\tshar.b\t%s0\n\tshar.b\t%s0\n\tshar.b\t%s0\n\tshar.b\t%s0";
+ *assembler_p = "mov.b\t%t0,%s0\n\texts.w\t%T0\n\tshar.b\t%s0\n\tshar.b\t%s0\n\tshar.b\t%s0\n\tshar.b\t%s0";
else if (TARGET_H8300S)
- *assembler_p = "mov.b\t%t0,%s0\n\textw.w\t%T0\n\tshar.b\t#2,%s0\n\tshar.b\t#2,%s0";
+ *assembler_p = "mov.b\t%t0,%s0\n\texts.w\t%T0\n\tshar.b\t#2,%s0\n\tshar.b\t#2,%s0";
*cc_valid_p = 0;
return SHIFT_SPECIAL;
}