On Fri, Jul 10, 2009 at 2:37 AM, Matthew Fluet <span dir="ltr">&lt;<a href="mailto:fluet@tti-c.org">fluet@tti-c.org</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On Wed, 8 Jul 2009, Wesley W. Terpstra wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
It would be ideal if I could get this conversion code to work also on<br>
Int.{to,from}Large, but there are two problems: 1) packing an IntInf<br>
involves shifting and tagging 2) FixedInt doesn&#39;t fit into IntInf without<br>
using GMP&#39;s representation.<br>
</blockquote>
<br></div>
Another option is to make the (unsafe) IntInf conversions into primitives:<br>
    IntInf_truncToWord of WordSize.t<br>
  | Word_extdToIntInf of WordSize.t * {signed: bool}</blockquote><div><br>That&#39;s a great idea! Most conversions done in existing code are IntX.{to/from}Large so I expect this would improve the performance of the patch a lot.<br>
 <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">The downside of this implementation is that the shifting and tagging (small int inf) or vector creation (big int inf) for extending to an int inf and untagging and shifting or vector extraction for truncating an int inf that currently resides in basis-library/integer/int-inf0.sml would need to be implemented in the compiler (perhaps expanding the IntInf_truncToWord and IntInf_extdToWord in the combine conversions pass, since they wouldn&#39;t be needed after).  It isn&#39;t terribly complicated code, but it is a little more verbose to write in SSA, rather than in SML.<br>

</blockquote></div><br>Would there be a negative performance impact since this code would not be inlined any more? I am not concerned with &quot;verbose&quot; typing on my part. ;)<br><br>