<br><br><div class="gmail_quote">On Sun, Mar 6, 2011 at 1:53 PM, Levente Uzonyi <span dir="ltr">&lt;<a href="mailto:leves@elte.hu">leves@elte.hu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="h5">On Sat, 5 Mar 2011, Levente Uzonyi wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Fri, 4 Mar 2011, Eliot Miranda wrote:<br>
<br>
snip<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Does the XO Geode support sse2?  Actually, what is the exact processor in<br>
the X0?  Right now the JIT won&#39;t use sse2 instructions if they aren;t<br>
available, which translates into no machine code floatng-point primitives.<br>
But I&#39;m also using sse2 instructions to update the 64-bit microsecond<br>
clock, so without some rewrite teh current linux Cog does depend on sse2.<br>
</blockquote>
<br>
Older XO&#39;s have Geode GX, newer have Geode LX CPUs. None of these support SSE at all, just MMX and an extended version of 3DNow!. There&#39;s no MFENCE (just SFENCE), so an alternative implementation is necessary for these CPUs.<br>

</blockquote>
<br></div></div>
According to <a href="http://www.linuxjournal.com/node/8212/print" target="_blank">http://www.linuxjournal.com/node/8212/print</a> mfence is only necessary on x86_64 platforms, so I added the following two lines before the else branch in sqMemoryFence.h<br>
</blockquote><div><br></div><div>I&#39;m not sure a bout that.  It does state</div><div>    &quot;<span class="Apple-style-span" style="font-family: Georgia, serif; font-size: medium; line-height: 20px; ">Although many older x86 implementations accommodated self-modifying code without the need for any special instructions, newer revisions of the x86 architecture no longer require x86 CPUs to be so accommodating. Interestingly enough, this relaxation comes just in time to inconvenience JIT implementors.&quot;</span></div>
<div><span class="Apple-style-span" style="line-height: 20px; "><font class="Apple-style-span" face="arial, helvetica, sans-serif"><br></font></span></div><div><span class="Apple-style-span" style="line-height: 20px; "><font class="Apple-style-span" face="arial, helvetica, sans-serif">I&#39;d much rather you changed the define to be explicit about X0, than changed for all x86.</font></span></div>
<div><span class="Apple-style-span" style="line-height: 20px; "><font class="Apple-style-span" face="arial, helvetica, sans-serif"><br></font></span></div><div><span class="Apple-style-span" style="font-family: Georgia, serif; font-size: medium; line-height: 20px; "><br>
</span></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
# elif !defined(__X86_64__)<br>
#       define sqLowLevelMFence() asm volatile (&quot;lock; addl $0,0(%%esp)&quot;:::&quot;memory&quot;)<br>
<br>
I compiled it with r2361 and it works fine on my 32-bit Ubuntu 10.04. So if the -msse compiler flag is removed from the Makefiles, then Cog should run on the XO-1 too.<br>
<br>
The article also mentions smp_mb() which should be used on linux, but I couldn&#39;t find which header file defines it.<br>
<br>
<br>
Levente<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
Levente<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
best<br>
Eliot<br>
</blockquote>
<br>
snip<br>
<br>
<br>
</blockquote>
<br>
</blockquote></div><br>