Re: Re: Flat Short of MEMORY_BLOCK

Berend de Boer <[email protected]>
Newsgroups gmane.comp.lang.eiffel.gobo.general
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Berend de Boer <[email protected]> writes:

> I can just raise the iterations to enhance it. I did a couple of runs,
> just copied the first two, and indeed these two look like jitter. Most
> of the time the array was a bit faster though, so that's why I didn't
> look carefully.
>
> I'll have a look at the generated assembly code with -O3.

- -O3 produces different code (don't ask me), but with -O2 the assember
 code looks the same to me. This is the assember code where the buffer
 has become a global variable.


test0 is the routine with the assignment, test1 is the memcpy routine.


	.file	"test.c"
	.version	"01.01"
gcc2_compiled.:
	.section	.rodata
.LC0:
	.byte	 0x61,0x72,0x72,0x61,0x79,0x20,0x25,0x64,0xa,0x0
.LC1:
	.byte	 0x6d,0x65,0x6d,0x63,0x70,0x79,0x20,0x25,0x64,0xa
	.byte	 0x0
.text
	.p2align 2,0x90
.globl main
		.type		 main,@function
main:
	pushl %ebp
	movl %esp,%ebp
	subl $44,%esp
	pushl %edi
	pushl %esi
	pushl %ebx
	addl $-12,%esp
	leal -16(%ebp),%ebx
	pushl %ebx
	call times
	addl $16,%esp
	xorl %eax,%eax
	leal -32(%ebp),%edi
	movl $buffer,%esi
	.p2align 2,0x90
.L27:
	leal 1(%eax),%edx
	movl $99999,%ecx
	leal 99999(%esi),%eax
	.p2align 2,0x90
.L30:
	movb $12,(%eax)
	decl %eax
	decl %ecx
	jns .L30
	movl %edx,%eax
	cmpl $4999,%eax
	jle .L27
	addl $-12,%esp
	pushl %edi
	call times
	addl $-8,%esp
	movl -16(%ebp),%eax
	movl -32(%ebp),%edx
	subl %eax,%edx
	movl %edx,%eax
	pushl %eax
	pushl $.LC0
	call printf
	addl $32,%esp
	addl $-12,%esp
	pushl %ebx
	call times
	addl $16,%esp
	xorl %eax,%eax
	movb $12,%bl
	movl $buffer,%esi
	.p2align 2,0x90
.L38:
	leal 1(%eax),%edx
	movl $99999,%ecx
	leal 99999(%esi),%eax
	.p2align 2,0x90
.L41:
	movb %bl,(%eax)
	decl %eax
	decl %ecx
	jns .L41
	movl %edx,%eax
	cmpl $4999,%eax
	jle .L38
	addl $-12,%esp
	pushl %edi
	call times
	addl $-8,%esp
	movl -16(%ebp),%eax
	movl -32(%ebp),%edx
	subl %eax,%edx
	movl %edx,%eax
	pushl %eax
	pushl $.LC1
	call printf
	leal -56(%ebp),%esp
	popl %ebx
	popl %esi
	popl %edi
	leave
	ret
.Lfe1:
		.size		 main,.Lfe1-main
	.comm	buffer,100000,32
	.p2align 2,0x90
.globl test0
		.type		 test0,@function
test0:
	pushl %ebp
	movl %esp,%ebp
	pushl %ebx
	xorl %eax,%eax
	movl $buffer,%ebx
	.p2align 2,0x90
.L6:
	leal 1(%eax),%edx
	movl $99999,%ecx
	leal 99999(%ebx),%eax
	.p2align 2,0x90
.L10:
	movb $12,(%eax)
	decl %eax
	decl %ecx
	jns .L10
	movl %edx,%eax
	cmpl $4999,%eax
	jle .L6
	popl %ebx
	leave
	ret
.Lfe2:
		.size		 test0,.Lfe2-test0
	.p2align 2,0x90
.globl test1
		.type		 test1,@function
test1:
	pushl %ebp
	movl %esp,%ebp
	pushl %esi
	pushl %ebx
	xorl %eax,%eax
	movl $buffer,%esi
	movb $12,%bl
	.p2align 2,0x90
.L17:
	leal 1(%eax),%edx
	movl $99999,%ecx
	leal 99999(%esi),%eax
	.p2align 2,0x90
.L21:
	movb %bl,(%eax)
	decl %eax
	decl %ecx
	jns .L21
	movl %edx,%eax
	cmpl $4999,%eax
	jle .L17
	popl %ebx
	popl %esi
	leave
	ret
.Lfe3:
		.size		 test1,.Lfe3-test1
	.ident	"GCC: (GNU) c 2.95.4 20020320 [FreeBSD]"


- -- 
Live long and prosper,

Berend de Boer
(PGP public key: http://www.pobox.com/~berend/berend-public-key.txt)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8 <http://mailcrypt.sourceforge.net/>

iD8DBQFAUV48IyuuaiRyjTYRAtTEAKDlBMAJ8Am6Xf6jg9Gq6KkhZzAuzgCg1jhW
A7+vrQvXSCC1+EaFVx9yh2c=
=ZSgO
-----END PGP SIGNATURE-----



------------------------ Yahoo! Groups Sponsor ---------------------~-->
Upgrade to 128-bit SSL Security!
http://us.click.yahoo.com/LPJzrA/yjVHAA/TtwFAA/saFolB/TM
---------------------------------------------------------------------~->

To Post a message, send it to:   [email protected]
To Unsubscribe, send a blank message to: [email protected] 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/gobo-eiffel/

<*> To unsubscribe from this group, send an email to:
     [email protected]

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.