This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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: [PATCH] Provide a C++ version of iseqsig


On Fri, 3 Nov 2017, Jonathan Wakely wrote:

> > For the C99 type-generic macros, libstdc++, not glibc, deals with
> > providing the overloaded function versions for C++ code.  TS 18661-1 is
> > expected to be integrated into the C standard for C2x, which I suppose
> > makes it likely to become part of standard C++ as well when the C2x
> > standard library is integrated into C++.  So should libstdc++ be
> > responsible for providing function versions of all these macros?  Or
> 
> I'd be happy to define them in libstdc++, as long as we have a
> __builtin_sigseq in GCC that can be used for it.

There are no built-in functions in GCC for any of these operations.  For 
iseqsig, there would be the difficulty that it's defined to set errno 
(under the same circumstances where libm functions set errno); I'd imagine 
GCC should have a __builtin_iseqsig that never sets errno, and that could 
be implemented with a single comparison instruction on many processors, 
but it would only be appropriate to use to implement the macro/function 
with -fno-math-errno.  For iscanonical, when it's nontrivial I'm not 
convinced it's simple enough for inline expansion to be appropriate.

(Tamar Christina's GCC patch for built-in classification functions using 
integer arithmetic also added __builtin_iszero and __builtin_issubnormal, 
but it had to be reverted because it caused regressions on some platforms.  
See GCC bugs 77925, 77926, 77928 requesting __builtin_issubnormal, 
__builtin_iszero, __builtin_iseqsig; I don't think there's a bug 
requesting __builtin_issignaling, and as above I doubt 
__builtin_iscanonical makes sense.)

-- 
Joseph S. Myers
joseph@codesourcery.com


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