tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tinycc-devel] i386 PIC PLT optimization ?


From: Fabrice Bellard
Subject: [Tinycc-devel] i386 PIC PLT optimization ?
Date: Wed, 15 Jan 2003 19:01:14 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020828

Hi,

Did anybody try to improve the i386 ABI for PIC code ? By looking at how the thinks are handled on PowerPC, I think that several improvements are possible, for both smaller and faster code :

1) On i386, the PLT is built by the static linker whereas on PPC it is built dynamically by the dynamic linker. The net result is that the executables are smaller and that indirect jumps can be avoided in the PLT, so the inter DLL/EXEs calls are faster.

2) On i386, it is almost always needed to initialize %ebx properly to the GOT address when entering a DLL function (except for functions calling only static functions and referencing no global data). On PPC, it is only needed to initialize %r30 when accessing global variables.

By using a dynamically generated PLT on i386, we could avoid the %ebx register usage when calling a function by the PLT and so we would need to initialize %ebx only in rare cases (access to global variables).

The net result would be smaller code (because no function prologue in most cases) and faster DLL function calls.

Maybe implementing that in TCC could be interesting :-) A slight patch in ld.so would be needed to support that while staying compatible with standard DLLs.

Fabrice.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]