sqrtf is detected by code in SelectionDAGBuilder.cpp. This gets turns into a FSQRT ISD node type that the target can handle just like any other ISD node. If the target doesn't mark ISD::FSQRT as Legal or Custom then ExpandNode in LegalizeDAG.cpp turns it back into a sqrtf libcall.<br>
<br><div class="gmail_quote">On Sun, Jan 20, 2013 at 11:34 AM, David Given <span dir="ltr"><<a href="mailto:dg@cowlark.com" target="_blank">dg@cowlark.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 20/01/13 19:20, Caldarale, Charles R wrote:<br>
[...]<br>
<div class="im">> That's because there is no llvm.ceil.* intrinsic defined in include/llvm/Intrinsics.td for 3.2<br>
<br>
</div>Ah. Yes, that would explain it... does this mean that I can rely on all<br>
the intrinsics listed existing for the common types (int, float,<br>
double)? Or should I be trying to follow the libc call route?<br>
<br>
I've noticed that llc is successfully turning this:<br>
<br>
define float @t(float %f) nounwind uwtable readnone {<br>
  %1 = tail call float @sqrtf(float %f) nounwind readnone<br>
  ret float %1<br>
}<br>
<br>
...into this:<br>
<br>
t:<br>
        sqrtss  %xmm0, %xmm0<br>
        ret<br>
<br>
...but I haven't figured out what pass does it yet.<br>
<div class="HOEnZb"><div class="h5"><br>
--<br>
┌─── dg@cowlark.com ───── <a href="http://www.cowlark.com" target="_blank">http://www.cowlark.com</a> ─────<br>
│ "Of course, on a sufficiently small planet, 40 km/hr is, in fact,<br>
│ sufficient to punt the elastic spherical cow into low orbit." ---<br>
│ Brooks Moses on r.a.sf.c<br>
<br>
</div></div><br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>~Craig