<div dir="ltr"><div><a class="gmail_plusreply" id="m_-3724990130510851217plusReplyChip-1" href="mailto:renato.golin@linaro.org" target="_blank">+Renato Golin</a><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jun 8, 2020 at 5:21 PM Nasser, Salim via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</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 lang="EN-US">
<div>
<p class="MsoNormal">A handful of files in compiler-rt/builtins use the macro “__SOFT_FP__”. All the uses are along the same lines. Here’s a representative example from compiler-rt/lib/builtins/fixdfdi.c:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p>#ifndef __SOFT_FP__<u></u><u></u></p>
<p>// Support for systems that have hardware floating-point; can set the invalid<u></u><u></u></p>
<p>// flag as a side-effect of computation.<u></u><u></u></p>
<p>…<u></u><u></u></p>
<p>#else<u></u><u></u></p>
<p>// Support for systems that don't have hardware floating-point; there are no<u></u><u></u></p>
<p>// flags to set, and we don't want to code-gen to an unknown soft-float<u></u><u></u></p>
<p>// implementation.<u></u><u></u></p>
<p>…<u></u><u></u></p>
<p>#endif<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">My question is : when - if ever - should __SOFT_FP__ be defined?<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">The obvious answer is “when compiling for a soft-float target”.
<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">However: __SOFT_FP__ is never set by the compiler (neither clang nor GCC).
<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Nor (as far as I can tell) does it appear in any compiler-rt header file, build script, or Makefile. In fact the only occurrences of this macro anywhere in the llvm-project and GCC source trees are the aforementioned uses under compiler-rt/builtins.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">On the other hand both clang and GCC *do* set an alarmingly similar looking macro - “__SOFTFP__” (no middle underscore) - when compiling for soft-float.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Since we need to build compiler-rt libraries for a couple of our soft-float targets at Wind River, we want to make sure we’re building them in the “right” way. Currently we do *<b>not</b>* define __SOFT_FP__ for soft-float targets (and
our tests pass!).<u></u><u></u></p>
<p class="MsoNormal"><br></p></div></div></blockquote><div><br></div><div>I believe that this is an accidental misspelling and went unnoticed. This should be `__SOFTFP__` instead.<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 lang="EN-US"><div><p class="MsoNormal"></p>
<p class="MsoNormal">Regards,<br>
Salim<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Salim Nasser | Compilers | Wind River<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u><u></u></p>
</div>
</div>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr">Saleem Abdulrasool<br>compnerd (at) compnerd (dot) org</div></div>