<div dir="auto"><div><div class="gmail_quote"><div dir="ltr">On Thu, 6 Sep 2018, 16:31 Tim Northover, <<a href="mailto:t.p.northover@gmail.com">t.p.northover@gmail.com</a>> wrote:</div></div></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
> The PS2, for what it's worth, only has an i32 -> f32 instruction, so I think there's an impedance mismatch somewhere.<br>
<br>
This is also a fairly common situation. If the operation can be<br>
emulated with a reasonably small number of native instructions you can<br>
often get LLVM to do that.<br>
<br>
In this case it would probably be a libcall though because it's quite<br>
complex. LLVM would generate a call to __floatdisf, which will be<br>
provided by compiler-rt (there are C implementations for all kinds of<br>
floating-point operations there).<br>
<br>
You should see the same thing if you compile a function doing that<br>
conversion with GCC.<br>
<br>
Cheers.<br>
<br>
Tim.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">So I was rereading this; do you think the lowering function should instead emit a library call instead, then?</div><div dir="auto"><br></div><div dir="auto">If so, would you mind pointing me to a function which performs this, or otherwise give a high-level description of how this is done?</div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>