# Where is my SSE3??

## OtonVM

Hello everyone.

I'm posting this from the LiveCD, in middle of the install. Early today I got the new pc and put winxp on it (hell, cedega is good, but not good enough...) and tested a bit the hardware. Cpu-z (I think even linux-people know this one) reports that mine is a nice San Diego Athlon 64 3700+ with SSE3 support (I would show you the pic, but I don't know a place for hosting it). But the amd64 livecd gives me this:

```

livecd gentoo # cat /proc/cpuinfo

processor       : 0

vendor_id       : AuthenticAMD

cpu family      : 15

model           : 55

model name      : AMD Athlon(tm) 64 Processor 3700+

stepping        : 2

cpu MHz         : 2211.352

cache size      : 1024 KB

fpu             : yes

fpu_exception   : yes

cpuid level     : 1

wp              : yes

flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt lm 3dnowext 3dnow pni lahf_lm

bogomips        : 4427.42

TLB size        : 1024 4K pages

clflush size    : 64

cache_alignment : 64

address sizes   : 40 bits physical, 48 bits virtual

power management: ts fid vid ttp

```

As far as I can see, there is no SSE3... (btw: macosx gave me the same output). 

Should I put -msse3 to my cflags now??

Tnx in advance to all!

Good Night.

----------

## meax

 *OtonVM wrote:*   

> [...]As far as I can see, there is no SSE3... [...]

 

pni = sse3. See http://en.wikipedia.org/wiki/SSE3

meax

----------

## zxy

I have the same proc. I've put -msse3 to my cflags and works good.

I tested a program that uses sse3 and it worked. But athlon64 arch does not have sse3 support included, so you must put -msse3 to your cflags. 

The cpuinfo will not report sse3 support though. I don't know why.

----------

## zxy

You can test if sse3 works on your computer with this c program. (I found it within this forums once, but I really forgot the name of the author - might be within cflags discussions)

If it works and and does not crash then sse3 is workin'.   :Smile: 

```
#include <stdint.h>

uint8_t __attribute__((aligned(64))) current[64];

uint8_t previous[64];

int main()

{

int i;

uint64_t result;

uint32_t _eax, _ebx, _ecx, _edx;

uint8_t _cpuid[13];

uint32_t *_cpuid0 = (uint32_t*) _cpuid;

uint32_t *_cpuid1 = (uint32_t*) ( _cpuid + 4 );

uint32_t *_cpuid2 = (uint32_t*) ( _cpuid + 8 );

uint8_t *ptr0 = current;

uint8_t *ptr1 = previous;

__asm__ __volatile__ (

"cpuid\n"

: "=a" (_eax),

"=b" (*_cpuid0), "=d" (*_cpuid1), "=c" (*_cpuid2)

: "a" (0) );

_cpuid[12] = 0;

printf( "cpuid(0) returns %d (%s)\n", _eax, _cpuid );

__asm__ __volatile__ (

"cpuid\n"

: "=a" (_eax), "=b" (_ebx), "=c" (_ecx), "=d" (_edx)

: "a" (1) );

printf( "cpuid(1) returns %08x %08x %08x %08x\n",

_eax, _ebx, _ecx, _edx );

memset( current, 0xaa, 64 );

memset( previous, 0x55, 64 );

for( i = 0; i < 4; i ++ ) {

__asm__ __volatile__ (

"movdqa %0, %%xmm0\n"

"movdqu %1, %%xmm1\n"

"psadbw %%xmm1, %%xmm0\n"

"paddw %%xmm0, %%xmm2\n"

"haddps %%xmm2, %%xmm2\n"

"haddps %%xmm2, %%xmm2\n"

: : "m" (*ptr0),

"m" (*ptr1) : "xmm0", "xmm1", "xmm2" );

ptr0 += 16;

ptr1 += 16;

}

__asm__ __volatile__ (

"movq %%xmm2, %0\n"

: "=m" (result) );

printf( "Result is %llu\n", result );

} 

```

----------

## OtonVM

Oh! PNI is SSE3? ok, tnx for the answers. 

How am I supposed to try that program? put it into a .c file and then do something like "gcc file.c"? I read somewhere that it was done this way...

Thank you all again!

----------

## Kaste

Yes

put it in a test.c file 

do gcc test.c -o test 

chmod +x test 

./test and see what happens

----------

## OtonVM

Right! Forgot 'bout making it executable...

Output:

```

livecd Desktop # ./test

cpuid(0) returns 1 (AuthenticAMD)

cpuid(1) returns 00030f72 00000800 00000001 078bfbff

Result is 496498219533200

```

Guess it's ok, then...

Tnx!

----------

## zxy

Yup, it's ok.

----------

## kraut

now thats interessting   :Shocked: 

this does even work on my sempron 2800+   :Shocked:   :Shocked: 

didnt know this one has sse3 too, thanks a lot   :Razz: 

----------

