Re: [squeak-dev] Re: Closure VM on XO

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Re: Closure VM on XO

Levente Uzonyi-2
 
On Sat, 5 Mar 2011, Levente Uzonyi wrote:

> On Fri, 4 Mar 2011, Eliot Miranda wrote:
>
> snip
>
>> Does the XO Geode support sse2?  Actually, what is the exact processor in
>> the X0?  Right now the JIT won't use sse2 instructions if they aren;t
>> available, which translates into no machine code floatng-point primitives.
>> But I'm also using sse2 instructions to update the 64-bit microsecond
>> clock, so without some rewrite teh current linux Cog does depend on sse2.
>
> Older XO'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's no MFENCE (just
> SFENCE), so an alternative implementation is necessary for these CPUs.

According to http://www.linuxjournal.com/node/8212/print mfence is only
necessary on x86_64 platforms, so I added the following two lines before
the else branch in sqMemoryFence.h

# elif !defined(__X86_64__)
#       define sqLowLevelMFence() asm volatile ("lock; addl $0,0(%%esp)":::"memory")

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.

The article also mentions smp_mb() which should be used on linux, but I
couldn't find which header file defines it.


Levente

>
>
> Levente
>
>>
>> best
>> Eliot
>
> snip
>
>
Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Re: Closure VM on XO

Eliot Miranda-2
 


On Sun, Mar 6, 2011 at 1:53 PM, Levente Uzonyi <[hidden email]> wrote:
On Sat, 5 Mar 2011, Levente Uzonyi wrote:

On Fri, 4 Mar 2011, Eliot Miranda wrote:

snip

Does the XO Geode support sse2?  Actually, what is the exact processor in
the X0?  Right now the JIT won't use sse2 instructions if they aren;t
available, which translates into no machine code floatng-point primitives.
But I'm also using sse2 instructions to update the 64-bit microsecond
clock, so without some rewrite teh current linux Cog does depend on sse2.

Older XO'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's no MFENCE (just SFENCE), so an alternative implementation is necessary for these CPUs.

According to http://www.linuxjournal.com/node/8212/print mfence is only necessary on x86_64 platforms, so I added the following two lines before the else branch in sqMemoryFence.h

I'm not sure a bout that.  It does state
    "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."

I'd much rather you changed the define to be explicit about X0, than changed for all x86.



# elif !defined(__X86_64__)
#       define sqLowLevelMFence() asm volatile ("lock; addl $0,0(%%esp)":::"memory")

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.

The article also mentions smp_mb() which should be used on linux, but I couldn't find which header file defines it.


Levente



Levente


best
Eliot

snip




Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Re: Closure VM on XO

Levente Uzonyi-2
 
On Sun, 6 Mar 2011, Eliot Miranda wrote:

> On Sun, Mar 6, 2011 at 1:53 PM, Levente Uzonyi <[hidden email]> wrote:
>
>> On Sat, 5 Mar 2011, Levente Uzonyi wrote:
>>
>>  On Fri, 4 Mar 2011, Eliot Miranda wrote:
>>>
>>> snip
>>>
>>>  Does the XO Geode support sse2?  Actually, what is the exact processor in
>>>> the X0?  Right now the JIT won't use sse2 instructions if they aren;t
>>>> available, which translates into no machine code floatng-point
>>>> primitives.
>>>> But I'm also using sse2 instructions to update the 64-bit microsecond
>>>> clock, so without some rewrite teh current linux Cog does depend on sse2.
>>>>
>>>
>>> Older XO'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's no MFENCE
>>> (just SFENCE), so an alternative implementation is necessary for these CPUs.
>>>
>>
>> According to http://www.linuxjournal.com/node/8212/print mfence is only
>> necessary on x86_64 platforms, so I added the following two lines before the
>> else branch in sqMemoryFence.h
>>
>
> I'm not sure a bout that.  It does state
>    "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."
>
> I'd much rather you changed the define to be explicit about X0, than changed
> for all x86.

That's right. Only platforms without SSE2 support should use this. It's
up to you to integrate it. :)


Levente

>
>
>
>> # elif !defined(__X86_64__)
>> #       define sqLowLevelMFence() asm volatile ("lock; addl
>> $0,0(%%esp)":::"memory")
>>
>> 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.
>>
>> The article also mentions smp_mb() which should be used on linux, but I
>> couldn't find which header file defines it.
>>
>>
>> Levente
>>
>>
>>>
>>> Levente
>>>
>>>
>>>> best
>>>> Eliot
>>>>
>>>
>>> snip
>>>
>>>
>>>
>>
>