<br><br><div class="gmail_quote">On Thu, Mar 28, 2013 at 3:36 PM, Louis LaBrunda <span dir="ltr">&lt;<a href="mailto:Lou@keystone-software.com" target="_blank">Lou@keystone-software.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Nicolas,<br>
<div class="im"><br>
&gt;Hi Louis,<br>
&gt;I&#39;m a bit late in this thread but...<br>
&gt;Does all this really matters now with multi-byte fetching?<br>
<br>
</div>Well that&#39;s really my point.  Little endian had a very, very tiny and<br>
predictably short lived advantage over big endian in single-byte fetching<br>
computers only.  I&#39;m pretty sure mainframes (big endian) with multi-byte<br>
fetching existed when little endian first came along.  Anyone thinking to<br>
implement little endian should have realized it would lose that advantage<br>
soon.<br></blockquote><div><br></div><div>??  And how many bigendian micros are there in common use nowadays??</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="im"><br>
&gt;If so, why the hell would multi-byte fetching annihilate the advantage<br>
&gt;of one endianness and preserve the advantage of the other?<br>
<br>
</div>Big endian remains simple, little endian (not simple) lost the slight speed<br>
advantage.<br></blockquote><div><br></div><div>Not for many machine-level operations.  AFAICT big endian&#39;s only advantage is in reading hex dumps.  Thankfully I don&#39;t debug like that.  Look at a marshaller or a data copier that has to deal with items of different size, e.g. extracting fields from the middle of a struct etc and little endian&#39;s advantage becomes clear.</div>
<div><br></div><div>But forgive me, I shouldn&#39;t even be starting this thread :)</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><br>
&gt;For my problem (LargeIntegersPlugin), littleEndian remarkably fits the<br>
&gt;implementation of LargePositiveInteger.<br>
&gt;(Least significantByte at offset 0, next at 1, etc...).<br>
<br>
</div>Here you have a point that the code might look a little simpler in that it<br>
wouldn&#39;t have to go backwards thru the data.<br>
<br>
If I could wave a magic wand, I would make little endian go away and add<br>
large integer arithmetic in hardware.<br>
<br>
Just out of curiosity, are you playing with large integer arithmetic on the<br>
byte or word level?<br>
<div class="im"><br>
&gt;Also, having a different endianness for Float and Integer is something<br>
&gt;I would avoid...<br>
<br>
</div>Agreed but I would never have invented little endian in the first place.<br>
<div class="HOEnZb"><div class="h5"><br>
&gt;If I copy finite positive float bits to an int, then the order is<br>
&gt;preserved if and only if endianness matches.<br>
<br>
&gt;void check_good_ordering(float af,float bf)<br>
&gt;{<br>
&gt;int ai,bi;<br>
&gt;memcpy( &amp;ai , &amp;af , sizeof float);<br>
&gt;memcpy( &amp;bi , &amp;bf , sizeof float);<br>
&gt;assert( (af &lt; bf) == (ai &lt; bi) );<br>
&gt;}<br>
&gt;<br>
&gt;Nicolas<br>
&gt;<br>
&gt;2013/1/21 Louis LaBrunda &lt;<a href="mailto:Lou@keystone-software.com">Lou@keystone-software.com</a>&gt;:<br>
&gt;&gt; Hi Tim,<br>
&gt;&gt;<br>
&gt;&gt; I have a great deal of respect for you and I don&#39;t want to start a flame<br>
&gt;&gt; war but little endian is pet peeve, so here goes.<br>
&gt;&gt;<br>
&gt;&gt; Little endian floats are probably the single biggest mistake in computer<br>
&gt;&gt; science ever.  With little endian integers not far behind.  I don&#39;t know of<br>
&gt;&gt; any value to little endian floats what so ever.<br>
&gt;&gt;<br>
&gt;&gt; Little endian integers at least had some small value back when computers<br>
&gt;&gt; fetched one byte of data from memory at a time.  They could start doing<br>
&gt;&gt; some arithmetic on the low order data byte while fetching the next byte.<br>
&gt;&gt; Little endian made the addressing/fetching easier.  But once computers<br>
&gt;&gt; started fetching two and then four bytes at a time that advantage<br>
&gt;&gt; disappeared.  And the disadvantage of numbers looking ass backwards in<br>
&gt;&gt; dumps remains to this day.<br>
&gt;&gt;<br>
&gt;&gt; Little endian floats never had the above advantage (or any other that I can<br>
&gt;&gt; think of) because floats need to be normalized before any math can be done.<br>
&gt;&gt; Maybe if the exponent were fetched first, some setup work could be done (I<br>
&gt;&gt; doubt it) but with little endian floats, the exponent is fetched last.<br>
&gt;&gt;<br>
&gt;&gt; I wish Intel would add big endian (at least for floats) to their processors<br>
&gt;&gt; with a switch that would allow programmers to declare which to use.<br>
&gt;&gt;<br>
&gt;&gt; A side note about big endian machines and Linux.  IBM touts that their<br>
&gt;&gt; mainframes can run 1000+ virtual copies of Linux at a time.  I expect that<br>
&gt;&gt; Linux is compiled for big endian as I don&#39;t think any of the IBM machines<br>
&gt;&gt; are little endian.<br>
&gt;&gt;<br>
&gt;&gt; Lou<br>
&gt;&gt;<br>
&gt;&gt;&gt;On 20-01-2013, at 9:39 AM, &quot;David T. Lewis&quot; &lt;<a href="mailto:lewis@mail.msen.com">lewis@mail.msen.com</a>&gt; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; On Sun, Jan 20, 2013 at 04:52:42PM +0000, Frank Shearar wrote:<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; At the risk of sounding rather ignorant, what kind of machine would<br>
&gt;&gt;&gt;&gt;&gt; that be? IIRC the 68k machines were big endian but they&#39;ve been wiped<br>
&gt;&gt;&gt;&gt;&gt; out now haven&#39;t they?<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;It has taken many years of blood, effort, toil, tears, sweat, pointed emails and sharply aimed comments, but finally, finally, my friends, at last we are *free* from the evil of Big Endian! At last we can release our families from the underground bunkers of safety and let them wander the outer world as nature intended.<br>

