aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/misc.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2020-11-18 21:01:06 -0700
committerJeff Law <law@redhat.com>2020-11-18 21:01:06 -0700
commit700337494e1b0d5ff608e1a3c77852381e264653 (patch)
tree9f334878639095cd8e9957b57deebaa21facbb7b /gcc/ada/gcc-interface/misc.c
parent25bb75f841c552cfd27a4344b7487efbe35b4481 (diff)
downloadgcc-700337494e1b0d5ff608e1a3c77852381e264653.zip
gcc-700337494e1b0d5ff608e1a3c77852381e264653.tar.gz
gcc-700337494e1b0d5ff608e1a3c77852381e264653.tar.bz2
Minor H8 shift code generation change in preparation for cc0 removal
So I didn't stay up late to work from pago pago this year and beat the stage1 close, but I do want to flush out the removal of cc0 from the H8 port this cycle. Given these patches only affect the H8 and the H8 would be killed this cycle without the conversion, I think this is suitable even though we're past stage1 close. This patch addresses an initial codegen issue that would have resulted in regressions after removal of cc0. The compare/test eliminate pass is unable to handle multiple clobbers. So patterns that clobber a scratch and also clobber a condition code are never used to eliminate a compare/test. The H8 can shift 1 or 2 bits at a time depending on the precise model. Not surprisingly we have multiple strategies to implement shifts, some of which clobber scratch registers -- but we have a clobber on every shift insn and as a result they can not participate in compare/test removal once cc0 is removed from the port. This patch removes the clobber in the initial code generation in cases where it's obviously not needed allowing those shifts to participate in compare/test removal in a future patch. It has the advantage that is also generates slightly better code. By installing this now the removal of cc0 is a smaller patch, but more importantly, it allows for a more direct comparison of the generated code before/after cc0 removal. I've had my tester test before/after this patch with no regressions on the major H8 multilibs. I've also spot checked the generated code and as expected it's ever-so-slightly better after this patch. I'll be installing this on the trunk momentarily. More patches will follow, though probably not in rapid succession as my time to push this stuff is very limited. gcc/ * config/h8300/constraints.md (R constraint): Add argument to call to h8300_shift_needs_scratch_p. (S and T constraints): Similary. * config/h8300/h8300-protos.h: Update h8300_shift_needs_scratch_p prototype. * config/h8300/h8300.c (expand_a_shift): Emit a different pattern if the shift does not require a scratch register. (h8300_shift_needs_scratch_p): Refine to be more accurate. * config/h8300/shiftrotate.md (shiftqi_noscratch): New pattern. (shifthi_noscratch, shiftsi_noscratch): Similarly.
Diffstat (limited to 'gcc/ada/gcc-interface/misc.c')
0 files changed, 0 insertions, 0 deletions