<div>(Sorry this is long.. the short version is for i386 use -O2, where possible, and for the x86_64 -O1 beats -O2!!, and the x86_64 is a good 30% faster)</div><div><br></div>For all my testing, I'm using my desktop, an Intel Q9300 @ 2.5Ghz (quad core cpu, 3MB cache) running OS X 10.6.4, with 8GB of ram.<div>

<br></div><div>I have my machine setup to use the full 64bit kernel</div><div><br></div><div><div>$ uname -a</div><div>Darwin Jason-Stevenss-Mac-Pro.local 10.4.0 Darwin Kernel Version 10.4.0: Fri Apr 23 18:27:12 PDT 2010; root:xnu-1504.7.4~1/RELEASE_X86_64 x86_64</div>

<div><br></div><div><div>$ hostinfo</div><div>Mach kernel version:</div><div><span style="white-space:pre-wrap">  </span> Darwin Kernel Version 10.4.0: Fri Apr 23 18:27:12 PDT 2010; root:xnu-1504.7.4~1/RELEASE_X86_64</div>

<div>Kernel configured for up to 4 processors.</div><div>4 processors are physically available.</div><div>4 processors are logically available.</div><div>Processor type: i486 (Intel 80486)</div><div>Processors active: 0 1 2 3</div>

<div>Primary memory available: 8.00 gigabytes</div><div>Default processor set: 87 tasks, 393 threads, 4 processors</div><div>Load average: 0.03, Mach factor: 3.96</div></div><div><br></div><div><br></div><div>







<p>$ gcc -v</p>
<p>Using built-in specs.</p>
<p>Target: i686-apple-darwin10</p>
<p>Configured with: /var/tmp/gcc/gcc-5664~38/src/configure --disable-checking --enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin10 --program-prefix=i686-apple-darwin10- --host=x86_64-apple-darwin10 --target=i686-apple-darwin10 --with-gxx-include-dir=/include/c++/4.2.1</p>


<p>Thread model: posix</p>
<p>gcc version 4.2.1 (Apple Inc. build 5664)</p><p><br></p><p>Ok, very exciting I know.  I'm testing with 4.3 BSD UWisc [<a href="http://sourceforge.net/projects/bsd42/files/4BSD%20under%20Windows/v0.4/4.3BSD-Uwisc-install-0.4.exe/download">http://sourceforge.net/projects/bsd42/files/4BSD%20under%20Windows/v0.4/4.3BSD-Uwisc-install-0.4.exe/download</a>] from the TUHS, along with gcc 2.7.2.2 in the VM, and the dhyrstone program from <a href="http://www.superglobalmegacorp.com/index.php/Dhrystone.c" target="_blank">http://www.superglobalmegacorp.com/index.php/Dhrystone.c</a></p>

<p><br></p><p>Every time I build vax780, I'm using the first set of flags for all of the program, and the second for the isolated <span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">op_ldpctx,</span><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">op_mtpr procedures..  I'm also listing the exe size for some comparison.</span></p>
<p><br></p><p>When building for the i386 I get the following results:</p>
<p><br></p><p>







</p><p></p>
<p><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<title></title>
<meta name="Generator" content="Cocoa HTML Writer">
<meta name="CocoaVersion" content="1038.32">
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px}
span.Apple-tab-span {white-space:pre}
</style>


</p><p class="p1">-O2/O1<span class="Apple-tab-span">     </span>533,924</p>
<p class="p1">Dhrystone(1.1) time for 500000 passes = 17</p>
<p class="p1">This machine benchmarks at 29411 dhrystones/second</p>
<p class="p1">Dhrystone(1.1) time for 500000 passes = 17</p>
<p class="p1">This machine benchmarks at 29411 dhrystones/second</p>
<p class="p1">Dhrystone(1.1) time for 500000 passes = 17</p>
<p class="p1">This machine benchmarks at 29411 dhrystones/second</p>
<p class="p2"><br></p>
<p class="p1">-O1/-O1<span class="Apple-tab-span">      </span>513,448</p>
<p class="p1">Dhrystone(1.1) time for 500000 passes = 18</p>
<p class="p1">This machine benchmarks at 27777 dhrystones/second</p>
<p class="p1">Dhrystone(1.1) time for 500000 passes = 18</p>
<p class="p1">This machine benchmarks at 27777 dhrystones/second</p>
<p class="p1">Dhrystone(1.1) time for 500000 passes = 18</p>
<p class="p1">This machine benchmarks at 27777 dhrystones/second</p>
<p class="p2"><br></p>
<p class="p1">-Os/-O1<span class="Apple-tab-span">      </span>513,396</p>
<p class="p1">Dhrystone(1.1) time for 500000 passes = 17</p>
<p class="p1">This machine benchmarks at 29411 dhrystones/second</p>
<p class="p1">Dhrystone(1.1) time for 500000 passes = 18</p>
<p class="p1">This machine benchmarks at 27777 dhrystones/second</p>
<p class="p1">Dhrystone(1.1) time for 500000 passes = 17</p>
<p class="p1">This machine benchmarks at 29411 dhrystones/second</p><p></p><p><br></p><p>And as we can see, and what I'd have expected is the -O2/-O1 combination was the most consistent for speed.</p><p>Now onto the 64bit stuff...</p>
<p><br></p><p><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<title></title>
<meta name="Generator" content="Cocoa HTML Writer">
<meta name="CocoaVersion" content="1038.32">
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px}
span.Apple-tab-span {white-space:pre}
</style>


