<br><br><div class="gmail_quote">On Sun, Apr 19, 2009 at 6:43 AM, Bryce Kampjes <span dir="ltr">&lt;<a href="mailto:bryce@kampjes.demon.co.uk">bryce@kampjes.demon.co.uk</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><br>
On Sat, 2009-04-18 at 18:15 -0700, Eliot Miranda wrote:<br>
&gt; Hi All,<br>
&gt;<br>
&gt;<br>
&gt;     I see that Float 32-bit word order is big-endian (PowerPC) on all<br>
&gt; platforms.  This is a pain for performance and a pain for code<br>
&gt; generation in Cog.  For example using SSE2 instructions it is trivial<br>
&gt; to swizzle a PowerPC-layout Float into an xmm register using the<br>
&gt; PSHUFD SSE2 instruction but tediously verbose to swizzle on write,<br>
&gt; because one has to swizzle to an xmm register which is hence<br>
&gt; destructive, which means three instructions (shuffle, write,<br>
&gt; unshuffle) just to write a Float result.  Yes, ok 2 extra instructions<br>
&gt; is small potatoes, but they&#39;re still starch.  So I wonder what would<br>
&gt; the impact be of maintaining Floats in platform order?  There are a<br>
&gt; number of possible solutions.<br>
&gt;<br>
&gt;<br>
&gt; 1. Floats are always in platform order and swizzled on image load when<br>
&gt; moving from little-endian to big-endian or vice verce.  Image code<br>
&gt; must be rewritten to take the platform&#39;s endianness into account.<br>
&gt; (requires an image rewrite)<br>
&gt;<br>
&gt;<br>
&gt; 2.  As for 1 but the image is isolated from the change by providing<br>
&gt; two primitives, primitiveFloatAt and primitiveFloatAtPut which are<br>
&gt; implemented with selectors at: basicAt: at:put: and basicAt:put: on<br>
&gt; Float.  These primitives map index 1 onto the most significant word<br>
&gt; and index 2 onto the least significant word.  (requires no image<br>
&gt; rewrite, but does require a file-in of the four implementations)<br>
<br>
</div>I&#39;d like to see Floats stored in native format too.  Don&#39;t forget about<br>
the 32 bit floats in Float arrays.</blockquote><div><br></div><div>Tell me more :)  Are these in some funky order, or are they just IEEE single precision in platform order?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
<font color="#888888"><br>
Bryce<br>
<br>
</font></blockquote></div><br>