GCC优化参数
使用方法:可以直接用gcc -march=pentium4 -O3 -ftracer -fprefetch-loop-arrays -funroll-loops -fomit-frame-pointer -pipe -o test test.c 编译
Athlon(雷鸟核心)
代码:
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=athlon-tbird -O2 -pipe -fomit-frame-pointer -frerun-cse-after-loop -frerun-loop-opt -fexpensive-optimizations -falign-functions=4
CXXFLAGS="-march=athlon-tbird -O2 -pipe -fomit-frame-pointer -frerun-cse-after-loop -frerun-loop-opt -fexpensive-optimizations -falign-functions=4
AthlonXP:
代码:
CFLAGS="-O2 -march=athlon-xp -fomit-frame-pointer -ftracer -fprefetch-loop-arrays -pipe"
CXXFLAGS="${CFLAGS} -fvisibility-inlines-hidden"
NEW Athlon 2500+:
代码:
CFLAGS="-march=athlon-xp -O3 -pipe -fomit-frame-pointer -momit-leaf-frame-pointer -ftracer -fno-crossjumping -falign-functions=16 -falign-loops=16 -falign-jumps=16 -fno-align-labels -maccumulate-outgoing-args -fmove-all-movables"
Athlon64:
代码:
CFLAGS="-O2 -march=athlon64 -ftracer -fprefetch-loop-arrays -pipe"
CXXFLAGS="${CFLAGS} -fvisibility-inlines-hidden"
Pentium-m:
代码:
CFLAGS="-O3 -march=pentium-m -mtune=pentium-m -pipe -ftracer -fomit-frame-pointer"
Pentium1 233:
代码:
CHOST="i686-pc-linux-gnu"
CFLAGS="-mcpu=pentium-mmx -march=pentium-mmx -O2 -pipe -fomit-frame-pointer -frerun-cse-after-loop -frerun-loop-opt -fexpensive-optimizations -falign-functions=4"
USE="-gtk -gnome -X -qt -kde alsa cdr"
Pentium2:
代码:
CHOST="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium2 -pipe -fomit-frame-pointer -funroll-loops -mmmx -fforce-addr"
CXXFLAGS="${CFLAGS}"
Pentium4:
代码:
CFLAGS="-march=pentium4 -O3 -ftracer -fprefetch-loop-arrays -funroll-loops -fomit-frame-pointer -pipe"