<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Thu, Feb 5, 2026 at 9:28 AM Corinna Vinschen <<a href="mailto:vinschen@redhat.com">vinschen@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Feb 5 09:09, Joel Sherrill wrote:<br>
> Hi<br>
> <br>
> math.h:123 has isinfl () and isnanl() as this:<br>
> <br>
> 123<br>
> <<a href="https://sourceware.org/git?p=newlib-cygwin.git;a=blob;f=newlib/libc/include/math.h;h=5e92d2662da145cabad51e5946051aa34e9092b6;hb=HEAD#l123" rel="noreferrer" target="_blank">https://sourceware.org/git?p=newlib-cygwin.git;a=blob;f=newlib/libc/include/math.h;h=5e92d2662da145cabad51e5946051aa34e9092b6;hb=HEAD#l123</a>><br>
> #ifdef __CYGWIN__ /* not implemented in newlib yet */<br>
> 124<br>
> <<a href="https://sourceware.org/git?p=newlib-cygwin.git;a=blob;f=newlib/libc/include/math.h;h=5e92d2662da145cabad51e5946051aa34e9092b6;hb=HEAD#l124" rel="noreferrer" target="_blank">https://sourceware.org/git?p=newlib-cygwin.git;a=blob;f=newlib/libc/include/math.h;h=5e92d2662da145cabad51e5946051aa34e9092b6;hb=HEAD#l124</a>><br>
> extern int isinfl (long double);<br>
> 125<br>
> <<a href="https://sourceware.org/git?p=newlib-cygwin.git;a=blob;f=newlib/libc/include/math.h;h=5e92d2662da145cabad51e5946051aa34e9092b6;hb=HEAD#l125" rel="noreferrer" target="_blank">https://sourceware.org/git?p=newlib-cygwin.git;a=blob;f=newlib/libc/include/math.h;h=5e92d2662da145cabad51e5946051aa34e9092b6;hb=HEAD#l125</a>><br>
> extern int isnanl (long double);<br>
> 126<br>
> <<a href="https://sourceware.org/git?p=newlib-cygwin.git;a=blob;f=newlib/libc/include/math.h;h=5e92d2662da145cabad51e5946051aa34e9092b6;hb=HEAD#l126" rel="noreferrer" target="_blank">https://sourceware.org/git?p=newlib-cygwin.git;a=blob;f=newlib/libc/include/math.h;h=5e92d2662da145cabad51e5946051aa34e9092b6;hb=HEAD#l126</a>><br>
> #endif<br>
> <br>
> The winsup implementation has them as simple wrappers for the<br>
> corresponding built-in functions such as __builtin_isinf_sign().<br>
> <br>
> If I copied the winsup/ implementation and put each in a new file<br>
> in newlib/libm so they are always available, is that OK?<br>
<br>
Barring other problems, you should just move them out of winsup into<br>
newlib.<br>
<br>
> If so, any suggestions on location inside libm for simple wrappers<br>
> for the corresponding builtin?<br>
<br>
libm/common<br>
<br>
> What would the conditional guard need to be? Just Cygwin and RTEMS?<br>
> or more?<br>
<br>
I think this would have to be target cpu dependent.<br>
<br>
> Anything I am missing?<br>
<br>
Is it a safe bet that these builtins are available as inline functions<br>
on all supported target cpus and compilers? Unimplemented builtins just<br>
point to their corresponding C lib function, isn't it?<br></blockquote><div><br></div><div>Thanks. This one comment makes me want to avoid doing this.<br><br>I can easily test the ~15 RTEMS architectures but that leaves a lot </div><div>I can't easily check. I will see if the code using this can be done a different</div><div>way. Suggestions on that?</div><div><br></div><div>--joel </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
<br>
Corinna<br>
<br>
</blockquote></div></div>