徵求最佳化的 CFLAGS

Moderator: Forums Team

Post Reply
scsi
Posts: 1326
Joined: Tue Oct 14, 2003 7:49 am
Contact:

徵求最佳化的 CFLAGS

Post by scsi »

我家裡有一台amd 2200+的機器
使用 palatis 的 CFLAGS 覺得很滿意

Code: Select all

CFLAGS="-O3 -mcpu=athlon-xp -march=athlon-xp -mmmx -m3dnow -msse -mfpmath=sse -pipe -finline-functions -falign-jumps=4 -falign-loops=4 -falign-functions=64 -funroll-loops -fforce-addr -fomit-frame-pointer -frerun-cse-after-loop -frerun-loop-opt -fexpensive-optimizations"
但是我公司裡有一台pentinm 4 1.6G 的機器,用以下的設定

Code: Select all

CFLAGS="-O3 -mcpu=pentium4 -march=pentium4 -mfpmath=sse -msse2 -mmmx -pipe -finline-functions -falign-jumps=4 -falign-loops=4 -falign-functions=64 -funroll-loops -fforce-addr -fomit-frame-pointer -frerun-cse-after-loop -frerun-loop-opt -fexpensive-optimizations -fschedule-insns2 -falign-functions=4"
發現跑的速度好像慢了點,最慘的是

Code: Select all

xine-lib-1_rc2
xine-lib-1_rc3
xine-lib-1_rc3-r1
都無法正確的compile起來
會出現如以下的的錯誤

Code: Select all

source='cfft.c' object='cfft.lo' libtool=yes \
depfile='.deps/cfft.Plo' tmpdepfile='.deps/cfft.TPlo' \
depmode=gcc3 /bin/sh ../../depcomp \
/bin/sh ../../libtool-nofpic --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../.. -I../../include -I../../include -I../../src -I../../src/xine-engine -I../../src/xine-engine -I../../src/xine-utils  -I../../src/input -I../../src/input  -O3 -mcpu=pentium4 -march=pentium4 -mfpmath=sse -msse2 -mmmx -pipe -finline-functions -falign-jumps=4 -falign-loops=4 -falign-functions=64 -funroll-loops -fforce-addr -fomit-frame-pointer -frerun-cse-after-loop -frerun-loop-opt -fexpensive-optimizations -fschedule-insns2 -falign-functions=4  -Wall -DNDEBUG -D_REENTRANT -D_FILE_OFFSET_BITS=64 -DXINE_COMPILE  -Wpointer-arith -Wnested-externs -Wcast-align -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -O3 -mcpu=pentium4 -march=pentium4 -mfpmath=sse -msse2 -mmmx -pipe -finline-functions -falign-jumps=4 -falign-loops=4 -falign-functions=64 -funroll-loops -fforce-addr -fomit-frame-pointer -frerun-cse-after-loop -frerun-loop-opt -fexpensive-optimizations -fschedule-insns2 -falign-functions=4 -mno-sse2 -mno-sse2 -mno-sse2 -c -o cfft.lo `test -f 'cfft.c' || echo './'`cfft.c
cfft.c: In function `passf2':
cfft.c:560: unable to find a register to spill in class `SSE_REGS'
cfft.c:560: this is the insn:
(insn 663 662 664 (set (subreg:SF (reg/v:DI 29 rmm0 [156]) 0)
        (minus:SF (reg:SF 21 exmm0 [301])
            (mem:SF (reg:SI 0 eax [294]) [4 S4 A32]))) 547 {*fop_sf_1_sse} (insn_list 660 (nil))
    (expr_list:REG_DEAD (reg:SF 21 exmm0 [301])
        (nil)))
