This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: match.pd: Three new patterns


On Tue, 23 Jun 2015, Marek Polacek wrote:

> On Tue, Jun 23, 2015 at 09:56:33AM +0200, Richard Biener wrote:
> > > I think you're right about TYPE_SATURATING so I've dropped that and instead
> > > replaced it with TYPE_OVERFLOW_TRAPS.  That should do the right thing
> > > together with TYPE_OVERFLOW_SANITIZED.
> > 
> > Are you sure?  The point is that if the minus or the plus in the original
> > expression saturate the result isn't correct, no?
>  
> Yes, but I thought that TYPE_SATURATING is only true for fixed-point, i.e.
> those _Accum/_Sat/_Fract (?), and you can't do bitwise & or | on them, which
> means that the TYPE_SATURATING check wouldn't be necessary.

Who says you can't do bitwise ops on them?  I can't see that being
enforced in the GIMPLE checking in tree-cfg.c.  Yes, there is no
such thing as a "saturating" bitwise and but bitwise and should
just work fine.

You can check with a arm cross what the C FE does when you use
bitwise ops but I believe the regular and/ior md patterns work
just fine (there are no special modes/registers but they seem
to be shared with regular registers, just special operations
are available).

Richard.

> 
> > As said, removing TYPE_SATURATING doesn't sound correct.  I'm not sure
> > about TYPE_OVERFLOW_TRAPS - we're certainly removing traps elsewhere
> > (look for the scarce use of this flag in fold-const.c and match.pd
> > where I only preserved those that were originally in fold-const.c).
> > 
> > So, TYPE_OVERFLOW_TRAPS is your choice but TYPE_SATURATING is
> > required IMHO.
> 
> Ok, I guess I'll add TYPE_SATURATING back, even though I'm not clear
> on that one, and commit.
> 
> Thanks,
> 
> 	Marek
> 
> 

-- 
Richard Biener <rguenther@suse.de>
SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Dilip Upmanyu, Graham Norton, HRB 21284 (AG Nuernberg)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]