<div dir="ltr">Yeah, I do like how the 7.8 calling convention allows up to 6 Double args to go in registers.<div><br></div><div style>Thats a good idea actually, </div><div style><br></div><div style>so it'd be adding </div>
<div style><br></div><div style><pre class="" style="background-color:rgb(247,247,247);border:1px solid rgb(215,215,215);margin-right:1.75em;margin-left:1.75em;padding:0.25em;overflow:auto;color:rgb(0,0,0);font-size:13px">
// Pass in STG registers for 128bit simd vectors
CCIfType<[ v16i8, v8i16, v4i32, v2i64, v4f32, v2f64],
CCIfSubtarget<"hasSSE1()",
CCAssignToReg<[XMM1, XMM2, XMM3, XMM4, XMM5, XMM6]>>>,
// Pass in STG registers for first 7 256bit simd vectors
CCIfType<[v32i8, v16i16, v8i32, v4i64, v8f32, v4f64],
CCIfSubtarget<"hasAVX()",
CCAssignToReg<[YMM0, YMM1, YMM2, YMM3,
YMM4, YMM5, YMM6]>>></pre></div><div class="gmail_extra"><br></div><div class="gmail_extra" style>to the X86_32 convention then. so floats and doubles would still be spilled to stack, but SIMD (short vectors) could use the registers as applicable.</div>
<div class="gmail_extra" style><br></div><div class="gmail_extra" style>That would preserve calling convention compatibility, but still allow adding SIMD to 32bit x86.</div><div class="gmail_extra" style><br></div><div class="gmail_extra" style>
<br></div><div class="gmail_extra" style><br></div><div class="gmail_extra" style>If that'd be kosher / looks good, please indicate so on the ghc trac ticket, so i can fold this into the patch on the llvm-commits list post haste. Would rather not have it be a whole separate patch</div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jul 8, 2013 at 6:22 PM, Geoffrey Mainland <span dir="ltr"><<a href="mailto:mainland@apeiron.net" target="_blank">mainland@apeiron.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">We would like code compiled with the LLVM back-end that doesn't use SIMD<br>
vectors to inter-operate with code compiled with the native codegen. The<br>
native codegen passes floating point arguments on the stack, so if we<br>
changed the GHC LLVM calling convention to pass Floats and Doubles in<br>
registers, we would need to change the native codegen to do the same.<br>
<br>
Or are you suggesting that we only pass SIMD short-vectors in the xmm<br>
registers on x86?<br>
<br>
I changed the calling convention (for both back-ends) when I did the<br>
SIMD work. It was a lucky accident that I didn't have to patch LLVM.<br>
<br>
Geoff<br>
<div class="HOEnZb"><div class="h5"><br>
On 07/08/2013 07:57 PM, Carter Schonwald wrote:<br>
> Hey All,<br>
> Is there any reasons *not* to add SSE / AVX register support to the<br>
llvm 32 bit x86 ghc calling convention? It looks like (as with x86_64)<br>
that adding additional simd registers to the calling convention would be<br>
fully backwards compatible with current ghc approach to 32bit function<br>
calls, but would allow ghc 32bit (at some future point) to have decent<br>
floating point performance when applicable.<br>
><br>
> I'm ok either way, but would be helpful to get some opinions.<br>
><br>
> just to recap, i'm working on getting a patch sorted out for adding<br>
AVX support to the ghc x86_64 LLVM calling convention<br>
<a href="http://ghc.haskell.org/trac/ghc/ticket/8033" target="_blank">http://ghc.haskell.org/trac/ghc/ticket/8033</a>, and now would be a good<br>
time to add anything to the 32bit x86 calling convention<br>
><br>
> thanks<br>
> -Carter<br>
<br>
</div></div></blockquote></div><br></div></div>