<div dir="ltr"><div>After spending some time in the debugger, the difference between the sqrt and exp2, sin and cos seems to be that the Attribute::ReadNone is set on sqrt and not on the other functions (the other CallInst's). Is there a way to set this attribute from tablegen (in <Target>InstrInfo.td)?<br><br></div>Phil<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 2, 2016 at 2:10 PM, Phil Tomson <span dir="ltr"><<a href="mailto:phil.a.tomson@gmail.com" target="_blank">phil.a.tomson@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Both of them have 'Legal' (as well as sin and cos), but that doesn't make any difference - I still don't see exp, exp2, sin or cos show up as opcodes in the assembly. For some reason calls to sqrt show up as opcodes (sqrtf) - I'm puzzled as to what is different with sqrt.<span class="HOEnZb"><font color="#888888"><br><br></font></span></div><span class="HOEnZb"><font color="#888888">Phil<br><div><br><br></div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 1, 2016 at 10:44 AM, Ryan Taylor <span dir="ltr"><<a href="mailto:ryta1203@gmail.com" target="_blank">ryta1203@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Phil,</div><div><br></div><div>  Are you seeing the fexp2 SDNode with -view-legalize-dags and then a call with -view-dag-combine2-dags? </div><div><br></div><div>  In XXXISelLowering.cpp please try to explicitly make fexp2 'legal', ie "setOperationAction(ISD::FEXP2<wbr>, MVT::f32, Legal); setOperationAction(ISD::FEXP2, MVT::f64, Legal)". This worked for me, I am now no longer getting a call and am now getting an ISEL error (not matching SDNode in tablegen, which is what you want since it's legal on your target).</div><div><br></div><div>  I find this confusing since the default is suppose to be 'Legal' from my understanding but LLVM is not always consistent this way, the community has decided to do things 'this way' or 'that way' depending on 'what's common' sometimes.</div><div><br></div><div>Thanks,</div><div><br></div><div>-Ryan</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Wed, Aug 31, 2016 at 6:40 PM, Phil Tomson via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr"><div><div>We've got both an sqrtf and an expf opcode in our architecture. If I call sqrt() on the C side, I see the sqrtf opcode show up in the generated assembly. However, if I call exp() on the C side, I don't see the expf opcode show up on the generated assembly, I see a call to an exp function from libm.<br><br></div>Here's what we've got in our TargetInstrinfo.td file for both of these instructions:<br>def SQRTF64 : Other2ROp< 0b0001101, "sqrtF", fsqrt, OpInfo_F64, II_ELEMF3 >;<br>def SQRTF32 : Other2ROp< 0b0001101, "sqrtF", fsqrt, OpInfo_F32, II_ELEMF1 >;<br><br>def EXPF64 :   Other2ROp< 0b0001010, "expF", fexp2, OpInfo_F64, II_ELEMF3 >;<br>def EXPF32 :   Other2ROp< 0b0001010, "expF", fexp2, OpInfo_F32, II_ELEMF1 >;<br><br><br></div><div>..essentially the same kind of definition for both SQRTF and EXPF, but for the latter I don't see expf opcodes being generated.<br><br></div><div>Any idea what might be missing for exp?<span><font color="#888888"><br><br></font></span></div><span><font color="#888888"><div>Phil<br></div></font></span></div>
<br></div></div>______________________________<wbr>_________________<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="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>