I did same benchmarks using flops.c (attached) the results are attached
to it seems that
-march=k8 -mtune=k8 -m32 is the fastes but not by much ...
the last one (-m64) is weird (much slower!!) no -OX was used.
gcc -DUNIX flops.c -m32 -march=i386 -mtune=generic -o flops
FLOPS C Program (Double Precision), V2.0 18 Dec 1992
Module Error RunTime MFLOPS
(usec)
1 -8.1208e-11 0.0098 1422.1333
2 -1.5454e-13 0.0089 783.8530
3 1.5743e-13 0.0168 1012.0297
4 9.3703e-14 0.0140 1068.9755
5 -4.6207e-13 0.0224 1297.3674
6 3.9452e-13 0.0199 1454.4546
7 3.8767e-11 0.0212 565.5022
8 4.8178e-13 0.0335 896.7211
Iterations = 512000000
NullTime (usec) = 0.0025
MFLOPS(1) = 846.2281
MFLOPS(2) = 905.5897
MFLOPS(3) = 1060.7272
MFLOPS(4) = 1080.4519
----------------------------------------------------------------------
gcc -DUNIX flops.c -m32 -march=i686 -mtune=generic -o flops
FLOPS C Program (Double Precision), V2.0 18 Dec 1992
Module Error RunTime MFLOPS
(usec)
1 -8.1208e-11 0.0098 1431.2205
2 -1.5454e-13 0.0088 794.2766
3 1.5743e-13 0.0163 1044.5818
4 9.3703e-14 0.0130 1149.6287
5 -4.6207e-13 0.0229 1268.5468
6 3.9452e-13 0.0209 1388.6151
7 3.8767e-11 0.0216 554.2779
8 4.8178e-13 0.0331 905.6038
Iterations = 512000000
NullTime (usec) = 0.0025
MFLOPS(1) = 861.7874
MFLOPS(2) = 897.0299
MFLOPS(3) = 1060.8477
MFLOPS(4) = 1092.0000
----------------------------------------------------------------------
gcc -DUNIX flops.c -m32 -march=i686 -mtune=generic -o flops -msse2
FLOPS C Program (Double Precision), V2.0 18 Dec 1992
Module Error RunTime MFLOPS
(usec)
1 -8.1208e-11 0.0100 1404.3009
2 -1.5454e-13 0.0099 704.9126
3 1.5743e-13 0.0155 1095.0498
4 9.3703e-14 0.0124 1214.3454
5 -4.6207e-13 0.0231 1254.3994
6 3.9452e-13 0.0213 1364.1191
7 3.8767e-11 0.0216 555.0791
8 4.8178e-13 0.0341 878.8647
Iterations = 512000000
NullTime (usec) = 0.0025
MFLOPS(1) = 797.8403
MFLOPS(2) = 901.0181
MFLOPS(3) = 1058.1445
MFLOPS(4) = 1092.8197
-------------------------------------------------------------------------
gcc -DUNIX flops.c -m32 -march=k8 -mtune=k8 -o flops
FLOPS C Program (Double Precision), V2.0 18 Dec 1992
Module Error RunTime MFLOPS
(usec)
1 -8.1208e-11 0.0099 1419.8794
2 -1.5454e-13 0.0089 788.6833
3 1.5743e-13 0.0169 1003.1645
4 9.3703e-14 0.0125 1196.1870
5 -4.6207e-13 0.0225 1287.4672
6 3.9452e-13 0.0205 1416.7053
7 3.8767e-11 0.0212 565.5022
8 4.8178e-13 0.0330 910.3272
Iterations = 512000000
NullTime (usec) = 0.0024
MFLOPS(1) = 847.9532
MFLOPS(2) = 908.9746
MFLOPS(3) = 1069.4690
MFLOPS(4) = 1097.5567
--------------------------------------------------------------------------
gcc -DUNIX flops.c -m32 -march=k8 -mtune=k8 -o flops -msse2
FLOPS C Program (Double Precision), V2.0 18 Dec 1992
Module Error RunTime MFLOPS
(usec)
1 -8.1208e-11 0.0100 1406.5056
2 -1.5454e-13 0.0088 794.2766
3 1.5743e-13 0.0169 1008.2780
4 9.3703e-14 0.0126 1192.4721
5 -4.6207e-13 0.0228 1273.7707
6 3.9452e-13 0.0206 1410.2462
7 3.8767e-11 0.0213 562.6022
8 4.8178e-13 0.0330 907.7447
Iterations = 512000000
NullTime (usec) = 0.0024
MFLOPS(1) = 853.4988
MFLOPS(2) = 904.5371
MFLOPS(3) = 1064.8981
MFLOPS(4) = 1095.6982
--------------------------------------------------------------------------
gcc -DUNIX flops.c -m64 -march=k8 -mtune=k8 -o flops
FLOPS C Program (Double Precision), V2.0 18 Dec 1992
Module Error RunTime MFLOPS
(usec)
1 4.0146e-13 0.0109 1287.2759
2 -1.4166e-13 0.0091 765.1101
3 4.7184e-14 0.0213 799.9499
4 -1.2557e-13 0.0162 927.0304
5 -1.3800e-13 0.0295 984.5539
6 3.2380e-13 0.0272 1065.9873
7 -8.4583e-11 0.0199 603.7359
8 3.4867e-13 0.0370 811.2740
Iterations = 512000000
NullTime (usec) = 0.0025
MFLOPS(1) = 776.1614
MFLOPS(2) = 823.9712
MFLOPS(3) = 902.2225
MFLOPS(4) = 895.5306