<div dir="ltr">With Simon's help I figured it out. I'm now refactoring StgCmmPrimOp so it's easier to have primops that have both inline and out-of-line implementations in the future.</div><div class="gmail_extra">

<br><br><div class="gmail_quote">On Fri, Mar 7, 2014 at 3:19 PM, Carter Schonwald <span dir="ltr"><<a href="mailto:carter.schonwald@gmail.com" target="_blank">carter.schonwald@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Have you looked at some of the lowering code for other primops? What info are you missing?  <div class="HOEnZb"><div class="h5"><span></span><br><br>On Friday, March 7, 2014, Johan Tibell <<a href="mailto:johan.tibell@gmail.com" target="_blank">johan.tibell@gmail.com</a>> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>I'm trying to make allocation of arrays of small, statically-known size inline. For large or unknown size I just want to call the existing stg_newArrayzh function. In code:</div>


<div>

<br></div><div><div><font face="arial, helvetica, sans-serif">doNewArrayOp :: DynFlags -> CmmFormal -> CmmExpr -> FCode ()</font></div></div><div><font face="arial, helvetica, sans-serif">doNewArrayOp dflags res_r (CmmLit (CmmInt n _)) | n <= inlineAllocLimit = do</font></div>




<div><font face="arial, helvetica, sans-serif">    -- Do everything inline.</font></div><div><font face="arial, helvetica, sans-serif">doNewArrayOp dflags res_r n = do<br></font></div><div><font face="arial, helvetica, sans-serif">    emitCallTo "stg_newArrayzh" res_r n  -- HERE</font></div>




<div><br></div><div>The question is: how do I emit a call to stg_newArrayzh, which is defined in PrimOps.cmm?</div><div><br></div><div>-- Johan</div><div><br></div></div>
</blockquote>
</div></div></blockquote></div><br></div>