Jeff Law 38d15216db [committed] Improve shift loops on the H8
Inspired by Georg-Johann's work on the AVR to convert the shift loops to a
sentinel approach and a rough work week, I revisited the shift patterns on the
H8 to see if we could improve things on that port as well.  It also serves as a
good verification that things are working in my environment.

The basic idea of Georg-Johann's patch is to clear the bits that are going to
be shifted away, then turn on a sentinel bit (the last shifted away bit).  This
is done outside the loop.  The loop then iterates until the sentinel bit shows
up in C.  This eliminates decrementing the loop counter and better performance.

It turns out to be fairly easy to implement on the H8.  The first
implementation did the clearing and setting in the most simplistic way
possible, but to avoid significant code size regressions the clearing and
setting really needed to be handled by output_logical_op which has several
short cuts.  So a bit of adjustment was necessary to make output_logical_op
callable from other contexts.

Second the H8/S and newer parts have shift-by-2 instructions.  These aren't
normally used in shift loops unless we're optimizing for size.  This requires
slight adjustment of the sentinel location for odd shift counts.  The residual
single bit shift for that case is handled outside the loop.

Otherwise it's an uneventful patch.  My hope was that it will save a minuscule
amount of testing time as the H8 continues to be the slowest cross target for
testing. Hard to judge that right now -- while the latest run on the H8 was
about 30 minutes faster than any run in the last month, the machine was
unloaded for that run while it was fully loaded for the standard nightly runs.
If this even approaches 1% I'll jump for joy.

Anyway, tested on the H8 with no regressions.  Given the H8 is a dead ISA with
very few users, I'm going to go ahead and commit even though we're in stage3.

gcc/
	* config/h8300/h8300.cc (output_logical_op): Adjust last argument to
	be a pattern, not an insn.  Corresponding implementation changes.
	(output_shift_loop): Extracted from output_a_shift and improved
	to use a sentinel to indicate when to stop the loop.
	(output_a_shift): Use output_shift_loop.
	(compute_a_shift_length): Handle adjusted shift loop code.
	* config/h8300/logical.md (logicals): Pass pattern to output_logical_op
	rather then the full insn.
	* config/h8300/h8300-protos.h (output_logical_op): Update prototype.
2025-12-19 10:15:23 -07:00
2025-06-03 00:18:06 +00:00
2025-12-10 00:16:32 +00:00
2025-12-16 00:16:36 +00:00
2025-08-29 00:19:55 +00:00
2025-06-23 00:16:33 +00:00
2025-12-13 00:16:34 +00:00
2025-12-12 00:16:34 +00:00
2025-11-07 00:20:18 +00:00
2025-12-02 09:47:45 +00:00
2025-11-22 00:20:52 +00:00
2025-12-11 00:16:27 +00:00
2025-11-04 00:20:26 +00:00
2025-12-17 00:16:30 +00:00
2025-12-16 00:16:36 +00:00
2025-11-30 00:16:27 +00:00
2025-12-16 00:16:36 +00:00
2025-11-24 00:18:45 +00:00
2025-11-29 12:28:38 +01:00
2025-11-04 00:20:26 +00:00
2025-12-01 00:16:36 +00:00
2025-12-13 00:16:34 +00:00
2025-11-04 00:20:26 +00:00
2025-12-10 00:16:32 +00:00
2025-11-04 00:20:26 +00:00
2025-12-11 00:16:27 +00:00
2025-11-04 00:20:26 +00:00
2025-11-04 00:20:26 +00:00
2025-11-04 00:20:26 +00:00
2025-12-17 00:16:30 +00:00
2025-11-04 00:20:26 +00:00
2025-12-18 00:16:33 +00:00
2025-10-11 11:08:01 +02:00
2025-11-30 01:52:27 +01:00
2025-11-30 01:52:27 +01:00
2025-11-30 01:52:27 +01:00
2025-11-30 01:52:24 +01:00
2025-10-11 11:08:01 +02:00

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.
Description
No description provided
Readme 1.5 GiB
Languages
C++ 30.7%
C 30%
Ada 14.5%
D 6.1%
Go 5.7%
Other 12.5%