Patchwork [5/6] Optimize i386 syscall inlining

login
register
mail settings
Submitter H.J. Lu
Date Oct. 15, 2015, 8:13 p.m.
Message ID <CAMe9rOriWgkdxLUx1+Rt8kh7Uguwa9ka_HeJia5-Gpm+7iLVOg@mail.gmail.com>
Download mbox | patch
Permalink /patch/9171/
State New
Headers show

Comments

H.J. Lu - Oct. 15, 2015, 8:13 p.m.
On Thu, Oct 15, 2015 at 12:54 PM, Roland McGrath <roland@hack.frob.com> wrote:
> This needs comments explaining why the compiler version conditional
> makes sense.

How about this?
Roland McGrath - Oct. 15, 2015, 8:27 p.m.
> On Thu, Oct 15, 2015 at 12:54 PM, Roland McGrath <roland@hack.frob.com> wrote:
> > This needs comments explaining why the compiler version conditional
> > makes sense.
> 
> How about this?

Looks OK.

> -- 
> H.J.
> ----
> diff --git a/sysdeps/unix/sysv/linux/i386/sysdep.h
> b/sysdeps/unix/sysv/linux/i386/sysdep.h
> index 5324da6..76db7b8 100644
> --- a/sysdeps/unix/sysv/linux/i386/sysdep.h
> +++ b/sysdeps/unix/sysv/linux/i386/sysdep.h
> @@ -227,6 +227,10 @@
>  extern int __syscall_error (int)
>    attribute_hidden __attribute__ ((__regparm__ (1)));
> 
> +/* Since GCC 5 and above can properly spill %ebx with PIC when needed,
> +   we can inline syscalls with 6 arguments if GCC 5 or above is used
> +   to compile glibc.  */
> +
>  #if !__GNUC_PREREQ (5,0)
>  /* We need some help from the assembler to generate optimal code.  We
>     define some macros here which later will be used.  */

Patch

diff --git a/sysdeps/unix/sysv/linux/i386/sysdep.h
b/sysdeps/unix/sysv/linux/i386/sysdep.h
index 5324da6..76db7b8 100644
--- a/sysdeps/unix/sysv/linux/i386/sysdep.h
+++ b/sysdeps/unix/sysv/linux/i386/sysdep.h
@@ -227,6 +227,10 @@ 
 extern int __syscall_error (int)
   attribute_hidden __attribute__ ((__regparm__ (1)));

+/* Since GCC 5 and above can properly spill %ebx with PIC when needed,
+   we can inline syscalls with 6 arguments if GCC 5 or above is used
+   to compile glibc.  */
+
 #if !__GNUC_PREREQ (5,0)
 /* We need some help from the assembler to generate optimal code.  We
    define some macros here which later will be used.  */