comp.lang.ada
 help / color / mirror / Atom feed
From: Maxim Reznik <reznikmm@gmail.com>
Subject: Re: Restricted or no run time in Ada
Date: Fri, 4 Jan 2008 01:23:18 -0800 (PST)
Date: 2008-01-04T01:23:18-08:00	[thread overview]
Message-ID: <47bfaa83-b922-426e-8f6f-48e1c4ccacbb@j78g2000hsd.googlegroups.com> (raw)
In-Reply-To: 13d38860-282c-4371-a16f-46425a32d977@l32g2000hse.googlegroups.com

On Jan 3, 10:22 pm, Lucretia <lucret...@lycos.co.uk> wrote:
> Yes, I know of it. Incomplete (I don't know by how much though). Also,
> a guy in #Ada has informed me the code generation is not great.
>
What do guys at #Ada say about GNAT generated code?

An example:
procedure Test (X : in out Integer)
is
begin
   X := X +
1;
end
Test;

--------------------------------------
GNAT:
_ada_test:
.LFB3:
        pushl
%ebp
.LCFI0:
        movl    %esp,
%ebp
.LCFI1:
        pushl
%ebx
.LCFI2:
        subl    $20,
%esp
.LCFI3:
        movl    8(%ebp),
%eax
 
cltd
        movl    %eax,
%ecx
        movl    %edx,
%ebx
        addl    $1,
%ecx
        adcl    $0,
%ebx
        movl    %ecx,
%eax
        movl    %ebx,
%edx
        addl    $-2147483648,
%eax
        adcl    $0,
%edx
        cmpl    $0,
%edx
 
jbe     .L6
        movl    $3,
4(%esp)
        movl    $.LC0,
(%esp)
        call
__gnat_rcheck_10
.L6:
        movl    %ecx,
%eax
        addl    $20,
%esp
        popl
%ebx
        popl
%ebp
 
ret
--------------------------------------

Gela over ten15 (http://www.ten15.org/wiki/Ada) :
--------------------------------------
Test:
.set .Ldisp5,
0
 movl 4+.Ldisp5(%esp),
%eax
 incl
%eax
 
jno .L7
 pushl
$7
 movl __trans386_errhandler,
%eax
 call *
%eax
.L7:
 movl %eax,
4+.Ldisp5(%esp)
 
ret
--------------------------------------

Of course Gela project is far away of completion and not yet ready to
be
used in your project, but code it can generate for now not much worse
then one of others compilers.

--
Maxim Reznik



  reply	other threads:[~2008-01-04  9:23 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-02 19:19 Restricted or no run time in Ada Lucretia
2008-01-02 20:49 ` anon
2008-01-02 21:33   ` Lucretia
2008-01-03  3:50     ` anon
2008-01-02 22:23   ` Simon Wright
2008-01-02 23:06     ` Lucretia
2008-01-03  5:14       ` roderick.chapman
2008-01-03  7:30         ` Lucretia
2008-01-03  8:00         ` Lucretia
2008-01-03  8:40           ` Lucretia
2008-01-03  9:58         ` anon
2008-01-03 10:22           ` Lucretia
2008-01-03 17:30             ` anon
2008-01-03 20:05               ` Vadim Godunko
2008-01-03 20:22                 ` Lucretia
2008-01-04  9:23                   ` Maxim Reznik [this message]
2008-01-04 23:23                     ` Brian May
2008-01-04 12:46                   ` Georg Bauhaus
2008-01-04 13:53                     ` Vadim Godunko
2008-01-04 14:13                     ` Maxim Reznik
2008-01-04 14:15   ` Lucretia
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox