On 11/13/19 6:08 AM, Bernd Schmidt wrote: > This tidies up a few spots in the m68k backend in preparation for the > large patch to follow. This is purely for review purposes: this patch > has not been tested independently, and will be committed together with > the following one. > > Noteworthy changes: > > Some patterns and peepholes were unified through mode iterators. The > m68k_subword_comparison_operator predicate was adapted to also work with > SImode. > > There are already scc_di patterns, so there is no need to generate a cc0 > set/use pair in cstoredi. > > Without HAVE_cc0, combine sometimes substitutes a stack push into the > destination of a divmod instruction, and then gets confused because it > doesn't seem to expect it in a PARALLEL. Since the instruction only > works on registers anyway, use register_operand. > > There are patterns that use register_operand with "do" constraints which > allow memory. This works at reload time, but the instruction can not be > rerecognized later on. This becomes a problem if such operands occur in > a jump instruction, as subsequent passes will try to redirect branches > and thus attempt to rerecognize the pattern. > > movqi/movhi do not accept constants that are not CONST_INT. The code to > output them would not set flags correctly and was changed to > gcc_unreachable. > > Comments were added to some patterns which are not being generated due > to incorrect tests/predicates. Fixing these is out of scope for this > work, but the problems are at least documented. > > All the passes working on conditional traps seem to assume > const_true_rtx is used for unconditional ones, rather than const1_rtx. > > > Bernd > > > m68k-1.diff > > * config/m68k/m68k.c (output_move_himode, output_move_qimode): > Replace code for non-CONST_INT constants with gcc_unreachable. > * config/m68k/m68k.md (cbranchdi): Don't generate individual > compare and test. > (CMPMODE): New mode_iterator. > (cbranchsi4, cbranchqi4, cbranchhi4): Replace expanders with > cbranch<mode>4. > (cstoresi4, cstoreqi4, cstorehi4): Replace expanders with > cstore<mode>4. > (cmp<mode>_68881): Remove 'F' constraint from first comparison > operand. > (bit test insns patterns): Use nonimmediate_operand, not > register_operand, for source operands that allow memory in > their constraints. > (divmodsi4, udivmodsi4, divmodhi4 and related unnamed patterns): > Use register_operand, not nonimmediate_operand, for the > destinations. > (DBCC): New mode_iterator. > (dbcc peepholes): Use it to reduce duplication. > (trap): Use const_true_rtx, not const1_rtx. > * config/m68k/predicates.md (m68k_comparison_operand): Renamed > from m68k_subword_comparison_operand and changed to handle > SImode. OK. I'd actually recommend this go ahead and get installed. My tester will bootstrap it overnight.
Jeff