On 7/29/07, Darx Kies <[EMAIL PROTECTED]> wrote:
>
> Hi
>
> The HowTo is really great and I am glad we have it finally. :D
>
> There is only one thing that should be changed and that is the Test Case
> Example.
> The AOT already does some basic constant folding that means that when it
> finds something like 1+2
> then it computes that so the if statement becomes if (3 == 3). Other
> optimizations will come later
> and the whole code can be reduced to "return 1;".
>
> So it would be great if the CMP method calls another one that does the
> test and CMP only compares the result and returns 1 or 0.
> Something like this:
>
> public unsafe static uint Misc2 (uint granularity)
> {
> switch (granularity) {
> case 0:
> return 4096;
> case 1:
> return 131072;
> default:
> return 0xFFFFFFFF;
> }
> }
>
> public unsafe static uint CMPMisc2a ()
> {
> if (Misc2 (0) == 4096)
> return 1;
>
> return 0;
> }
>
> That way there will be no such optimizations and the test will be more
> reliable.
I will ammend the Wiki as soon as I get the chance.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
SharpOS-Developers mailing list
SharpOS-Developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sharpos-developers