[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gm2] Re: Modula-2 remarks
From: |
Gaius Mulley |
Subject: |
[Gm2] Re: Modula-2 remarks |
Date: |
Sun, 08 Apr 2001 13:42:21 +0100 |
Hi Max,
the equivalent of the inline statement in m2f is the asm
(same syntax as gcc, only the asm keyword is in capitals).
So we can write:
IMPLEMENTATION MODULE libtest ;
PROCEDURE sqrt (x: LONGREAL) : LONGREAL ;
BEGIN
ASM(" fldl %1 ; fsqrt" : : "g" (x));
END sqrt ;
END libtest.
and
DEFINITION MODULE libtest ;
EXPORT QUALIFIED sqrt ;
PROCEDURE sqrt (x:LONGREAL) : LONGREAL ;
END libtest.
The same is with gm2, for convenience I've copied a snippet of the gm2.texi
documentation at the bottom of the mail message.
(The documentation needs a lot of work).
I agree with your rationale of library modules. My vote would be for adding
new directories, pim-libs, iso-libs which contain the different dialect
libraries. Both pim-libs and iso-libs may need to import from FIO though
otherwise there would be alot of code duplication. We might also need
different architecture directories (for GNU Modula-2). Though we might
be able to tap into the builtins of the gcc backend for some of the functions.
Maybe we can introduce a Builtin.def to incorporate this cleanly.
> My opinion on GNU Modula-2 :
> The language should be the ISO defined language.
I'm not sure that this dialect is used much, (language not libraries).
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gm2] Re: Modula-2 remarks,
Gaius Mulley <=