|
文件名:count.c
源码:
- #include <stdio.h>
- int main(void)
- {
- double counter;
- double result;
- double temp;
- for (counter = 0; counter < 4000.0 * 4000.0 * 4000.0 / 20.0 + 2030;
- counter += (5 -3 + 2 +1 ) / 4)
- { temp = counter / 1239;
- result = counter;
- }
- printf("Result is %lf\n", result);
- return 0;
- }
复制代码
不带优化参数的编译,gcc count.c -o count
- $time ./count
- Result is 3200002029.000000
- real 2m26.640s
- user 2m17.925s
- sys 0m0.136s
复制代码
- $cat /proc/cpuinfo
- processor : 0
- cpu : 7447A, altivec supported
- clock : 1333MHz
- revision : 0.2 (pvr 8003 0102)
- bogomips : 663.55
- machine : PowerBook6,7
- motherboard : PowerBook6,7 MacRISC3 Power Macintosh
- detected as : 287 (Unknown Intrepid-based)
- pmac flags : 00000008
- L2 cache : 512K unified
- memory : 512MB
- pmac-generation : NewWorld
复制代码
- $ gcc -v
- 使用内建 specs。
- 目标:powerpc-linux-gnu
- 配置为:../src/configure -v --enable-languages=c,c++,java,f95,objc,ada,treelang --prefix=/usr --with-gxx-include-dir=/usr/include/c++/4.0.2 --enable-shared --with-system-zlib --libexecdir=/usr/lib --enable-nls --without-included-gettext --enable-threads=posix --program-suffix=-4.0 --enable-__cxa_atexit --enable-libstdcxx-allocator=mt --enable-clocale=gnu --enable-libstdcxx-debug --enable-java-gc=boehm --enable-java-awt=gtk-default --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-4.0-1.4.2.0/jre --enable-mpfr --disable-softfloat --enable-targ
- ets=powerpc-linux,powerpc64-linux --with-cpu=default32 --disable-werror --enable-checking=release powerpc-linux-gnu
- 线程模型:posix
- gcc 版本 4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu9)
复制代码 |
|