Author: Dieter Buerssner
Date: 06:21:59 07/17/03
Go up one level in this thread
I may add: If you want to try the source, I suggest to not use inlining of the compiler. All the work is done in a very simple loop inside one function. Inlining can make things only worse. I used cl -O2 dblat.c. The test loop gives the following assembly: PUBLIC _access_loop ; COMDAT _access_loop _TEXT SEGMENT _buf$ = 8 _access_loop PROC NEAR ; COMDAT ; Line 21 mov eax, DWORD PTR _buf$[esp-4] mov ecx, 10000000 ; 00989680H $L770: ; Line 27 mov eax, DWORD PTR [eax] ; Line 38 dec ecx mov edx, DWORD PTR [eax] mov eax, DWORD PTR [edx] mov edx, DWORD PTR [eax] mov eax, DWORD PTR [edx] mov edx, DWORD PTR [eax] mov eax, DWORD PTR [edx] mov edx, DWORD PTR [eax] mov eax, DWORD PTR [edx] mov eax, DWORD PTR [eax] jne SHORT $L770 ; Line 40 ret 0 _access_loop ENDP And with Gcc: .globl _access_loop _access_loop: pushl %ebp movl $10000000, %edx movl %esp, %ebp movl 8(%ebp), %eax .p2align 4,,7 L3: movl (%eax), %eax decl %edx movl (%eax), %eax movl (%eax), %eax movl (%eax), %eax movl (%eax), %eax movl (%eax), %eax movl (%eax), %eax movl (%eax), %eax movl (%eax), %eax movl (%eax), %eax jne L3 popl %ebp ret Regards, Dieter Regards, Dieter
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.