[Simh] O2 optimization on Linux

Tim Riker Tim at Rikers.org
Thu Jan 6 04:48:30 EST 2011


You want the typecast to apply after any math that might be happening in
the expression r.

You should include r in parentheses in the expansion. ie: not (uint32)r
ever, but instead (uint32)(r) so that r is evaluated first before
typecast is applied.

On 01/03/2011 12:57 PM, Jason Stevens wrote:
> wait, it should have been more like this
> 
> 
>> #define ML_SBR_TEST(r) if (((uint32)(r)) & 0xC000003u) != 0) RSVD_OPND_FAULT
>> #define ML_PXBR_TEST(r) if (((((uint32)(r)) & 0x80000000u) == 0) || \
>>                            (((uint32)(r)) & 0x40000003u) != 0))
>> RSVD_OPND_FAULT
> 
> into this:
> 
> #define ML_SBR_TEST(r)  if (((uint32)(r) & 0xC0000003u)!=0) RSVD_OPND_FAULT
> 
> #define ML_PXBR_TEST(r) if (((((uint32)r) & 0x80000000u) == 0) || \
>                             (((uint32)r) & 0x40000003u)!=0) RSVD_OPND_FAULT
> _______________________________________________
> Simh mailing list
> Simh at trailing-edge.com
> http://mailman.trailing-edge.com/mailman/listinfo/simh




More information about the Simh mailing list