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

Henning Thielemann lemming at henning-thielemann.de
Fri Nov 30 14:25:09 CET 2007


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.



More information about the M3devel mailing list