Date: Sun, 9 Sep 2012 14:23:44 -0400 From: Rich Felker <dalias@...ifal.cx> To: musl@...ts.openwall.com Subject: Feelings on macros vs inline in arch/$(ARCH)/syscall_arch.h ? 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
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.