Deprecating cc0 (and consequently cc0 targets)

Paul Koning paulkoning@comcast.net
Wed Oct 30 19:34:00 GMT 2019



> On Oct 30, 2019, at 2:24 PM, Jeff Law <law@redhat.com> wrote:
> 
> On 10/30/19 2:12 AM, Richard Biener wrote:
>> On Tue, Oct 29, 2019 at 8:34 PM Jeff Law <law@redhat.com> wrote:
> 
>> 
>> I think the wiki has better examples.  That said, I wonder how much can
>> be automated here, for example when just considering CCmode (m68k has
>> setcc IIRC) then for example all define_insns like
>> 
>> (define_insn "*cmpsi_cf"
>>  [(set (cc0)
>>        (compare (match_operand:SI 0 "nonimmediate_operand" "mrKs,r")
>>                 (match_operand:SI 1 "general_operand" "r,mrKs")))]
>>  "TARGET_COLDFIRE"
>> {...}
> The compare/test insns are relatively straightforward as they're a
> fairly simple substitution.  It's all the other insns that implicitly
> set cc0 that are so painful.
> 
> 
>> 
>> The various expanders need to be handled manually I guess, though somehow
>> automagically generating the define_insn_and_split might be possible
>> as well, no?
> I was looking at define_subst to help here, but it didn't look like it
> was really going to simplify things in any significant way.  Maybe
> someone with more experience with define_subst would see something that
> would dramtically simplify this process.

I've found define_subst to be quite helpful for generating the pairs of "clobbers CC" and "sets CC in a useful way from the operation result" pairs that Richard was referring to.  pdp11.md shows what I learned; it may be applicable elsewhere too.  This is for a "case 2" target, one that modifies CC on most operations (essentially all those that do arithmetic).

	paul




More information about the Gcc-patches mailing list