Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Improving Via C3 performance by masking FPU exceptions
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on Alternative Architectures
View previous topic :: View next topic  
Author Message
coldmist
n00b
n00b


Joined: 05 Jul 2004
Posts: 1

PostPosted: Mon Jul 05, 2004 7:43 pm    Post subject: Improving Via C3 performance by masking FPU exceptions Reply with quote

According to this article, C3 FPU performance can be greatly enhanced by masking FPU exceptions.

Has anyone tried this with gcc on Linux? Is it already being done? If not, could it be added in a few key places to improve C3 performance?

Coldmist
Back to top
View user's profile Send private message
fonzarely
n00b
n00b


Joined: 02 Sep 2003
Posts: 38
Location: Paris

PostPosted: Sun Aug 01, 2004 1:02 am    Post subject: Reply with quote

Hello,

i have a EPIA M-10 000 with VIA C3 Ezra.

My gcc FLAGS :
CHOST="i586-pc-linux-gnu"
CFLAGS="-march=i586 -m3dnow -O3 -pipe -fomit-frame-pointer"

works fine :o

hope to help
Back to top
View user's profile Send private message
cpdsaorg
Guru
Guru


Joined: 16 Oct 2003
Posts: 359

PostPosted: Fri Oct 01, 2004 10:22 pm    Post subject: Reply with quote

question is, is it possible to take advantaggge of thei with a simple gcc flag or is it necessary to add the suggestion to the code directly.
From what I gather from the article this is a coding issue and would have to be put into every piece of software that you use just before a block of code that uses the fp...
_________________
PentiumM 2.0 GHz, MSI 915GM Speedster-FA4, Seagate ST3500641AS SATA 400GB
Back to top
View user's profile Send private message
matthies
n00b
n00b


Joined: 12 Dec 2004
Posts: 16

PostPosted: Wed Dec 29, 2004 10:40 pm    Post subject: Reply with quote

i don't have a c3 so i don't have any way to test this but you might want to try -ffast-math and the options implied by it, such as -fno-math-errno, -fno-trapping-math etc. just have a look in the gcc manual.
Back to top
View user's profile Send private message
racoontje
Veteran
Veteran


Joined: 19 Jul 2004
Posts: 1290

PostPosted: Wed Jan 05, 2005 10:10 pm    Post subject: Reply with quote

