From patchwork Thu Oct 15 20:13:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 9171 Received: (qmail 123822 invoked by alias); 15 Oct 2015 20:13:43 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 122894 invoked by uid 89); 15 Oct 2015 20:13:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-oi0-f41.google.com MIME-Version: 1.0 X-Received: by 10.202.2.133 with SMTP id 127mr6778001oic.108.1444940019255; Thu, 15 Oct 2015 13:13:39 -0700 (PDT) In-Reply-To: <20151015195427.98E272C3C0E@topped-with-meat.com> References: <20151012232028.GC8797@intel.com> <20151015195427.98E272C3C0E@topped-with-meat.com> Date: Thu, 15 Oct 2015 13:13:39 -0700 Message-ID: Subject: Re: [PATCH 5/6] Optimize i386 syscall inlining From: "H.J. Lu" To: Roland McGrath Cc: GNU C Library On Thu, Oct 15, 2015 at 12:54 PM, Roland McGrath wrote: > This needs comments explaining why the compiler version conditional > makes sense. How about this? 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. */