# question about SSE3 and my processor

## pjunod

I have a few questions i haven't been able to get answers to searching here or on linuxquestions.org. 

First, what does SSE3 show up as under flags when you cat /proc/cpuinfo?

I have SMT and Pentium 4 selected in my kernel as well as having the system type set to pc-compatible. 

I recently realized i had been using the wrong cflag for my processor. I was using -march=pentium4 when i should have been using -march=nocona. I changed this, recompiled gcc, recompiled my kernel, rebooted, and did an emerge -e world.  When i cat /proc/cpuinfo it still does not show SSE3 as a flag.  I am quite sure my cpu has SSE3.  It is a P4 3.4GHz LGA775 cpu with 1M L2 cache.  If the flag is not SSE3 as i expect it would be, could someone please tell me what i'm doing wrong?

```

$ cat /proc/cpuinfo

processor       : 0

vendor_id       : GenuineIntel

cpu family      : 15

model           : 3

model name      : Intel(R) Pentium(R) 4 CPU 3.40GHz

stepping        : 4

cpu MHz         : 3464.064

cache size      : 1024 KB

physical id     : 0

siblings        : 2

core id         : 0

cpu cores       : 1

fdiv_bug        : no

hlt_bug         : no

f00f_bug        : no

coma_bug        : no

fpu             : yes

fpu_exception   : yes

cpuid level     : 5

wp              : yes

flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe constant_tsc pni monitor ds_cpl cid xtpr

bogomips        : 6933.67

clflush size    : 64

processor       : 1

vendor_id       : GenuineIntel

cpu family      : 15

model           : 3

model name      : Intel(R) Pentium(R) 4 CPU 3.40GHz

stepping        : 4

cpu MHz         : 3464.064

cache size      : 1024 KB

physical id     : 0

siblings        : 2

core id         : 0

cpu cores       : 1

fdiv_bug        : no

hlt_bug         : no

f00f_bug        : no

coma_bug        : no

fpu             : yes

fpu_exception   : yes

cpuid level     : 5

wp              : yes

flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe constant_tsc pni monitor ds_cpl cid xtpr

bogomips        : 6928.22

clflush size    : 64

```

```

$ emerge --info

Portage 2.1.3.9 (default-linux/x86/2007.0, gcc-4.1.2, glibc-2.5-r4, 2.6.21-gentoo-r4 i686)

=================================================================

System uname: 2.6.21-gentoo-r4 i686 Intel(R) Pentium(R) 4 CPU 3.40GHz

Timestamp of tree: Sat, 22 Sep 2007 17:00:02 +0000

app-shells/bash:     3.2_p17

dev-java/java-config: 1.3.7, 2.0.33-r1

dev-lang/python:     2.4.4-r5

dev-python/pycrypto: 2.0.1-r6

sys-apps/baselayout: 1.12.9-r2

sys-apps/sandbox:    1.2.17

sys-devel/autoconf:  2.13, 2.61-r1

sys-devel/automake:  1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10

sys-devel/binutils:  2.17-r1

sys-devel/gcc-config: 1.3.16

sys-devel/libtool:   1.5.24

virtual/os-headers:  2.6.21

ACCEPT_KEYWORDS="x86"

CBUILD="i686-pc-linux-gnu"

CFLAGS="-O2 -march=nocona -pipe -fomit-frame-pointer"

CHOST="i686-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"

CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo"

CXXFLAGS="-O2 -march=nocona -pipe -fomit-frame-pointer"

DISTDIR="/usr/portage/distfiles"

FEATURES="distlocks metadata-transfer sandbox sfperms strict unmerge-orphans userfetch"

GENTOO_MIRRORS="http://www.gtlib.gatech.edu/pub/gentoo"

MAKEOPTS="-j4"

PKGDIR="/usr/portage/packages"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

SYNC="rsync://rsync.gentoo.org/gentoo-portage"

USE="X aac aalib acl acpi aim alsa apache2 arts artswrappersuid asf avi bash-completion berkdb bidi bitmap-fonts bluetooth bzlib cairo cddb cdparanoia cdr cli cracklib crypt cscope cups dbus dga dio divx divx4linux dri dts dvd dvdr dvdread emacs encode esd exif fastcgi fbcon ffmpeg firefox flac flash fortran freetds gd gdbm ggi gif gnome gphoto2 gpm gstreamer gtk gtk2 gtkhtml iconv ieee1394 imlib innodb isdnlog jabber java javascript jikes jpeg kde kerberos leim libg++ lirc mad midi mime mmx mmx2 mmxext mp3 mpeg mplayer msn mudflap mysql mysqli nas ncurses nls nocd nptl nptlonly nsplugin offensive ogg oggvorbis openal opengl openmp oss pam pcre pdflib perl php png pppd python qt3 qt4 quicktime rdesktop readline reflection samba sdl session snmp spell spl sse sse2 ssl ssse3 svg sysfs tcl tcpd tiff tk tokenizer truetype-fonts type1-fonts unicode usb v4l vcd videos vim-syntax vorbis win32codecs wxwindows x86 xcomposite xine xinerama xml xml2 xmlrpc xorg xosd xv xvid zlib" ALSA_CARDS="emu10k1" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIRC_DEVICES="audio_alsa creative" USERLAND="GNU" VIDEO_CARDS="nvidia vesa"

Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY

```

My second question is why i cannot get mplayer to pick up the fact that i have sse3.  I have the ssse3 use flag and have compiled mplayer with that flag enabled.  Still, when it starts, it does not show sse3 as one of the flags that my cpu has. 

