mirror of
https://forge.sourceware.org/marek/gcc.git
synced 2026-02-22 03:47:02 -05:00
38d15216dbff426747b860e5e2e12f8f9ec60de2
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.
…
…
…
…
…
…
…
…
…
…
…
…
…
…
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
Languages
C++
30.7%
C
30%
Ada
14.5%
D
6.1%
Go
5.7%
Other
12.5%