SSE support in 2.4.x
James Macnicol
jamesm at ee.adfa.edu.au
Mon Oct 22 17:24:35 EST 2001
Hello,
I was under the impression that the 2.4.x kernels enable SSE
instructions on Pentium III and later (also Athlon XP) processors by
default without needing a kernel patch as was required for 2.2.x. Can
someone then explain why I get a SIGILL doing the following :
cunegonde(132):~/flow/test% cat psadbw2.c
#include <stdio.h>
int main(void)
{
unsigned sad[2];
unsigned char foo[16] = { 10, 12, 14, 16, 18, 16, 14, 12,
10, 12, 14, 16, 18, 16, 14, 12 };
unsigned char bar[16] = { 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10 };
__asm__ (
"movq %1, %%xmm0\n\t"
"movq %2, %%xmm1\n\t"
"psadbw %%xmm0, %%xmm1\n\t"
"movq %%xmm1, %0\n\t"
: "=m" (*sad)
: "m"(*foo), "m"(*bar)
);
printf("Result = %u,%u\n", *sad, sad[1]);
return (0);
}
cunegonde(0):~/flow/test% gcc -Wall -o psadbw2 psadbw2.c
cunegonde(0):~/flow/test% ./psadbw2
Illegal instruction (core dumped)
cunegonde(132):~/flow/test% uname -a
Linux cunegonde 2.4.12 #2 Fri Oct 19 21:32:30 EST 2001 i686 unknown
cunegonde(0):~/flow/test% dmesg | grep "Pentium III"
CPU: Intel Pentium III (Coppermine) stepping 03
or is my assembler dodgy ? Note that I have CONFIG_MPENTIUMIII set
for the kernel configuration.
Thanks.
--
James Macnicol
j-macnicol at adfa.edu.au
More information about the linux
mailing list