On Tue, 2024-07-09 at 16:33 -0700, Vineet Gupta wrote:
> 
> 
> On 7/9/24 16:23, Jeff Law wrote:
> > 
> > On 7/9/24 5:08 PM, Vineet Gupta wrote:
> > > On 7/3/24 12:08, Xi Ruoyao wrote:
> > > > On Fri, 2024-06-28 at 17:53 -0700, Vineet Gupta wrote:
> > > > > I was also hoping to get __builtin_inf() done but unforutnately it
> > > > > requires little more rtl foo/bar to implement a tri-modal return.
> > > > Hmm do we really need to care the symbol?  The generic __builtin_isinf
> > > > does not care the symbol anyway: https://godbolt.org/z/bnnGf3a38 and the
> > > > standards only require a non-zero return value if the input is infinite
> > > > (positive or negative).
> > > Not sure what you mean: are you saying the current flags based
> > > implementation doesn't return tri-modal val.
> > Me either.  No idea what I was thinking/saying.  Best to ignore whatever 
> > I asked/said on that topic ;-)
> 
> Doh this was meant for Xi as he made this comment :-)

Yes I mean we don't need to do a tri-modal return.

The linux man page describes the Glibc behavior, but it's not precisely
what the standard mandates.  In C23 draft (N3054) section 7.12.3.4
paragraph 3:

   The isinf macro returns a nonzero value if and only if its argument
   has an infinite value.
   
And it says nothing about -1 or +1.
   
GCC supports different libc implementations, and in the past days it never
implemented try-modal return for __builtin_isinf, thus it seems we don't
need to implement it.

-- 
Xi Ruoyao <xry...@xry111.site>
School of Aerospace Science and Technology, Xidian University

Reply via email to