Re: Add option for whether ceil etc. can raise "inexact", adjust x86 conditions

2017-09-14 Thread Jan Hubicka
> > Well, it's of course the poor-mans solution compared to providing our own > ifunc-enabled libm ... One benefit here would be that we could have our own calling convention for this. So for floor/ceil we may just declare registers to be preserved (as they are on all modern AVX enabled cpus)

Re: Add option for whether ceil etc. can raise "inexact", adjust x86 conditions

2017-09-14 Thread Richard Biener
On Wed, Sep 13, 2017 at 7:34 PM, Martin Jambor wrote: > Hello, > > I apologize for not coming back to this, I keep on getting distracted. > Anyway... > > On Tue, Aug 15, 2017 at 02:20:55PM +, Joseph Myers wrote: >> On Tue, 15 Aug 2017, Martin Jambor wrote: >> >> > I am not

Re: Add option for whether ceil etc. can raise "inexact", adjust x86 conditions

2017-09-13 Thread Joseph Myers
On Wed, 13 Sep 2017, Martin Jambor wrote: > I was just surprised by the glibc check, what would you consider a > recent-enough glibc? Or is the check mainly necessary to ensure we > are indeed using glibc and not some other libc (and thus something > like we do for TARGET_LIBC_PROVIDES_SSP would

Re: Add option for whether ceil etc. can raise "inexact", adjust x86 conditions

2017-09-13 Thread Martin Jambor
Hello, I apologize for not coming back to this, I keep on getting distracted. Anyway... On Tue, Aug 15, 2017 at 02:20:55PM +, Joseph Myers wrote: > On Tue, 15 Aug 2017, Martin Jambor wrote: > > > I am not sure what to do about this, to me it seems that the > > -ffp-int-builtin-inexact

Re: Add option for whether ceil etc. can raise "inexact", adjust x86 conditions

2017-08-16 Thread Uros Bizjak
On Wed, Aug 16, 2017 at 12:55 PM, Richard Biener wrote: > On Wed, Aug 16, 2017 at 12:51 PM, Uros Bizjak wrote: >> On Wed, Aug 16, 2017 at 12:48 PM, Uros Bizjak wrote: >>> On Wed, Aug 16, 2017 at 12:43 PM, Richard Biener >>>

Re: Add option for whether ceil etc. can raise "inexact", adjust x86 conditions

2017-08-16 Thread Richard Biener
On Wed, Aug 16, 2017 at 12:51 PM, Uros Bizjak wrote: > On Wed, Aug 16, 2017 at 12:48 PM, Uros Bizjak wrote: >> On Wed, Aug 16, 2017 at 12:43 PM, Richard Biener >> wrote: >>> On Tue, Aug 15, 2017 at 9:21 PM, Uros Bizjak

Re: Add option for whether ceil etc. can raise "inexact", adjust x86 conditions

2017-08-16 Thread Uros Bizjak
On Wed, Aug 16, 2017 at 12:48 PM, Uros Bizjak wrote: > On Wed, Aug 16, 2017 at 12:43 PM, Richard Biener > wrote: >> On Tue, Aug 15, 2017 at 9:21 PM, Uros Bizjak wrote: >>> On Tue, Aug 15, 2017 at 4:59 PM, Richard Biener >>>

Re: Add option for whether ceil etc. can raise "inexact", adjust x86 conditions

2017-08-16 Thread Richard Biener
On Tue, Aug 15, 2017 at 9:21 PM, Uros Bizjak wrote: > On Tue, Aug 15, 2017 at 4:59 PM, Richard Biener > wrote: > >> So I'd try the "easy" way of expanding if (__builtin_cpu_supports ("sse4.1")) >> as the sse4.1 sequence is just a single instruction.

Re: Add option for whether ceil etc. can raise "inexact", adjust x86 conditions

2017-08-15 Thread Uros Bizjak
On Tue, Aug 15, 2017 at 4:59 PM, Richard Biener wrote: > So I'd try the "easy" way of expanding if (__builtin_cpu_supports ("sse4.1")) > as the sse4.1 sequence is just a single instruction. The interesting part > of the story will be to make sure we can emit that

Re: Add option for whether ceil etc. can raise "inexact", adjust x86 conditions

2017-08-15 Thread Richard Biener
o >>>> > necessary to update can_inline_edge_p and inline_call. >>>> >>>> This patch version adds handling for the new option in those places. >>>> Other changes: the default for the option is corrected so that >>>> -ffp-int-builtin-in

Re: Add option for whether ceil etc. can raise "inexact", adjust x86 conditions

2017-08-15 Thread Richard Biener
tion in those places. >>> Other changes: the default for the option is corrected so that >>> -ffp-int-builtin-inexact really is in effect by default as intended; >>> md.texi documentation for the patterns in question is updated to >>> describe how they are affect

Re: Add option for whether ceil etc. can raise "inexact", adjust x86 conditions

2017-08-15 Thread Richard Biener
intended; >> md.texi documentation for the patterns in question is updated to >> describe how they are affected by this option. >> >> >> Add option for whether ceil etc. can raise "inexact", adjust x86 conditions. >> >> In ISO C99/C11, the ceil, f

Re: Add option for whether ceil etc. can raise "inexact", adjust x86 conditions

2017-08-15 Thread Joseph Myers
On Tue, 15 Aug 2017, Martin Jambor wrote: > I am not sure what to do about this, to me it seems that the > -ffp-int-builtin-inexact simply has a wrong default value, at least > for x86_64, as it was added in order not to slow code down but does > exactly that (all of the slowdown of course

Re: Add option for whether ceil etc. can raise "inexact", adjust x86 conditions

2017-08-15 Thread Martin Jambor
new option in those places. > Other changes: the default for the option is corrected so that > -ffp-int-builtin-inexact really is in effect by default as intended; > md.texi documentation for the patterns in question is updated to > describe how they are affected by this option. >

Re: Ping Re: Add option for whether ceil etc. can raise "inexact", adjust x86 conditions

2016-06-02 Thread Joseph Myers
On Thu, 2 Jun 2016, Jan Hubicka wrote: > > Ping. This patch > > is pending > > review (for the non-x86-specific parts). > The inliner bits looks fine to me. Of course it is easy to check whether the > function actually calls floor/ceil

Re: Ping Re: Add option for whether ceil etc. can raise "inexact", adjust x86 conditions

2016-06-02 Thread Joseph Myers
On Thu, 2 Jun 2016, Bernd Schmidt wrote: > On 06/02/2016 02:00 PM, Jan Hubicka wrote: > > > Ping. This patch > > > is pending > > > review (for the non-x86-specific parts). > > The inliner bits looks fine to me. > > In case that leaves

Re: Ping Re: Add option for whether ceil etc. can raise "inexact", adjust x86 conditions

2016-06-02 Thread Bernd Schmidt
On 06/02/2016 02:00 PM, Jan Hubicka wrote: Ping. This patch is pending review (for the non-x86-specific parts). The inliner bits looks fine to me. In case that leaves anything unapproved, the remaining parts are OK too, modulo one

Re: Ping Re: Add option for whether ceil etc. can raise "inexact", adjust x86 conditions

2016-06-02 Thread Jan Hubicka
> Ping. This patch > is pending > review (for the non-x86-specific parts). The inliner bits looks fine to me. Of course it is easy to check whether the function actually calls floor/ceil and thus is affected by this flag. Do you expect

Ping Re: Add option for whether ceil etc. can raise "inexact", adjust x86 conditions

2016-06-02 Thread Joseph Myers
Ping. This patch is pending review (for the non-x86-specific parts). -- Joseph S. Myers jos...@codesourcery.com

Re: Add option for whether ceil etc. can raise "inexact", adjust x86 conditions

2016-05-26 Thread Joseph Myers
in effect by default as intended; md.texi documentation for the patterns in question is updated to describe how they are affected by this option. Add option for whether ceil etc. can raise "inexact", adjust x86 conditions. In ISO C99/C11, the ceil, floor, round and trunc functions may

Re: Add option for whether ceil etc. can raise "inexact", adjust x86 conditions

2016-05-26 Thread Jan Hubicka
> > +ffp-int-builtin-inexact > > +Common Report Var(flag_fp_int_builtin_inexact) Optimization > > +Allow built-in functions ceil, floor, round, trunc to raise \"inexact\" > > exceptions. When adding new codegen option which affects the correctness, it is also necessary to update

Re: Add option for whether ceil etc. can raise "inexact", adjust x86 conditions

2016-05-26 Thread Uros Bizjak
On Thu, May 26, 2016 at 1:46 AM, Joseph Myers wrote: > In ISO C99/C11, the ceil, floor, round and trunc functions may or may > not raise the "inexact" exception for noninteger arguments. Under TS > 18661-1:2014, the C bindings for IEEE 754-2008, these functions are >

Add option for whether ceil etc. can raise "inexact", adjust x86 conditions

2016-05-25 Thread Joseph Myers
In ISO C99/C11, the ceil, floor, round and trunc functions may or may not raise the "inexact" exception for noninteger arguments. Under TS 18661-1:2014, the C bindings for IEEE 754-2008, these functions are prohibited from raising "inexact", in line with the general rule that "inexact" is only