cfft.c:560: confused by earlier errors, bailing out
make[4]: *** [cfft.lo] Error 1
make[4]: Leaving directory `/var/tmp/portage/xine-lib-1_rc3-r1/work/xine-lib-1-rc3a/src/libfaad'
make[3]: *** [all-recursive] Error 1
感覺似乎是組語的部份出錯
想問問大家,我這樣的設定有沒有問題,或是有沒有一樣是pentiume 4機器的網友能把你們的CFLAGS的設定給我參考嗎?謝謝 :lol:
世界再大,不過是妳我之間的事
:111.gif: 欲使用GOT的ebuild請看Gentoo 台灣中文 Ebuild 使用指南
Image  我的部落格
User avatar
【Palatis】
Posts: 956
Joined: Wed Apr 02, 2003 4:21 pm
Location: 偶爾插花...</br>亞利安星球
Contact:

Post by 【Palatis】 »

我改設定了.

Desktop 是這樣 (AthlonXP Barton 2600+ @ 1920Mhz)

Code: Select all

CFLAGS="-Os -mcpu=athlon-xp -march=athlon-xp -mmmx -m3dnow -msse -mfpmath=sse -pipe -finline-functions -falign-jumps=4 -falign-loops=4 -falign-functions=64 -funroll-loops -fforce-addr -fomit-frame-pointer -frerun-cse-after-loop -frerun-loop-opt -fexpensive-optimizations -fPIC"
這是 nb1 的 CFLAGS (pentium-mmx 300Mhz)

Code: Select all

CFLAGS="-Os -mcpu=pentium-mmx -march=pentium-mmx -mmmx -finline-functions -fforce-addr -funroll-loops -frerun-cse-after-loop -frerun-loop-opt -fomit-frame-pointer -fexpensive-optimizations -pipe -fPIC"
然後這是我 nb2 的 CFLAGS (pentium3-m 1Ghz)

Code: Select all

CFLAGS="-Os -mcpu=pentium3 -march=pentium3 -mfpmath=sse,387 -mmmx -fforce-addr -fomit-frame-pointer -funroll-loops -frerun-cse-after-loop -frerun-loop-opt -falign-functions=4 -pipe"
這是 PDA 的設定 = = (COMPAQ iPAQ H3630, StrongARM 1110 @ 206Mhz)

Code: Select all

CFLAGS="-mcpu=strongarm1110 -Os -pipe"
對了, nb2 那台 kernel 是 gentoo-dev-sources (2.6.1-gentoo-r1)

pentium4... 不知道, 手上沒有 p4 電腦, 所以沒有研究他的 CFLAGS.
說不定得去 gentoo 官方 forum 找找.
「從麻雀之城回來的時候,被問到『你要大的藤箱還是小的藤箱?』為此煩惱不已。大家都有過這種煩惱吧?」
「是啊是啊!大的藤箱可以放很多東西覺得很划算,小的藤箱小小的裡面也許放著很不錯的東西,真的很難取捨阿!」
「靠這個就能告別這種煩惱『中型的藤箱』!」
「好厲害!」
「不要再煩惱大小的問題了,現在還贈送可以煮出鐵質,增進健康的鐵銼刀。」
「這是一定要買的!」
「我要一個!」
nightmare
Posts: 82
Joined: Thu Dec 18, 2003 1:53 am
Location: 木星連合

Post by nightmare »

我的 CFLAGS 是 "-march=pentium3 -O3 -pipe -mmmx -msse -mfpmath=sse",xine-lib 的問題小弟也有碰到,經人指點後關掉與 mmx、sse 有關的 CFLAGS 後就可以成功編譯了,您可以試試.... :)
另外,gcc 3.2 以下用 pentium4 參數好像會產生錯誤的 sse2 code.....
scsi
Posts: 1326
Joined: Tue Oct 14, 2003 7:49 am
Contact:

Post by scsi »

我目前參考大家的,然後再改一點

Code: Select all

CFLAGS="-O3 -mcpu=pentium4 -march=pentium4 -mfpmath=sse,387 -msse2 -mmmx -fforce-addr -fomit-frame-pointer -funroll-loops -frerun-cse-after-loop -frerun-loop-opt -falign-functions=4 -pipe"
目前xine-lib有compile成功:D
謝謝大家
世界再大,不過是妳我之間的事
:111.gif: 欲使用GOT的ebuild請看Gentoo 台灣中文 Ebuild 使用指南
Image  我的部落格
User avatar
wishy-washy
Posts: 79
Joined: Tue Jan 06, 2004 2:06 pm
Location: Albany, CA
Contact:

Post by wishy-washy »

FYI
http://forums.gentoo.org/viewtopic.php? ... ght=cflags
and
http://www.coyotegulch.com/acovea/

And here is my CFLAGS

Code: Select all

 CFLAGS="-O3 -march=pentium3 -mcpu=pentium4 -pipe -fomit-frame-pointer -fprefetch-loop-arrays -funroll-loops" 
visa
Posts: 111
Joined: Tue Oct 28, 2003 11:15 am

Post by visa »

有PII的嗎
å°
zqyou
Posts: 10
Joined: Thu Dec 11, 2003 3:24 pm
Location: Academia Sinica
Contact:

Post by zqyou »

Mobile Pentium II 400 MHz , (Acer TravelMate 518TX)

CFLAGS="-O3 -march=pentium2 -mmmx -fforce-addr -funroll-loops -frerun-loop-opt -fomit-frame-pointer -pipe -fPIC"
visa
Posts: 111
Joined: Tue Oct 28, 2003 11:15 am

Post by visa »

果然快多了 THX
Si
Posts: 333
Joined: Sun Apr 20, 2003 12:15 pm
Location: New Zealand

Post by Si »

天啊!這麼多時間加了那麼多 flag。那些 flag 我都還沒看有什麼用處......
會比用

Code: Select all

CFLAGS="-march=pentium3 -O3 -pipe -mfpmath=sse -msse -mmmx"
這麼點快很多嗎?
Post Reply