gm2
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gm2] Opteron status: 64 bit Modula-2


From: Gaius Mulley
Subject: [Gm2] Opteron status: 64 bit Modula-2
Date: 15 Mar 2004 06:57:12 +0000
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Hi,

I think a milestone has been reached.. GNU Modula-2 now supports the
AMD 64 bit Opteron Processor. Here is a tiny test, first check which
platform we are on:

address@hidden:~/GM2$ uname -a
Linux lancelot 2.4.21-102-smp #1 SMP Wed Sep 24 13:55:59 UTC 2003 x86_64 x86_64 
x86_64 GNU/Linux

now write a simple program to print data sizes:

address@hidden:~/GM2$ cat simplesize.mod
MODULE simplesize ;

FROM NumberIO IMPORT WriteCard ;
FROM StrIO IMPORT WriteString, WriteLn ;
FROM SYSTEM IMPORT ADDRESS, BYTE, BITSET, TSIZE ;


BEGIN
   WriteString('size of INTEGER is ') ; WriteCard(TSIZE(INTEGER), 0) ;
   WriteLn ;
   WriteString('size of CHAR is ') ; WriteCard(TSIZE(CHAR), 0) ;
   WriteLn ;
   WriteString('size of CARDINAL is ') ; WriteCard(TSIZE(CARDINAL), 0) ;
   WriteLn ;
   WriteString('size of ADDRESS is ') ; WriteCard(TSIZE(ADDRESS), 0);
   WriteLn ;
   WriteString('size of BITSET is ') ; WriteCard(TSIZE(BITSET), 0);
   WriteLn ;
   WriteString('size of REAL is ') ; WriteCard(TSIZE(REAL), 0) ;
   WriteLn ;
   WriteString('size of LONGREAL is ') ; WriteCard(TSIZE(LONGREAL), 0) ;
   WriteLn ;
   WriteString('size of LONGCARD is ') ; WriteCard(TSIZE(LONGCARD), 0) ;
   WriteLn ;
   WriteString('size of LONGINT is ') ; WriteCard(TSIZE(LONGINT), 0) ;
   WriteLn
END simplesize.

compile it

address@hidden:~/GM2$ gm2 -B./build-opteron/gcc/stage1/gm2 -c -g -I. 
simplesize.mod

link it

address@hidden:~/GM2$ gm2 -B./build-opteron/gcc/stage1/gm2 -g -I. simplesize.mod

run it

address@hidden:~/GM2$ file a.out
a.out: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 
2.4.1, dynamically linked (uses shared libs), not stripped
address@hidden:~/GM2$ ./a.out
size of INTEGER is 4
size of CHAR is 1
size of CARDINAL is 4
size of ADDRESS is 8
size of BITSET is 4
size of REAL is 8
size of LONGREAL is 16
size of LONGCARD is 8
size of LONGINT is 8
address@hidden:~/GM2$ 


notice the size of ADDRESS 8 bytes and INTEGER 4 bytes. For reference
the API is known as LP64 (C long and C pointer 64 bits, C int 32 bits
etc).

I've not yet checked these sources into CVS as it is still a little
fragile. For the moment I'll probably tar.gz the tree I'm working
on so interested parties can download this port and experiment.
GM2 will compile itself, but known problems that remain are:

* gm2 generates incorrect dwarf2, gstabs+ debugging information
* the gm2 extension to interface to C (varargs) is broken I think..
* it passes 1395 of the regressions tests, but fails 33 regression tests.

on the positive side (apart from the varargs issue) I believe the
sources to gm2 to be 64 bit clean now.

Gaius



reply via email to

[Prev in Thread] Current Thread [Next in Thread]