<br><br>
<div class="gmail_quote">On 28 December 2010 22:00, Bob Supnik <span dir="ltr"><<a href="mailto:bob@supnik.org">bob@supnik.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Jason Stevens wrote:<br><br>You didn't build it with -O2 on linux did you?  There is some weird<br>things with GCC and SIMH's VAX...  I can only speak to 4.X BSD, but I<br>
was able to identify two procedures that when optimized with -O2 break<br>4BSD on SIMH....<br><br>I kind of detailed it here:<br><br><a href="http://www.mail-archive.com/simh@trailing-edge.com/msg00463.html" target="_blank">http://www.mail-archive.com/simh@trailing-edge.com/msg00463.html</a><br>
<br>And the procedures in question were:<br><br>op_ldpctx<br>op_mtpr<br><br>---<br><br>Interestingly, those routines are the ONLY places in the VAX simulator where these macros are used:<br><br>/* Machine specific reserved operand tests (all NOPs) */<br>
<br>#define ML_PA_TEST(r)<br>#define ML_LR_TEST(r)<br>#define ML_SBR_TEST(r)<br>#define ML_PXBR_TEST(r)<br>#define LP_AST_TEST(r)<br>#define LP_MBZ84_TEST(r)<br>#define LP_MBZ92_TEST(r)<br><br>On the 780, they are real tests:<br>
<br>/* Machine specific reserved operand tests */<br><br>#define ML_LR_TEST(r)    if ((uint32)((r)&  0xFFFFFF)>  0x200000) RSVD_OPND_FAULT<br>#define ML_PXBR_TEST(r)  if ((((r)&  0x80000000) == 0) || \<br>                           ((r)&  0x00000003)) RSVD_OPND_FAULT<br>
#define ML_SBR_TEST(r)   if ((r)&  0x00000003) RSVD_OPND_FAULT<br>#define ML_PA_TEST(r)    if ((r)&  0x00000003) RSVD_OPND_FAULT<br>#define LP_AST_TEST(r)   if ((r)>  AST_MAX) RSVD_OPND_FAULT<br>#define LP_MBZ84_TEST(r) if ((r)&  0xF8C00000) RSVD_OPND_FAULT<br>
#define LP_MBZ92_TEST(r) if ((r)&  0x7FC00000) RSVD_OPND_FAULT<br><br>---<br><br>One (or more) of those six tests is the smoking gun, and if I had to put my money on it, I think it's this one:<br><br>#define ML_LR_TEST(r)    if ((uint32)((r)&  0xFFFFFF)>  0x200000) RSVD_OPND_FAULT<br>
<br>Try adding an extra level of parentheses:<br><br>if (((uint32)((r)&  0xFFFFFF))>  0x200000) RSVD_OPND_FAULT<br><br><br>just to be sure that the uint32 cast isn't be applied to the whole comparison, instead of just the first term.<br>
<br>If that fails to get it running, then try "no-oping" all of the macros to see if VMS 4.6 will boot.  If it does, then enable each of the macros in turn, to see where the simulator fails.<br><br>/Bob<br><br><br>
</blockquote></div>