Re: Commentary Cmm page (Observations and Areas for Improvement)

Peter Tanski <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.all
Message-ID <8A969035-4FF3-4999-AF2F-EEC7CE00E53C__45956.1434494846$1164724693$gmane$org@gmail.com>
On Nov 24, 2006, at 2:50 AM, Simon Peyton-Jones wrote:
> Peter Tanski wrote:
>> I was trying to determine the grounds for when a side-effecting  
>> primop would be inlined and when it would be coded as a separate  
>> procedure.
>
> That's a matter for the implementation, not the C--, or Cmm,  
> specification.  The user should not care.  The implementer makes  
> the usual cost/performance/complexity trade-off, and decides.  I  
> think there is no more to it than that.

Quite so.  The wiki is intended for implementers, in this case those  
who would be interested in implementing new Cmm primitive operators.

> If you are asking what GHC's current code-generator's decisions  
> are, concerning this choice, I couldn't tell you without looking at  
> the code!

According to nativeGen/MachCodeGen.hs, out-of-line primitive  
operators (usually floating point operations) seem to be foreign  
calls.  I suppose a possible addition to Cmm, such as primitive  
operators with exceptions, might be inlined but I haven't looked  
carefully at the trade-offs.

On a somewhat related note, it has been a long holiday weekend (lots  
of company, no spare time) so I got a slow start redoing the Cmm  
language wiki page.  It should be done fairly soon.

Cheers,
Pete
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.