From: Pascal Obry <p.obry@wanadoo.fr>
Subject: Re: What is faster Ada or C?
Date: 04 Dec 2001 23:37:06 +0100
Date: 2001-12-04T22:39:29+00:00 [thread overview]
Message-ID: <uy9kipq7h.fsf@wanadoo.fr> (raw)
In-Reply-To: 9ugotc$rjl$1@a1-hrz.uni-duisburg.de
Georg Bauhaus <sb463ba@l1-hrz.uni-duisburg.de> writes:
>
> Here is side by side output:
>
> .file "silly.adb" .file "silly.c"
> gcc2_compiled.: gcc2_compiled.:
> ___gnu_compiled_ada: ___gnu_compiled_c:
> .text .text
> .align 4 .align 4
> .globl __ada_silly .globl _silly
> __ada_silly: _silly:
> pushl %ebp pushl %ebp
> movl %esp,%ebp movl %esp,%ebp
> subl $8,%esp subl $8,%esp
> movl $0,-4(%ebp) movl $0,-4(%ebp)
> movl $1,-8(%ebp) movl $1,-8(%ebp)
> L2: L2:
> cmpl $1000,-8(%ebp) cmpl $1000,-8(%ebp)
> jle L5 jle L5
> jmp L3 jmp L3
> .align 2,0x90 .align 2,0x90
> L5: L5:
> incl -4(%ebp) incl -4(%ebp)
> jmp L4 L4:
> .align 2,0x90 incl -8(%ebp)
> jmp L3 jmp L2
> .align 2,0x90 .align 2,0x90
> L6: L3:
> L4: movl -4(%ebp),%edx
> incl -8(%ebp) movl %edx,%eax
> jmp L2 jmp L1
> .align 2,0x90 .align 2,0x90
> L3: L1:
> movl -4(%ebp),%edx movl %ebp,%esp
> movl %edx,%eax popl %ebp
> jmp L1 ret
> .align 2,0x90
> L1:
> movl %ebp,%esp
> popl %ebp
> ret
>
Here is the GNAT 5 output: "-S -gnatp"
.file "silly.adb"
.text
.align 2
.globl __ada_silly
.def __ada_silly; .scl 2; .type 32; .endef
__ada_silly:
pushl %ebp
movl %esp, %ebp
subl $8, %esp
movl $0, -4(%ebp)
movl $1, -8(%ebp)
L2:
cmpl $1000, -8(%ebp)
jle L5
jmp L3
L5:
leal -4(%ebp), %eax
incl (%eax)
leal -8(%ebp), %eax
incl (%eax)
jmp L2
L3:
movl -4(%ebp), %eax
leave
ret
And with "-S -gnatp -O2"
.file "silly.adb"
.text
.align 2
.p2align 4,,15
.globl __ada_silly
.def __ada_silly; .scl 2; .type 32; .endef
__ada_silly:
pushl %ebp
movl $999, %eax
movl %esp, %ebp
.p2align 4,,7
L8:
decl %eax
jns L8
movl $1000, %eax
popl %ebp
ret
Pascal.
--
--|------------------------------------------------------
--| Pascal Obry Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--| http://perso.wanadoo.fr/pascal.obry
--|
--| "The best way to travel is by means of imagination"
next prev parent reply other threads:[~2001-12-04 22:37 UTC|newest]
Thread overview: 74+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-12-01 1:22 What is faster Ada or C? Heiko Hamann
2001-12-01 1:43 ` Aaro Koskinen
2001-12-03 8:49 ` John McCabe
2001-12-04 23:00 ` Florian Weimer
2001-12-05 15:53 ` Ted Dennison
2001-12-06 0:17 ` Jeffrey Carter
2001-12-10 15:18 ` Dale Pontius
2001-12-10 17:44 ` Pascal Obry
2001-12-01 3:44 ` Nick Roberts
2001-12-01 20:09 ` Heiko Hamann
2001-12-02 4:49 ` Jeffrey Carter
2001-12-02 10:44 ` Pascal Obry
2001-12-04 11:43 ` john mann
2001-12-04 14:25 ` Ted Dennison
2001-12-05 9:46 ` John McCabe
2001-12-02 10:07 ` Mark Lundquist
2001-12-03 14:43 ` Ted Dennison
2001-12-09 12:31 ` Robert Dewar
2001-12-01 9:26 ` Gisle Sælensminde
2001-12-01 10:13 ` Pascal Obry
2001-12-02 17:49 ` Bertrand Augereau
2001-12-03 14:39 ` Ted Dennison
2001-12-03 16:19 ` Jeffrey Carter
2001-12-03 19:04 ` Ted Dennison
2001-12-03 20:56 ` Georg Bauhaus
2001-12-03 21:17 ` Preben Randhol
2001-12-03 21:20 ` Preben Randhol
2001-12-04 23:02 ` Florian Weimer
2001-12-05 16:05 ` Georg Bauhaus
2001-12-06 23:33 ` Florian Weimer
2001-12-04 2:35 ` Jeffrey Carter
2001-12-04 6:54 ` Steven Deller
2001-12-04 22:05 ` Bertrand Augereau
2001-12-06 4:25 ` Richard Riehle
2001-12-07 20:02 ` Hyman Rosen
2001-12-09 19:32 ` Richard Riehle
2001-12-11 16:14 ` Hyman Rosen
2001-12-14 0:36 ` Will
2001-12-19 22:23 ` Hyman Rosen
2001-12-17 17:37 ` Richard Riehle
2001-12-20 23:02 ` Hyman Rosen
2001-12-23 4:12 ` Will
2001-12-23 6:41 ` James Rogers
2001-12-04 22:37 ` Pascal Obry [this message]
2001-12-05 15:57 ` Georg Bauhaus
2001-12-05 17:12 ` Larry Kilgallen
2001-12-07 13:21 ` Jacob Sparre Andersen
2001-12-07 15:16 ` Aaro Koskinen
2001-12-07 16:50 ` Preben Randhol
2001-12-07 17:03 ` Jacob Sparre Andersen
2001-12-07 17:26 ` Aaro Koskinen
2001-12-07 18:32 ` Preben Randhol
2001-12-07 20:23 ` Wes Groleau
2001-12-07 17:11 ` Ted Dennison
2001-12-07 18:47 ` Preben Randhol
2001-12-07 16:16 ` Preben Randhol
2001-12-07 17:04 ` Jacob Sparre Andersen
2001-12-07 16:26 ` Ted Dennison
2001-12-07 17:08 ` Jacob Sparre Andersen
2001-12-09 12:27 ` Robert Dewar
2001-12-10 16:51 ` Jacob Sparre Andersen
2001-12-10 17:33 ` Jeff Creem
2001-12-07 16:45 ` Georg Bauhaus
2001-12-07 17:02 ` Preben Randhol
2001-12-07 17:10 ` Jacob Sparre Andersen
2001-12-07 18:12 ` Pascal Obry
2001-12-07 18:50 ` Preben Randhol
2001-12-07 18:54 ` Pascal Obry
2001-12-07 20:40 ` Preben Randhol
2001-12-07 22:01 ` Pascal Obry
2001-12-07 18:19 ` Jeffrey Carter
2001-12-10 9:59 ` Ole-Hjalmar Kristensen
-- strict thread matches above, loose matches on Subject: below --
2001-12-02 19:37 Gautier Write-only-address
2001-12-23 10:33 Gautier Write-only-address
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox