This is the mail archive of the libc-ports@sources.redhat.com mailing list for the libc-ports project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: MIPS crti.S, crtn.S


Richard,

 This fell between the cracks, but I've thought it might be worth 
retrieving and posting anyway... :)

On Fri, 10 Feb 2012, Richard Henderson wrote:

> > I've applied this patch to add MIPS crti.S and crtn.S.  These are closely 
> > based on compiler output and it may be useful to simplify them in future 
> > using the sys/asm.h macros.
> 
> I think there's a fair amount of cleanup that could be done by simply
> relying on assembler macro-ization.  E.g.
> 
> 	jal	PREINIT_FUNCTION
> 
> letting the assembler load the address into $25 for you.  And isn't
> there a pseudo-op that loads the GP?

 .cpsetup

> Yes, the compiler likes to avoid these because it can get better 
> schedules, but they seem ideal for the purposes here.

 FWIW, I agree.  Also there's no need to schedule delay slots manually 
here that GAS would be happy to do itself, it just obfuscates code (and if 
done, then the convention for handcoded MIPS assembly is to indent the 
delay-slot instruction by one space to signify its placement).

 With some aid from <sys/asm.h> it could even be possible to fold these 
files into just a single pair of crti.S and crtn.S used across all the 
MIPS ABIs.

 I may see if I can get some time to do such a clean-up.  And actually 
there are a few other places throughout the MIPS port where the nomacro 
mode and the manual scheduling of delay slots is an overkill.  I'd like to 
get through all of them sometime -- well, we shall see...

  Maciej


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]