&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Most certainly not, Edgar still has one.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;Ah, him. Well, I&#39;ve heard about him and his nasty habits. We&#39;re onto you Edgar!<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Wikipedia gives a good summary: <a href="http://en.wikipedia.org/wiki/Endianness" target="_blank">http://en.wikipedia.org/wiki/Endianness</a><br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Older Macs are big endian, and the Squeak VM was originally written on<br>
&gt;&gt;&gt;&gt; big endian machines. ARM processors can run in either mode. Most likely<br>
&gt;&gt;&gt;&gt; they run as little endian for Linux, and I&#39;m not sure which mode is used<br>
&gt;&gt;&gt;&gt; for RISC OS.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;I&#39;ve never yet come across an ARM being used in bigendian mode, but I have to assume some large customer wanted it in order to persuade ARM Ltd to pervert the natural course of things. So somewhere out there are a few million processors yearning to be released from bondage. I take comfort from the thought of the overwhelming majority of the approximately 18 *billion* ARM processors being Properly Ended.<br>

&gt;&gt;&gt;<br>
&gt;&gt;&gt;To be honest I really think it&#39;s time we considered changing Squeak to use little-endian form for bitmaps, at least. There aren&#39;t any major systems out there that use big endian any more. If any legacy devices still need it, they can be adapted to use the same tricks that current little-endian machines have to use *every time* something is displayed on screen.<br>

&gt;&gt;&gt;<br>
&gt;&gt;&gt;All I can say is thank goodness that the ATT &#39;Hobbit&#39; processor never took off, with that insane middle-endian nonsense.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;tim<br>
&gt;&gt; -----------------------------------------------------------<br>
&gt;&gt; Louis LaBrunda<br>
&gt;&gt; Keystone Software Corp.<br>
&gt;&gt; SkypeMe callto://PhotonDemon<br>
&gt;&gt; mailto:<a href="mailto:Lou@Keystone-Software.com">Lou@Keystone-Software.com</a> <a href="http://www.Keystone-Software.com" target="_blank">http://www.Keystone-Software.com</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;<br>
-----------------------------------------------------------<br>
Louis LaBrunda<br>
Keystone Software Corp.<br>
SkypeMe callto://PhotonDemon<br>
mailto:<a href="mailto:Lou@Keystone-Software.com">Lou@Keystone-Software.com</a> <a href="http://www.Keystone-Software.com" target="_blank">http://www.Keystone-Software.com</a><br>
<br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>best,<div>Eliot</div>