<div dir="ltr"><div>Let's give preference to FreeBSD sources. Notes below.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jul 3, 2019 at 1:08 PM Vaibhav Gupta <<a href="mailto:vaibhavgupta40@gmail.com">vaibhavgupta40@gmail.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"><div dir="ltr"><div>Hello,</div><div>I have found sources for fenv.</div><div><br></div><div>1.1) - ARM FreeBSD Source:</div><div><div>- <a href="https://github.com/freebsd/freebsd/blob/master/lib/msun/arm/fenv.h" target="_blank">https://github.com/freebsd/freebsd/blob/master/lib/msun/arm/fenv.h</a></div></div><div>- <a href="https://github.com/freebsd/freebsd/blob/master/lib/msun/arm/fenv.c" target="_blank">https://github.com/freebsd/freebsd/blob/master/lib/msun/arm/fenv.c</a></div><div>.<br></div><div>1.2) - ARM NetBSD Source : <br></div><div>- <a href="https://github.com/NetBSD/src/blob/trunk/sys/arch/arm/include/fenv.h" target="_blank">https://github.com/NetBSD/src/blob/trunk/sys/arch/arm/include/fenv.h</a></div><div>- <a href="https://github.com/NetBSD/src/blob/trunk/lib/libm/arch/arm/fenv.c" target="_blank">https://github.com/NetBSD/src/blob/trunk/lib/libm/arch/arm/fenv.c</a></div><div>-----------------------------------------------------------------------------</div></div></blockquote><div><br></div><div>For the ARM FreeBSD source, there are some ifdef's which appear to</div><div>be for architectural variations. Please check the gcc source for arm </div><div>(gcc-XXX/gcc/config/arm) to see if they are defined by gcc. If they</div><div>all are, then there is nothing to consider on how they get tripped.</div><div><br></div><div>For example, <span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre">__ARM_PCS_AAPCS64 is one. That looks like a multilib</span></div><div><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre">define.</span></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>2.1) - SPARC NetBSD Source :</div><div>- <a href="https://github.com/NetBSD/src/blob/trunk/sys/arch/sparc/include/fenv.h" target="_blank">https://github.com/NetBSD/src/blob/trunk/sys/arch/sparc/include/fenv.h</a></div><div>- <a href="https://github.com/NetBSD/src/blob/trunk/lib/libm/arch/sparc/fenv.c" target="_blank">https://github.com/NetBSD/src/blob/trunk/lib/libm/arch/sparc/fenv.c</a></div><div>----------------------------------------------------------------------------</div></div></blockquote><div><br></div><div>This looks good and may work for sparc64 as well as sparc. Check if</div><div>sparc64-rtems5-gcc defines __arch64 as used byL</div><div><br></div><div><a href="https://github.com/NetBSD/src/blob/trunk/sys/arch/sparc/include/fenv.h#L36">https://github.com/NetBSD/src/blob/trunk/sys/arch/sparc/include/fenv.h#L36</a>  <br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>3.1) - PPC FreeBSD Source:</div><div>- <a href="https://github.com/freebsd/freebsd/blob/master/lib/msun/powerpc/fenv.h" target="_blank">https://github.com/freebsd/freebsd/blob/master/lib/msun/powerpc/fenv.h</a></div><div>- <a href="https://github.com/freebsd/freebsd/blob/master/lib/msun/powerpc/fenv.c" target="_blank">https://github.com/freebsd/freebsd/blob/master/lib/msun/powerpc/fenv.c</a></div><div>.<br></div><div>3.2) - PPC NetBSD Source:</div><div>- <a href="https://github.com/NetBSD/src/blob/trunk/sys/arch/powerpc/include/fenv.h" target="_blank">https://github.com/NetBSD/src/blob/trunk/sys/arch/powerpc/include/fenv.h</a></div><div>- <a href="https://github.com/NetBSD/src/blob/trunk/lib/libm/arch/powerpc/fenv.c" target="_blank">https://github.com/NetBSD/src/blob/trunk/lib/libm/arch/powerpc/fenv.c</a></div><div>---------------------------------------------------------------------------</div></div></blockquote><div><br></div><div>Sam advice on PPC. Looks OK, check ifdefs</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>4.1) - x86 FreeBSD Source:</div><div>- <a href="https://github.com/freebsd/freebsd/blob/master/lib/msun/x86/fenv.h" target="_blank">https://github.com/freebsd/freebsd/blob/master/lib/msun/x86/fenv.h</a></div><div>.<br></div><div>4.2) - x86 NetBSD Source:</div><div>- <a href="https://github.com/NetBSD/src/blob/trunk/lib/libm/arch/x86_64/fenv.c" target="_blank">https://github.com/NetBSD/src/blob/trunk/lib/libm/arch/x86_64/fenv.c</a></div><div>--------------------------------------------------------------------------</div></div></blockquote><div><br></div><div>This is not i386 (e.g. 32-bit), it is for the 64-bit target. Good to merge it into</div><div>newlib but we don't have a fully functional port to test this with.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>5.1) - RISC5 FreeBSD Source:</div><div>- <a href="https://github.com/freebsd/freebsd/blob/master/lib/msun/riscv/fenv.h" target="_blank">https://github.com/freebsd/freebsd/blob/master/lib/msun/riscv/fenv.h</a></div><div>- <a href="https://github.com/freebsd/freebsd/blob/master/lib/msun/riscv/fenv.c" target="_blank">https://github.com/freebsd/freebsd/blob/master/lib/msun/riscv/fenv.c</a></div><div>.<br></div><div>5.2) - RISC5 NetBSD Source:</div><div>- <a href="https://github.com/NetBSD/src/blob/trunk/sys/arch/riscv/include/fenv.h" target="_blank">https://github.com/NetBSD/src/blob/trunk/sys/arch/riscv/include/fenv.h</a></div><div>- <a href="https://github.com/NetBSD/src/blob/trunk/lib/libm/arch/riscv/fenv.c" target="_blank">https://github.com/NetBSD/src/blob/trunk/lib/libm/arch/riscv/fenv.c</a></div><div>========================================================</div></div></blockquote><div><br></div><div>Same advice.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>========================================================</div><div><br></div><div>It's impossible to depend on either NetBSD or FreeBSD.</div></div></blockquote><div><br></div><div>Yep. Give preference to FreeBSD but if it isn't in FreeBSD, use NetBSD. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>.<br></div><div>For some architectures, FreeBSD has code,</div><div>for some, NetBSD has.</div><div>.</div><div>For x86, Free BSD has explicit header</div><div>and NetBSD has .c file.</div><div></div></div></blockquote><div><br></div><div>These are all architecture specific files so do not go in a main include</div><div>or source directory. They go in an architecture specific subdirectory.</div><div><br></div><div>See <a href="https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=tree;f=newlib/libm/machine;h=9b2197b2660fd84c6b64ef265c1ec3b6e30c9074;hb=HEAD">https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=tree;f=newlib/libm/machine;h=9b2197b2660fd84c6b64ef265c1ec3b6e30c9074;hb=HEAD</a></div><div><br></div><div>And notice that arm, aarch64, riscv, and i386 are all already there. Looks</div><div>like you can focus on the ones not there (PPC and SPARC). Ignore x86_64 </div><div>for now. If there is a ticket for the port, just add a comment to that. I don't</div><div>think we are setup to test that port right now.</div><div> </div><div>Hope that all makes sense.</div><div><br></div><div>--joel</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>.</div><div>.</div><div>.</div><div>Vaibhav Gupta<br></div></div>
</blockquote></div></div>