From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1d575f572a099528 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-12-03 13:17:23 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!195.54.122.107!newsfeed1.bredband.com!bredband!uio.no!ntnu.no!not-for-mail From: Preben Randhol Newsgroups: comp.lang.ada Subject: Re: What is faster Ada or C? Date: Mon, 3 Dec 2001 21:17:22 +0000 (UTC) Organization: Norwegian university of science and technology Message-ID: References: <3c08314d$0$158$9b622d9e@news.freenet.de> <3C0BA624.7A12BFA1@boeing.com> <9ugotc$rjl$1@a1-hrz.uni-duisburg.de> NNTP-Posting-Host: kiuk0156.chembio.ntnu.no X-Trace: tyfon.itea.ntnu.no 1007414242 11662 129.241.83.82 (3 Dec 2001 21:17:22 GMT) X-Complaints-To: usenet@itea.ntnu.no NNTP-Posting-Date: Mon, 3 Dec 2001 21:17:22 +0000 (UTC) User-Agent: slrn/0.9.7.3 (Linux) Xref: archiver1.google.com comp.lang.ada:17359 Date: 2001-12-03T21:17:22+00:00 List-Id: On Mon, 3 Dec 2001 20:56:12 +0000 (UTC), Georg Bauhaus wrote: > > 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 > .align 2,0x90 > jmp L3 > .align 2,0x90 > L6: What happens here? I'm not fluent in assembly any more. Why is there a jmp L4 etc in the Ada code and not in the C. Is it range checks ? > L4: L4: > incl -8(%ebp) incl -8(%ebp) > jmp L2 jmp L2 > .align 2,0x90 .align 2,0x90 > L3: L3: > movl -4(%ebp),%edx movl -4(%ebp),%edx > movl %edx,%eax movl %edx,%eax > jmp L1 jmp L1 > .align 2,0x90 .align 2,0x90 > L1: L1: > movl %ebp,%esp movl %ebp,%esp > popl %ebp popl %ebp > ret ret Preben -- () Join the worldwide campaign to protect fundamental human rights. '||} {||' http://www.amnesty.org/