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: 530889 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id EBA0114030B for ; Fri, 16 Oct 2015 07:13:49 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b=mxT1asx2; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; q=dns; s=default; b= PdD47aSqFd7T+ELhC19u3y/j7B+Edq40GcII7Ptu3t+3+D+p7l3dpcSAcNpS29L9 gKo4wjPP9KwgqpKAYA49k/8hYDa6uJtukJZQ4tc9lzsnCY2XITVR8nTqepJlR2b9 7ywpFnJbY6lMzjvQFaqfQbAVmaCbMb28w9qmeq63oQE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; s=default; bh=Nvqt7 g7d/2OrqIbioLonoB+NZZA=; b=mxT1asx2qUlzrow1O7USHHUvnssPtbeAcy4mj y9MOWGU8balk3Fd9M/GiPhfxl/fHxE7cZ8vzhWtU+O6wlEuk5zS/H8jCAHfUQgZU /OvBAWpS0aE1zN09VCsgM68ESRfLw9kYAGRiZ71/TfZHPvFbwkQsiYjVLjS1TuP/ kToz6Q= 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. */