<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Nov 21, 2014 at 4:47 AM, Bert Freudenberg <span dir="ltr">&lt;<a href="mailto:bert@freudenbergs.de" target="_blank">bert@freudenbergs.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="">On 21.11.2014, at 02:51, Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>&gt; wrote:<br>
<br>
&gt; Hi All,<br>
&gt;<br>
&gt;     64-bit Spur can usefully provide an immediate float, a 61-bit subset of the ieee double precision float.  The scheme steals bits from the mantissa to use for the immediate&#39;s 3-bit tag pattern.  So values have the same precision as ieee doubles, but can only represent the subset with exponents between 10^-38 and 10^38, the single-precision range.<br>
<br>
</span>This is worded confusingly. It sounds like the mantissa has 3 bits less, which would make it less precise.<br></blockquote><div><br></div><div>It&#39;s not worded confusingly, it&#39;s just plain wrong :-/.  Let me try again...</div><div><br></div><div><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px">64-bit Spur can usefully provide an immediate float, a 61-bit subset of the ieee double precision float.  The scheme steals 3 bits from the exponent to use for the immediate&#39;s 3-bit tag pattern.  So values have the same precision as ieee doubles, but can only represent the subset with exponents between 10^-38 and 10^38, the single-precision range. </span></div><div><br></div><div>Here&#39;s the representation:</div><div><br></div><div>    [8 bit exponent][52 bit mantissa][1 bit sign][3 bit tag]</div><div><br></div><div>This has the advantage that +/- zero are the only immediate float values that are less than or equal to fifteen.  So to convert to a float:</div><div><br></div><div>- shift away tags</div><div>    [000][8 bit exponent][52 bit mantissa][1 bit sign]<br></div><div><br></div><div>- if &gt; 1 (i.e. non-zero)</div><div>    add exponent offset:</div><div>        [11 bit exponent][52 bit mantissa][sign bit]</div><div><br></div><div>- rotate by -1</div><div>    [sign bit][11 bit exponent][52 bit mantissa]</div><div><br></div><div>And to encode:</div><div><br></div><div>- rotate by 1</div><div>    [11 bit exponent][52 bit mantissa][sign bit]<br></div><div><br></div><div>- if &gt; 1</div><div>    subtract exponent offset</div><div>    fail if &lt;= 0</div><div>    test against max value, fail if too big</div><div><br></div><div>- shift by 3 and add tag bits:</div><div>    [8 bit exponent][52 bit mantissa][1 bit sign][3 bit tag]<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Here is how I understood it: The mantissa is stored with its full 52 bits of precision (*). But only the lower 8 bits of the 11-bit exponent are stored. If the upper 3 bits of the exponent are needed, then a boxed float is created.</blockquote><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">I guess I know what you meant, that it is the 3 lowest significant bits in an oop which are used for tagging immediate objects, and in an IEEE double that is part of the mantissa. But these 3 bits are not lost, but moved elsewhere (namely where the 3 highest significant bits of the exponent used to be stored).<br>
<br>
Did I understand correctly? You haven&#39;t pushed the code yet so I couldn&#39;t verify.<br></blockquote><div><br></div><div>Yes, of course :-)</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">- Bert -<br>
<br>
(*) <a href="http://en.wikipedia.org/wiki/Double-precision_floating-point_format" target="_blank">http://en.wikipedia.org/wiki/Double-precision_floating-point_format</a><br></blockquote></div><div><br></div>-- <br><div class="gmail_signature">best,<div>Eliot</div></div>
</div></div>