This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] h8300.c: Free one register during an 8-bit shift.
- From: Kazu Hirata <kazu at cs dot umass dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 22 Jan 2003 12:56:41 -0500 (EST)
- Subject: [patch] h8300.c: Free one register during an 8-bit shift.
Hi,
Attached is a patch to free one register during an 8-bit shift.
On H8S, we don't need a scrach reg to shift a register in SImode by 8
bits because such shifts are done by 4 copies of 2-bit shift
instructions. However, h8300_shift_needs_scratch_p() claims that a
scratch reg is needed, increasing the register pressure unnecessarily.
The patch removes this false claim.
Testing with newlib shows that the patch generally reduces the size of
stack slots and/or the number of temporary registers.
Tested on h8300 port. Committed.
Kazu Hirata
2003-01-22 Kazu Hirata <kazu@cs.umass.edu>
* config/h8300/h8300.c (h8300_shift_needs_scratch_p): Don't
request a scratch reg on H8S when the shift count is 8.
Index: h8300.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/h8300/h8300.c,v
retrieving revision 1.205
diff -u -r1.205 h8300.c
--- h8300.c 21 Jan 2003 14:31:28 -0000 1.205
+++ h8300.c 22 Jan 2003 16:49:07 -0000
@@ -3198,7 +3198,7 @@
/* On H8/300H and H8S, count == 8 uses the scratch register. */
return (a == SHIFT_LOOP || lr == SHIFT_LOOP || ar == SHIFT_LOOP
- || (!TARGET_H8300 && mode == SImode && count == 8));
+ || (TARGET_H8300H && mode == SImode && count == 8));
}
/* Emit the assembler code for doing shifts. */