```

[ebuild   R   ] media-video/mplayer-1.0_rc1_p20070824  USE="X a52 aac aalib alsa arts bidi cddb cdparanoia cpudetection dga dts dvd encode esd fbcon ggi gif gtk iconv jpeg lirc live mad mmx mmxext mp3 nas openal opengl oss png quicktime samba sdl sse sse2 ssse3 unicode v4l v4l2 vorbis win32codecs x264 xinerama xv xvid -3dnow -3dnowext (-altivec) -amrnb -amrwb -bindist -bl -cdio -custom-cflags -directfb -doc -dv -dvb -enca -ftp -ipv6 -ivtv -jack -joystick -libcaca -livecd -lzo -md5sum -mp2 -musepack -pnm -pvr -radio -rar -real -rtc -speex -srt -svga -teletext -tga -theora -tivo -truetype -vidix -xanim -xvmc -zoran" VIDEO_CARDS="nvidia vesa -i810 -mga -s3virge -tdfx" 0 kB

```

```

$ mplayer <some file>

MPlayer SVN-r24130 (C) 2000-2007 MPlayer Team

CPU: Intel(R) Pentium(R) 4 CPU 3.40GHz (Family: 15, Model: 3, Stepping: 4)

CPUflags:  MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1

Compiled with runtime CPU detection.

```

----------

## i92guboj

 *pjunod wrote:*   

> I have a few questions i haven't been able to get answers to searching here or on linuxquestions.org. 
> 
> First, what does SSE3 show up as under flags when you cat /proc/cpuinfo?
> 
> 

 

SSE3 equals to PNI (which in turn, stands for "Prescott New Instructions").

 *Quote:*   

> 
> 
> I have SMT and Pentium 4 selected in my kernel as well as having the system type set to pc-compatible. 
> 
> 

 

If you are using nocona, then all is fine. -msse3 is implicit on that -march setting. There is absolutely nothing wrong with your setup.

----------

## CooSee

 *pjunod wrote:*   

> I have a few questions i haven't been able to get answers to searching here or on linuxquestions.org. 
> 
> First, what does SSE3 show up as under flags when you cat /proc/cpuinfo?
> 
> I have SMT and Pentium 4 selected in my kernel as well as having the system type set to pc-compatible. 
> ...

 

IMHO ' sse3' is ' pni '   :Exclamation: 

cat /proc/cpuinfo

processor       : 0

vendor_id       : AuthenticAMD

cpu family      : 15

model           : 43

model name      : AMD Athlon(tm) 64 X2 Dual Core Processor 4200+

stepping        : 1

cpu MHz         : 1000.000

cache size      : 512 KB

physical id     : 0

siblings        : 2

core id         : 0

cpu cores       : 2

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 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt lm 3dnowext 3dnow pni lahf_lm cmp_legacy ts fid vid ttp

bogomips        : 2010.90

clflush size    : 64

processor       : 1

vendor_id       : AuthenticAMD

cpu family      : 15

model           : 43

model name      : AMD Athlon(tm) 64 X2 Dual Core Processor 4200+

stepping        : 1

cpu MHz         : 1000.000

cache size      : 512 KB

physical id     : 0

siblings        : 2

core id         : 1

cpu cores       : 2

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 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt lm 3dnowext 3dnow pni lahf_lm cmp_legacy ts fid vid ttp

bogomips        : 2010.90

clflush size    : 64

please goto GenToo WiKi:

http://gentoo-wiki.com/Safe_Cflags#Pentium_4

Note: You can verify the chip is a Prescott by looking for pni in the flags section of /proc/cpuinfo. This indicates support for SSE3.

CooSee ' Ya

----------

## pjunod

I had read about the pni flag being for sse3, but when mplayer didn't pick up the sse3 exensions after being compiled with them, it made me wonder. 

Can anyone tell me why mplayer is still not picking up my sse3 extensions?

----------

## Coelacanth

I think that the mplayer ebuild filters out your CCFLAGS but allows control over the instruction set with use flags.

----------

## i92guboj

 *pjunod wrote:*   

> I had read about the pni flag being for sse3, but when mplayer didn't pick up the sse3 exensions after being compiled with them, it made me wonder. 
> 
> Can anyone tell me why mplayer is still not picking up my sse3 extensions?

 

 *Coelacanth wrote:*   

> I think that the mplayer ebuild filters out your CCFLAGS but allows control over the instruction set with use flags.

 

Yes and no. Don't worry, I explain.

If you use -msse3 (or use an -march which just includes it, like nocona), gcc will output sse3 specific code where it thinks it will be ok to do so. In that regard, your mplayer is built using sse3 object code. But when it complains about sse3 being disable it means a different thing.

The sse3 flag in mplayer is used to enable a ./configure option which, in turn, enables handmade specific optimized code by some -human- genius to take advantage of the sse3 features. In other words: if you enable or disable that use flag, you are compiling -slightly- different sources, because the sse3 stuff is only compiled if you decide that you should enable it.

When mplayer complains about it not being on, it means that that piece of the source has not been compiled into the mplayer binary file, because you disabled that use flag. It has nothing to do with the architecture the binary was made for.

Your mplayer can be compiled using gcc -msse3 (and as such, it will contain bits of sse3 stuff), but without the specific sse3 source pieces that the mplayer programmers did for it, to add further optimization.

That kind of cpu optimization is the kind of optimization that really works. And that is why things like mencoder, greatly benefit from these features, while the rest of the system doesn't care at all, because just setting sse3 on/off on your cflags will not improve or degrade anything in a noticeable manner.

----------

