Include dummy ASM_END definition in mpn/asm-defs.m4 for PowerPC

David Chau ddcc at mit.edu
Wed Apr 12 10:49:23 CEST 2006


For both -O -S and -O -S -fPIC, the compiler generates:

getlocaladdr:
	lis	r3, %hiadj(localvar)
	addi	r3, r3, %lo(localvar)
	blr

getglobaladdr:
	lis	r3, %hiadj(globalvar)
	addi	r3, r3, %lo(globalvar)
	blr

Also, looking at mode1o.asm, it looks like it chooses between table-lookup
via LEA and computing the number arithmetically. If we can't get a generic
version of LEA for PPC, maybe you could have it default to the arithmetic
version.

--David

On Tue 11 Apr 2006 Torbjorn Granlund <tege at swox.com> wrote:

> I don't know anything about some embedded ABI for powerpc.
> Perhaps you could compile a test case,
> 
>         static int *localvar;
>         void *getlocaladdr ()   { return &localvar; }
>         extern int *globalvar;
>         void *getglobaladdr ()  { return &globalvar; }
> 
> using "-O -S" and "-O -S -fPIC" and send both resulting assembly
> files to the list?
> 


More information about the gmp-bugs mailing list