matthies:
I suggest you read it yourself ;) -fprofile-use enables all useful math-ish (things that generally only get you performance gains when you're using profiles) CFLAGS, such as -ffast-math...
Back to top
View user's profile Send private message
matthies
n00b
n00b


Joined: 12 Dec 2004
Posts: 16

PostPosted: Thu Jan 06, 2005 3:57 am    Post subject: Reply with quote

to quote from the gcc 3.4.3 online manual:
Code:

-fprofile-use
    Enable profile feedback directed optimizations, and optimizations generally profitable only with profile feedback available.

    The following options are enabled: -fbranch-probabilities, -fvpt, -funroll-loops, -fpeel-loops, -ftracer.


it wouldn't really make sense to wait for profiling to tell you that -ffast-math is faster because it always is.
Back to top
View user's profile Send private message
recordista
n00b
n00b


Joined: 14 May 2004
Posts: 40
Location: Reno, NV (US)

PostPosted: Sun Jan 09, 2005 11:55 pm    Post subject: Reply with quote

fonzarely wrote:
Hello,
i have a EPIA M-10 000 with VIA C3 Ezra.

My gcc FLAGS :
CHOST="i586-pc-linux-gnu"
CFLAGS="-march=i586 -m3dnow -O3 -pipe -fomit-frame-pointer"


I've read several places that, due to the small cache size of the VIA C3 chips, -Os usually works better than -O3. Does someone have newer info?
Back to top
View user's profile Send private message
!equilibrium
Bodhisattva
Bodhisattva


Joined: 06 Jun 2004
Posts: 2109
Location: MI/BG/LC

PostPosted: Thu Apr 28, 2005 4:52 pm    Post subject: Reply with quote

recordista wrote:
fonzarely wrote:
Hello,
i have a EPIA M-10 000 with VIA C3 Ezra.

My gcc FLAGS :
CHOST="i586-pc-linux-gnu"
CFLAGS="-march=i586 -m3dnow -O3 -pipe -fomit-frame-pointer"


I've read several places that, due to the small cache size of the VIA C3 chips, -Os usually works better than -O3. Does someone have newer info?


with gcc 3.3.x and higher you can safely use:

CHOST="i686-pc-linux-gnu"
CFLAGS="-march=c3 -O2 -pipe"
CXXFLAGS="-march=c3 -O2 -pipe -fvisibility-inlines-hidden"

-m3dnow, -fomit-frame-pointer are implicit of -O

optionally you can use: "-ffast-math" and "-Os"
_________________
Arch Tester for Gentoo/FreeBSD
Equilibrium's Universe

all my contents are released under the Creative Commons Licence by-nc-nd 2.5
Back to top
View user's profile Send private message
Voltago
Advocate
Advocate


Joined: 02 Sep 2003
Posts: 2593
Location: userland

PostPosted: Fri May 06, 2005 10:17 am    Post subject: Reply with quote

DarkAngel76 wrote:

with gcc 3.3.x and higher you can safely use:

CHOST="i686-pc-linux-gnu"

Really, for an Ezra CPU? What about Samuel-2? Can you give a source for this? Thanks!
Back to top
View user's profile Send private message
!equilibrium
Bodhisattva
Bodhisattva


Joined: 06 Jun 2004
Posts: 2109
Location: MI/BG/LC

PostPosted: Sat May 07, 2005 12:31 pm    Post subject: Reply with quote

Voltago wrote:
DarkAngel76 wrote:

with gcc 3.3.x and higher you can safely use:

CHOST="i686-pc-linux-gnu"

Really, for an Ezra CPU? What about Samuel-2? Can you give a source for this? Thanks!


i have alsao a notebook with VIA Samuel-2 733Mhz and i use successfuly:

CHOST="i686-pc-linux-gnu"
CFLAGS="-march=c3 -Os -pipe -ffast-math"
CXXFLAGS="-march=c3 -Os -pipe -fvisibility-inlines-hidden -ffast-math"

p.s.: do not use extreme prelink with LDFLAGS because you obtain the opposite effect: slowing down the machine
_________________
Arch Tester for Gentoo/FreeBSD
Equilibrium's Universe

all my contents are released under the Creative Commons Licence by-nc-nd 2.5
Back to top
View user's profile Send private message
Voltago
Advocate
Advocate


Joined: 02 Sep 2003
Posts: 2593
Location: userland

PostPosted: Tue May 10, 2005 3:48 pm    Post subject: Reply with quote

DarkAngel76, can you post the /proc/cpuinfo of your Samuel-2 machine please? I cross-compiled a system with CHOST="i686-pc-linux-gnu" for my epia board and found that bash and sash fail with 'illegal instruction' errors. As soon as a replace them with natively built versions (i586), the system works fine (openssh, openvpn, ...).
Back to top
View user's profile Send private message
!equilibrium
Bodhisattva
Bodhisattva


Joined: 06 Jun 2004
Posts: 2109
Location: MI/BG/LC

PostPosted: Wed May 11, 2005 12:02 pm    Post subject: Reply with quote

Voltago wrote:
DarkAngel76, can you post the /proc/cpuinfo of your Samuel-2 machine please? I cross-compiled a system with CHOST="i686-pc-linux-gnu" for my epia board and found that bash and sash fail with 'illegal instruction' errors. As soon as a replace them with natively built versions (i586), the system works fine (openssh, openvpn, ...).


sure, not a problem:

Code:

processor       : 0
vendor_id       : CentaurHauls
cpu family      : 6
model           : 7
model name      : VIA Samuel 2
stepping        : 2
cpu MHz         : 399.026
cache size      : 64 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 de tsc msr cx8 mtrr pge mmx pni 3dnow
bogomips        : 789.20


without speedfreq:

Code:
processor       : 0
vendor_id       : CentaurHauls
cpu family      : 6
model           : 7
model name      : VIA Samuel 2
stepping        : 2
cpu MHz         : 731.049
cache size      : 64 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 de tsc msr cx8 mtrr pge mmx pni 3dnow
bogomips        : 1445.88


and here is my emerge info:

Code:
Portage 2.0.51.21 (default-linux/x86/2005.0, gcc-3.4.3-20050110, glibc-2.3.4.20050125-r0, 2.6.11-gentoo i686)
=================================================================
System uname: 2.6.11-gentoo i686 VIA Samuel 2
Gentoo Base System version 1.6.6
dev-lang/python:     2.3.5
sys-apps/sandbox:    1.2.2
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.4
sys-devel/binutils:  2.15.92.0.2-r1
sys-devel/libtool:   1.5.2-r7
virtual/os-headers:  2.6.8.1-r2
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-mtune=c3 -Os -pipe -ffast-math"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /var /var/qmail/alias /var/qmail/control /var/vpopmail/domains /var/vpopmail/etc"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-mtune=c3 -Os -pipe -ffast-math -fvisibility-inlines-hidden -ffast-math"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://www.die.unipd.it/pub/Linux/distributions/gentoo-sources"
LINGUAS="it"
MAKEOPTS="-j1 -s"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow X a52 aalib acpi aim alsa apache2 avi bash-completion berkdb bitmap-fonts bmp bzlib cdr crypt cups curl curlwrappers divx4linux dvd dvdr eds emboss encode exif fam flac foomaticdb fortran ftp gd gdbm gif gpg gphoto2 gpm gtk gtk2 gtkhtml guile hal icq imap imlib jack java jpeg junit kde libg++ libwww memlimit mikmod mime ming mmap mmx mng motif mozsvg mozxmlterm mp3 mpeg msn mysql ncurses nls nptl nptlonly objc ogg oggvorbis opengl packagemetabuilds pam pcntl pdflib perl png posix postgres python qmail qt quicktime readline samba scanner sdl session sftplogging simplexml slang socket spamassassin spell sqlite sse ssl svg svga tcltk tcpd tiff truetype truetype-fonts type1-fonts vorbis wmf x86 xine xml xml2 xmlrpc xmms xprint xv xvid yahoo zlib video_cards_sis linguas_it userland_GNU kernel_linux libc_glibc"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS

_________________
Arch Tester for Gentoo/FreeBSD
Equilibrium's Universe

all my contents are released under the Creative Commons Licence by-nc-nd 2.5
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on Alternative Architectures All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum