From patchwork Mon Oct 27 07:59:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Pinski X-Patchwork-Id: 39583 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f69.google.com (mail-ee0-f69.google.com [74.125.83.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3DC1D2118A for ; Mon, 27 Oct 2014 08:03:51 +0000 (UTC) Received: by mail-ee0-f69.google.com with SMTP id c13sf920746eek.0 for ; Mon, 27 Oct 2014 01:03:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:mailing-list :precedence:list-id:list-unsubscribe:list-subscribe:list-archive :list-post:list-help:sender:delivered-to:from:to:cc:subject:date :message-id:in-reply-to:references:x-original-sender :x-original-authentication-results; bh=0EByBBl9Ela37KdZuHALRukI6bWgw/nDjY9rxytqxkU=; b=VaWL6Ma8xoSqR3GBafn3iTuy/F1NXGHsJ//5ym3ZslqynmeuVmf7c3wvs8YSRH1fSH 3pzc6fQnxEuCm2Q+y69LAdEEOW6+XPoMakwAzDqmM0KIKHLFu3HNoV5coEv4gxE/y6A1 wADx9HmRK36r2NCX8Y/UBOkhqU3Q783L68DPpERX64gIXPaDEzN0SN2rl2BHmytnz1qF xFHitS1YOZ5EKg3TSUx0OHHoDjSSc8FNIdfKzikfBC5qMb6Q1tdobwD/A/eT93LcQ6J1 LW7Mo1XFBg6EtjvpBQZro5q5PSxwkeu70J5oWvFpk/4gBLM5pPmvIlZViov91d7VCeRT ASVQ== X-Gm-Message-State: ALoCoQkAcqHNF/h6BjhEWJLlItFRAR6O38e0PIojiKJ7Hx+13oBy/OXzGG4zGzy+hldyz0eVxuJ5 X-Received: by 10.112.26.82 with SMTP id j18mr111026lbg.16.1414397030386; Mon, 27 Oct 2014 01:03:50 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.203.167 with SMTP id kr7ls645091lac.94.gmail; Mon, 27 Oct 2014 01:03:49 -0700 (PDT) X-Received: by 10.152.87.98 with SMTP id w2mr21383079laz.27.1414397029860; Mon, 27 Oct 2014 01:03:49 -0700 (PDT) Received: from mail-lb0-x230.google.com (mail-lb0-x230.google.com. [2a00:1450:4010:c04::230]) by mx.google.com with ESMTPS id lk6si18663164lac.74.2014.10.27.01.03.49 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 27 Oct 2014 01:03:49 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::230 as permitted sender) client-ip=2a00:1450:4010:c04::230; Received: by mail-lb0-f176.google.com with SMTP id p9so5320650lbv.35 for ; Mon, 27 Oct 2014 01:03:49 -0700 (PDT) X-Received: by 10.112.140.5 with SMTP id rc5mr2462260lbb.32.1414397029234; Mon, 27 Oct 2014 01:03:49 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.84.229 with SMTP id c5csp247608lbz; Mon, 27 Oct 2014 01:03:48 -0700 (PDT) X-Received: by 10.68.129.103 with SMTP id nv7mr22818448pbb.56.1414397027707; Mon, 27 Oct 2014 01:03:47 -0700 (PDT) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id y1si9962865pdo.45.2014.10.27.01.03.46 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Oct 2014 01:03:47 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-53814-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 16375 invoked by alias); 27 Oct 2014 08:00:20 -0000 Mailing-List: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org Precedence: list 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 15445 invoked by uid 89); 27 Oct 2014 08:00:02 -0000 X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, KAM_STOCKGEN, RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 X-HELO: mail-ie0-f174.google.com X-Received: by 10.50.112.165 with SMTP id ir5mr20259503igb.44.1414396798283; Mon, 27 Oct 2014 00:59:58 -0700 (PDT) From: Andrew Pinski To: libc-alpha@sourceware.org Cc: Andrew Pinski Subject: [PATCH 10/29] [AARCH64] Add PTR_REG, PTR_LOG_SIZE, and PTR_SIZE. Use it in LDST_PCREL and LDST_GLOBAL. Date: Mon, 27 Oct 2014 00:59:34 -0700 Message-Id: <1414396793-9005-11-git-send-email-apinski@cavium.com> In-Reply-To: <1414396793-9005-1-git-send-email-apinski@cavium.com> References: <1414396793-9005-1-git-send-email-apinski@cavium.com> X-Original-Sender: apinski@cavium.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::230 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@sourceware.org X-Google-Group-Id: 836684582541 This patch adds a few extra macros which are useful for ILP32 and updates PTR_MANGLE and PTR_DEMANGLE to use the some of the new macros. * sysdeps/aarch64/sysdep.h (PTR_REG): New macro. (PTR_LOG_SIZE): New macro. (PTR_SIZE): New macro. (LDST_PCREL): Use arguments as register numbers rather register names. Use PTR_REG for the register when loading. * sysdeps/unix/sysv/linux/aarch64/sysdep.h (PTR_MANGLE): Add a comment about that the arguments are register numbers rather register names. (PTR_DEMANGLE): Likewise. * sysdeps/aarch64/__longjmp.S (__longjmp): Update calls to PTR_DEMANGLE. * sysdeps/aarch64/setjmp.S (__sigsetjmp): Update calls to PTR_MANGLE. --- sysdeps/aarch64/__longjmp.S | 4 ++-- sysdeps/aarch64/setjmp.S | 4 ++-- sysdeps/aarch64/sysdep.h | 28 ++++++++++++++++++---------- sysdeps/unix/sysv/linux/aarch64/sysdep.h | 8 ++++++-- 4 files changed, 28 insertions(+), 16 deletions(-) diff --git a/sysdeps/aarch64/__longjmp.S b/sysdeps/aarch64/__longjmp.S index 1bb7be36..e1a1cf2 100644 --- a/sysdeps/aarch64/__longjmp.S +++ b/sysdeps/aarch64/__longjmp.S @@ -53,7 +53,7 @@ ENTRY (__longjmp) ldp x27, x28, [x0, #JB_X27<<3] #ifdef PTR_DEMANGLE ldp x29, x4, [x0, #JB_X29<<3] - PTR_DEMANGLE (x30, x4, x3, x2) + PTR_DEMANGLE (30, 4, 3, 2) #else ldp x29, x30, [x0, #JB_X29<<3] #endif @@ -98,7 +98,7 @@ ENTRY (__longjmp) cfi_same_value(d15) #ifdef PTR_DEMANGLE ldr x4, [x0, #JB_SP<<3] - PTR_DEMANGLE (x5, x4, x3, x2) + PTR_DEMANGLE (5, 4, 3, 2) #else ldr x5, [x0, #JB_SP<<3] #endif diff --git a/sysdeps/aarch64/setjmp.S b/sysdeps/aarch64/setjmp.S index d548dd5..41d5321 100644 --- a/sysdeps/aarch64/setjmp.S +++ b/sysdeps/aarch64/setjmp.S @@ -42,7 +42,7 @@ ENTRY (__sigsetjmp) stp x27, x28, [x0, #JB_X27<<3] #ifdef PTR_MANGLE - PTR_MANGLE (x4, x30, x3, x2) + PTR_MANGLE (4, 30, 3, 2) stp x29, x4, [x0, #JB_X29<<3] #else stp x29, x30, [x0, #JB_X29<<3] @@ -57,7 +57,7 @@ ENTRY (__sigsetjmp) stp d14, d15, [x0, #JB_D14<<3] #ifdef PTR_MANGLE mov x4, sp - PTR_MANGLE (x5, x4, x3, x2) + PTR_MANGLE (5, 4, 3, 2) str x5, [x0, #JB_SP<<3] #else mov x2, sp diff --git a/sysdeps/aarch64/sysdep.h b/sysdeps/aarch64/sysdep.h index 55d1759..ab2ee91 100644 --- a/sysdeps/aarch64/sysdep.h +++ b/sysdeps/aarch64/sysdep.h @@ -23,10 +23,16 @@ #ifdef __LP64__ #define AARCH64_R(NAME) R_AARCH64_ ## NAME +#define PTR_REG(n) x##n +#define PTR_LOG_SIZE 3 #else #define AARCH64_R(NAME) R_AARCH64_P32_ ## NAME +#define PTR_REG(n) w##n +#define PTR_LOG_SIZE 2 #endif +#define PTR_SIZE (1<