</p><p class="p1">-O2/-O1<span class="Apple-tab-span">    </span>576,112</p>
<p class="p1">Dhrystone(1.1) time for 500000 passes = 14</p>
<p class="p1">This machine benchmarks at 35714 dhrystones/second</p>
<p class="p1">Dhrystone(1.1) time for 500000 passes = 13</p>
<p class="p1">This machine benchmarks at 38461 dhrystones/second</p>
<p class="p1">Dhrystone(1.1) time for 500000 passes = 12</p>
<p class="p1">This machine benchmarks at 41666 dhrystones/second</p>
<p class="p2"><br></p>
<p class="p2"><br></p>
<p class="p1">-O1/-O1<span class="Apple-tab-span">      </span>559,736</p>
<p class="p1">Dhrystone(1.1) time for 500000 passes = 12</p>
<p class="p1">This machine benchmarks at 41666 dhrystones/second</p>
<p class="p1">Dhrystone(1.1) time for 500000 passes = 13</p>
<p class="p1">This machine benchmarks at 38461 dhrystones/second</p>
<p class="p1">Dhrystone(1.1) time for 500000 passes = 13</p>
<p class="p1">This machine benchmarks at 38461 dhrystones/second</p>
<p class="p2"><br></p>
<p class="p1">-O0/-O0<span class="Apple-tab-span">      </span>675,832</p>
<p class="p1">Dhrystone(1.1) time for 500000 passes = 19</p>
<p class="p1">This machine benchmarks at 26315 dhrystones/second</p>
<p class="p1">Dhrystone(1.1) time for 500000 passes = 19</p>
<p class="p1">This machine benchmarks at 26315 dhrystones/second</p>
<p class="p1">Dhrystone(1.1) time for 500000 passes = 19</p>
<p class="p1">This machine benchmarks at 26315 dhrystones/second</p>
<p class="p2"><br></p>
<p class="p1">-O0/-O1<span class="Apple-tab-span">      </span>675,816</p>
<p class="p1">Dhrystone(1.1) time for 500000 passes = 19</p>
<p class="p1">This machine benchmarks at 26315 dhrystones/second</p>
<p class="p1">Dhrystone(1.1) time for 500000 passes = 19</p>
<p class="p1">This machine benchmarks at 26315 dhrystones/second</p>
<p class="p1">Dhrystone(1.1) time for 500000 passes = 17</p>
<p class="p1">This machine benchmarks at 29411 dhrystones/second</p>
<p class="p2"><br></p>
<p class="p1">-Os/-O1<span class="Apple-tab-span">      </span>555,576</p>
<p class="p1">Dhrystone(1.1) time for 500000 passes = 13</p>
<p class="p1">This machine benchmarks at 38461 dhrystones/second</p>
<p class="p1">Dhrystone(1.1) time for 500000 passes = 12</p>
<p class="p1">This machine benchmarks at 41666 dhrystones/second</p>
<p class="p1">Dhrystone(1.1) time for 500000 passes = 14</p>
<p class="p1">This machine benchmarks at 35714 dhrystones/second</p><p class="p1"><br></p><p class="p1">What is interesting to me, is that the -O2 wasn't as fast as the -O1.. I'll have to try this on some other x86_64 platforms to see if it's consistent, but I thought I'd pass along just how much SIMH is on 64bit machines with a 64bit compiler, and that O2 isn't necessarily the best fit....</p>
<p></p><p></p></div></div>