[M3devel] Disabling runtime checks -> implementation of ROUND and friends

Tony Hosking hosking at cs.purdue.edu
Fri Nov 30 15:17:27 CET 2007


On Nov 30, 2007, at 8:25 AM, Henning Thielemann wrote:

>
> On Thu, 29 Nov 2007, Olaf Wagner wrote:
>
>> http://modula3.elegosoft.com/pm3/pkg/m3build/src/html/m3options.html
>
> Aha.
>
>> It seems to be set from M3_OPTIONS in cm3.cfg:
>>
>>      s.m3_options     := GetConfigArray (s, "M3_OPTIONS");
>>
>> So I'd try to set it there. Perhaps
>>
>>    cm3 -D'M3_OPTIONS=[ "NoChecks" ]"
>>
>> will work, too.
>
>
> $ cm3 -D'M3_OPTIONS=[ "NoChecks" ]'
> LINUXLIBC6/m3make.args, line 3: syntax error: missing: = (found:  
> <string>)
> Fatal Error: package build failed
>
>
> But, the following works:
> $ cm3 -O -D'M3_OPTIONS+=-NoChecks'
>
> where there must be no space between = and -.
>
> Many thanks for the help!
>
> I'm trying to read the code that cm3 produces, because I thought  
> that the
> simple loop I wrote needs too much time. I'm sitting in front of an  
> Intel
> machine and I do not really understand the Intel assembly code (I'm  
> used
> to Motorola :-), but according to the line numbering (.loc  
> directive) it
> seems that 'ROUND' and friends needs lot of time. The count of  
> assembly
> commands is reduced by -NoChecks but still around 20 commands. It  
> seems
> that ROUND, FLOOR and CEILING are implemented manually (checks for
> negative numbers), whereas TRUNC is the shortest, but still about 9
> commands. I do not know whether Intel processors have primitives for
> several rounding modes.

I think the issue here is that GCC's round/trunc/ceiling don't match  
the M3 spec particularly well.  I'd have to look more closely.





More information about the M3devel mailing list