Subject: Re: gcc assembler issues
To: Collin Baillie <sanac@optushome.com.au>
From: Simon Burge <simonb@wasabisystems.com>
List: port-pmax
Date: 07/01/2002 22:29:38
"Collin Baillie" wrote:
> > If I'm not mistaken, the mips jump range is 256 MB. Your function is
> > larger than 256 MB??? How much memory do you have in your pmax, anyway?
> > ;-)
Err, that 256 MB should be 256 _kB_ for the branch instructions (or
65,536 instructions). That could easily be reached in 20,000 lines of
code.
> Umm I haven't written this code :) It's actually the 'LDMud' driver package
> by Lars Düning. It's his updated version of the original LPMud driver.
>
> The file in question here is interpret.c, which is some 20,000 lines long. I
> have no idea where I would even begin changing this code. Nor do I really
> know sufficient about MIPS assembly to start playing with the code. :(
Is this in NetBSD's pkgsrc, or elsewhere easily available? I won't
promise a quick answer, but there may turn out to be a simple solution
if we're lucky :-)
> Maybe I'm showing my ignorance. Is $L3655 actually a registry/memory
> address? Or is it (as I assume) a label? If it's just a label, I don't see
> the connection with 256MB function limits etc, and it should merely be a
> case of moving the labelled section so that it was above all calls to it,
> and it should be fine.
It's a local label. Picture a 20,000 line function like:
int
foo()
{
while (<some condition) {
~20k lines of code here
}
return result;
}
and the while loop would have a branch that needs to skip from near the
top of the function to near the bottom. The target of the branch would
be a local label, of the form $L<number>.
Simon.
--
Simon Burge <simonb@wasabisystems.com>
NetBSD Support and Service: http://www.wasabisystems.com/