Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Compilers LCC > Code generator ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 5 Topic 1041 of 1058
Post > Topic >>

Code generator detail

by "Bartc" <bc@[EMAIL PROTECTED] > Apr 25, 2008 at 01:00 AM

I think there might be a problem with code for indirect calls:

int *pcptr; /* global */        /* Details from much larger code */
stopped=0;

do {
        ((void(*)(void))*pcptr)();
} while (!stopped);

pcptr usually (99.9%) points to a location containing the address of one
of
two functions, both identical to this:

void pushm {
pcptr += 2;
}

Lccwin generates something like this for the indirect call (in NASM
syntax):

mov eax,[pcptr]
call [eax]

But gcc generates longer code something like:

mov eax,[pcptr]
mov eax,[eax]
call eax

The problem is, the lccwin code take about 3 times longer! For 50m
iterations on my slow machine, about 2400ms for lccwin and about 00ms for
gcc.

I've tried putting in the longer code as inline asm() instructions, and on
a
real test where lccwin32 had been 60% slower than gcc, with this new call,
it was about the same speed as gcc!

-- 
Bart
 




 5 Posts in Topic:
Code generator detail
"Bartc" <bc@  2008-04-25 01:00:44 
Re: Code generator detail
jacob navia <jacob@[EM  2008-04-25 07:58:08 
Re: Code generator detail
"Bartc" <bc@  2008-04-25 09:48:17 
Re: Code generator detail
jacob navia <jacob@[EM  2008-04-25 12:31:47 
Re: Code generator detail
"Bartc" <bc@  2008-04-25 11:32:17 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Jul 6 19:04:31 CDT 2008.