From patchwork Tue Aug 16 22:04:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vineet Gupta X-Patchwork-Id: 659838 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3sDRH74rqwz9t0X for ; Wed, 17 Aug 2016 08:04:51 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 6B4A58A2AF; Tue, 16 Aug 2016 22:04:47 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xZ48m1B3lg4C; Tue, 16 Aug 2016 22:04:45 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 8EBFB8A1EB; Tue, 16 Aug 2016 22:04:45 +0000 (UTC) X-Original-To: uclibc@lists.busybox.net Delivered-To: uclibc@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 333311C0E3F for ; Tue, 16 Aug 2016 22:04:44 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 2F9F887379 for ; Tue, 16 Aug 2016 22:04:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 00FRLJOMeRF1 for ; Tue, 16 Aug 2016 22:04:43 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from smtprelay.synopsys.com (smtprelay2.synopsys.com [198.182.60.111]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 5DCA386FFC for ; Tue, 16 Aug 2016 22:04:43 +0000 (UTC) Received: from us02secmta2.synopsys.com (us02secmta2.synopsys.com [10.12.235.98]) by smtprelay.synopsys.com (Postfix) with ESMTP id 9AC1A10C0FB7; Tue, 16 Aug 2016 15:04:42 -0700 (PDT) Received: from us02secmta2.internal.synopsys.com (us02secmta2.internal.synopsys.com [127.0.0.1]) by us02secmta2.internal.synopsys.com (Service) with ESMTP id 7BC9255F14; Tue, 16 Aug 2016 15:04:42 -0700 (PDT) Received: from mailhost.synopsys.com (unknown [10.13.184.66]) by us02secmta2.internal.synopsys.com (Service) with ESMTP id 4CAB455F02; Tue, 16 Aug 2016 15:04:42 -0700 (PDT) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id 391C34C1; Tue, 16 Aug 2016 15:04:42 -0700 (PDT) Received: from us01wehtc1.internal.synopsys.com (us01wehtc1.internal.synopsys.com [10.12.239.235]) by mailhost.synopsys.com (Postfix) with ESMTP id EA7FE4C0; Tue, 16 Aug 2016 15:04:41 -0700 (PDT) Received: from IN01WEHTCB.internal.synopsys.com (10.144.199.106) by us01wehtc1.internal.synopsys.com (10.12.239.235) with Microsoft SMTP Server (TLS) id 14.3.266.1; Tue, 16 Aug 2016 15:04:41 -0700 Received: from IN01WEHTCA.internal.synopsys.com (10.144.199.103) by IN01WEHTCB.internal.synopsys.com (10.144.199.105) with Microsoft SMTP Server (TLS) id 14.3.266.1; Wed, 17 Aug 2016 03:34:39 +0530 Received: from vineetg-Latitude-E7450.internal.synopsys.com (10.9.131.254) by IN01WEHTCA.internal.synopsys.com (10.144.199.243) with Microsoft SMTP Server (TLS) id 14.3.266.1; Wed, 17 Aug 2016 03:34:38 +0530 From: Vineet Gupta To: , Subject: [uClibc] ARC: Support syscall ABI v4 Date: Tue, 16 Aug 2016 15:04:27 -0700 Message-ID: <1471385067-1671-1-git-send-email-vgupta@synopsys.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [10.9.131.254] Cc: Cupertino Miranda , Vineet Gupta , linux-snps-arc@lists.infradead.org, Alexey Brodkin , Claudiu Zissulescu X-BeenThere: uclibc@uclibc.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "Discussion and development of uClibc \(the embedded C library\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: uclibc-bounces@uclibc.org Sender: "uClibc" The syscall ABI includes the gcc functional calling ABI since a syscall implies userland caller and kernel callee. The current gcc ABI (v3) for ARCv2 ISA required 64-bit data be passed in even-odd register pairs, (potentially punching reg holes when passing such values as args). This was partly driven by the fact that the double-word LDD/STD instructions in ARCv2 expect the register alignment and thus gcc forcing this avoids extra MOV at the cost of a few unused register (which we have plenty anyways). This however was rejected as part of upstreaming gcc port to HS. So the new ABI v4 doesn't enforce the even-odd reg restriction. Do note that for ARCompact ISA builds v3 and v4 are practically the same in terms of gcc code generation. This change is dormant for now (gcc 4.8.x based tools) and will only kick in with switch to gcc 6.x based tools. Signed-off-by: Vineet Gupta --- libc/sysdeps/linux/arc/bits/uClibc_arch_features.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libc/sysdeps/linux/arc/bits/uClibc_arch_features.h b/libc/sysdeps/linux/arc/bits/uClibc_arch_features.h index 51607240cd82..94e089d5dfa8 100755 --- a/libc/sysdeps/linux/arc/bits/uClibc_arch_features.h +++ b/libc/sysdeps/linux/arc/bits/uClibc_arch_features.h @@ -41,8 +41,14 @@ /* The default ';' is a comment on ARC. */ #define __UCLIBC_ASM_LINE_SEP__ ` -/* does your target align 64bit values in register pairs ? (32bit arches only) */ -#if defined(__A7__) +/* does your target align 64bit values in register pairs ? (32bit arches only) + * - ARC700 never had any constraint on reg pairs (even if ABI v3) + * - Inital HS ABI (v3: non upstream gcc) had 64-bit data aligned in even-odd + * reg pairs (thus allowed reg holes when passing such args to calls) + * - Upstream gcc (6.x) HS ABI doesn't have that restriction + */ + +#if defined(__A7__) || (__GNUC__ > 4) #undef __UCLIBC_SYSCALL_ALIGN_64BIT__ #else #define __UCLIBC_SYSCALL_ALIGN_64BIT__