This is the mail archive of the
mailing list for the glibc project.
[RFC] space saving optimizations.
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: libc-alpha at sourceware dot org
- Date: Tue, 12 Feb 2013 09:11:23 +0100
- Subject: [RFC] space saving optimizations.
A mempcpy it optimization to use stub to set return value and jump into
memcpy has wider applicability. What I write also applies to other
architectures, if they already do that comments are welcome.
I would like to make convention about this interface.
On x64 implementation is that first instruction sets return value by
moving into rax and do not modifying afterwards. I need some mean to
jump after that instruction.
There is problem how treat ifuncs. There are three possibilities,
First is parametrize function by target ifunc choosed.
Second is use indirect jump with similar selector as ifunc.
Third is jump to fixed implementation.
This can be used in
mempcpy: jump to memcpy
strcat,strncat: jump into strcpy.
strncpy,stpncpy: jump into memset to zero rest of bytes.
memmove: When strings do not overlap we could jump to memcpy
as done in string/memmove.c
I could decrease space usage bit more by function
that handles at most 16 bytes. It would be shared by strcpy/memcpy.