On Mon, 26 Sep 2022, Tamar Christina wrote: > > Maybe the target could use (subreg:SI (reg:BI ...)) as argument. Heh. > > But then I'd still need to change the expansion code. I suppose this could > prevent the issue with changes to code on other targets. > > > > > We have undocumented addcc, negcc, etc. patterns, should we have aandcc > > > > pattern for this indicating support for andcc + jump as opposedto cmpcc > > > > + jump? > > > > > > This could work yeah. I didn't know these existed. > > > Ah, so they are conditional add, not add setting CC, so andcc wouldn't > > be appropriate. > > > So I'm not sure how we'd handle such situation - maybe looking at > > REG_DECL and recognizing a _Bool PARM_DECL is OK? > > I have a slight suspicion that Richard Sandiford would likely reject this > though.. The additional AND seemed less hacky as it's just communicating > range. > > I still need to also figure out which representation of bool is being used, > because only the 0-1 variant works. Is there a way to check that?
So another option would be, in case you have (subreg:SI (reg:QI)), if we expand if (b != 0) expand that to !((b & 255) == 0) basically invert the comparison and the leverage the paradoxical subreg to specify a narrower immediate to AND with? Just hoping that arm can do 255 as immediate and still efficiently handle this? Wouldn't this transform be possible in combine with the appropriate backend pattern and combine synthesizing the and for paradoxical subregs? Richard.