<br><br><div class="gmail_quote">On Sun, Apr 19, 2009 at 6:43 AM, Bryce Kampjes <span dir="ltr"><<a href="mailto:bryce@kampjes.demon.co.uk">bryce@kampjes.demon.co.uk</a>></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>
> Hi All,<br>
><br>
><br>
> I see that Float 32-bit word order is big-endian (PowerPC) on all<br>
> platforms. This is a pain for performance and a pain for code<br>
> generation in Cog. For example using SSE2 instructions it is trivial<br>
> to swizzle a PowerPC-layout Float into an xmm register using the<br>
> PSHUFD SSE2 instruction but tediously verbose to swizzle on write,<br>
> because one has to swizzle to an xmm register which is hence<br>
> destructive, which means three instructions (shuffle, write,<br>
> unshuffle) just to write a Float result. Yes, ok 2 extra instructions<br>
> is small potatoes, but they're still starch. So I wonder what would<br>
> the impact be of maintaining Floats in platform order? There are a<br>
> number of possible solutions.<br>
><br>
><br>
> 1. Floats are always in platform order and swizzled on image load when<br>
> moving from little-endian to big-endian or vice verce. Image code<br>
> must be rewritten to take the platform's endianness into account.<br>
> (requires an image rewrite)<br>
><br>
><br>
> 2. As for 1 but the image is isolated from the change by providing<br>
> two primitives, primitiveFloatAt and primitiveFloatAtPut which are<br>
> implemented with selectors at: basicAt: at:put: and basicAt:put: on<br>
> Float. These primitives map index 1 onto the most significant word<br>
> and index 2 onto the least significant word. (requires no image<br>
> rewrite, but does require a file-in of the four implementations)<br>
<br>
</div>I'd like to see Floats stored in native format too. Don'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>