2009-04-17 14:46:37

by Jan Engelhardt

[permalink] [raw]
Subject: SSE soft emulation for Linux?

Hi,


well as it happens, a user reported to me that some binary userspace
blobs shipped with popular game servers crashes with Illegal
Instruction. Upon review, the program tries to execute SSE code, which,
of course, is bound to fail on older CPUs (see below for /proc/cpuinfo).

So I was wondering if there is an SSE emulation kit (for x86_32) similar
to the FPU emu code for arch/x86/, to deal with such cases.

> cat /proc/cpuinfo
processor : 0
vendor_id : AuthenticAMD
cpu family : 6
model : 4
model name : AMD Athlon(tm) Processor
stepping : 4
cpu MHz : 1200.039
cache size : 256 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 1
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca
cmov pat pse36 mmx fxsr syscall mmxext 3dnowext 3dnow up


2009-04-17 15:25:53

by Lennart Sorensen

[permalink] [raw]
Subject: Re: SSE soft emulation for Linux?

On Fri, Apr 17, 2009 at 04:46:25PM +0200, Jan Engelhardt wrote:
> well as it happens, a user reported to me that some binary userspace
> blobs shipped with popular game servers crashes with Illegal
> Instruction. Upon review, the program tries to execute SSE code, which,
> of course, is bound to fail on older CPUs (see below for /proc/cpuinfo).
>
> So I was wondering if there is an SSE emulation kit (for x86_32) similar
> to the FPU emu code for arch/x86/, to deal with such cases.

I think such emulation would be very slow, and completely defeat the
purpose of using SSE in the application in the first place.

I would think either nag the provider to fix the code to support both
with and without SSE, or don't run the code on anything that old.
I guess Pentium 3 and Athlon XP would be the lowest choices.

Nvidia started requiring SSE in their binary drivers, but have since
backed out that requirement, so it is possible to make people realize
their code has unreasonable requirements.

I do find it amusing that microsoft keeps telling people to use
Silverlight, yet it requires SSE so lots of Athlon's and some Pentium
2s running Windows XP are simply out of luck. Flash of course has no
such pointless minimal requirements and works everywhere.

I certainly have a number of non SSE machines in active use, so I
think requiring SSE is a mistake. Maybe in a nother 5 years it will
be reasonable, although by then requiring 64bit might be fair too which
always has SSE.

--
Len Sorensen