mailing list of musl libc
 help / color / mirror / code / Atom feed
* Feelings on macros vs inline in arch/$(ARCH)/syscall_arch.h ?
@ 2012-09-09 18:23 Rich Felker
  2012-09-12 16:21 ` Arvid E. Picciani
  0 siblings, 1 reply; 3+ messages in thread
From: Rich Felker @ 2012-09-09 18:23 UTC (permalink / raw)
  To: musl

In the process of optimizing mips and arm inline syscalls, it's come
to my attention that it could be beneficial for the inline syscall asm
to know that the syscall number is a constant. At present, due to our
use of inline functions rather than macros for inline syscalls, the
syscall number is never a "constant expression", and thus not suitable
for expansion as an immediate in inline asm.

What are the prevailing feelings on possibly changing this?

Using inline functions is nicer from standpoint of clean, more
standards-like (albeing __asm__-using) C code, and perhaps also helps
with debugging at -O0 where you can really see the call (as opposed to
a hideous inline macro expansion)

Using macros (which would necessitate GNU C "statement-expression"
hacks to get the return value) makes it possible to utilize the fact
that the syscall number is a constant, which could improve code
generation especially on mips and i386/PIC. The improvements would
mainly be in the areas of size and optimizing the surrounding code;
userspace code performance is all but irrelevant to the syscall
itself.

Rich


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-09-12 17:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-09 18:23 Feelings on macros vs inline in arch/$(ARCH)/syscall_arch.h ? Rich Felker
2012-09-12 16:21 ` Arvid E. Picciani
2012-09-12 17:39   ` Rich Felker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).