From patchwork Tue Jun 21 05:06:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 70504 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp1830717qgy; Mon, 20 Jun 2016 22:08:55 -0700 (PDT) X-Received: by 10.66.66.234 with SMTP id i10mr26428859pat.114.1466485735117; Mon, 20 Jun 2016 22:08:55 -0700 (PDT) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id hi6si13809991pac.108.2016.06.20.22.08.54 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Jun 2016 22:08:55 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-70814-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org; spf=pass (google.com: domain of libc-alpha-return-70814-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-70814-patch=linaro.org@sourceware.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-type; q=dns; s=default; b=g6Fk6 oH4d98+arR59BMns2rEsaWl03vQen6l8D9Eh9wwaJWmqvCseGLz5CN+qLEJqS555 59xXbgA+S7bGsdX7Fbj9y2BF6VjvggUFCQ2IvSr+pOkA9Tgcl8VrTT75KRPGoa0F V3zLVTDzXF0p6kw2C+1dTRuMuZg3DtXgMTUUhw= 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:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-type; s=default; bh=0U46kX8G9o6 a0+4V0+yv0DU3JSg=; b=xO0MQbZlWLM+/pShZE4EecNJCiJqba9lAeeoIzAYaFZ 0MKPn236GfqUfwnHMLhziotqtTgGlOi6cQu5x4x11jD8uysbis/MEI1YKaqtMc+i 3cvFzNPg9O2rIj3ut2fn4Jl9YuDcG4fzrDfW4I9sFZlA2OzPgPC6O7khKx/jKzxs = Received: (qmail 106457 invoked by alias); 21 Jun 2016 05:08:46 -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 106448 invoked by uid 89); 21 Jun 2016 05:08:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.3 required=5.0 tests=AWL, BAYES_00, KAM_STOCKGEN, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=no version=3.3.2 spammy=x28, Hx-languages-length:5356, 987, x29 X-HELO: na01-bn1-obe.outbound.protection.outlook.com Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@caviumnetworks.com; From: Yury Norov To: , CC: , , , , , , , , , Andrew Pinski , Yury Norov Subject: [PATCH 04/27] [AARCH64] Add PTR_REG, PTR_LOG_SIZE, and PTR_SIZE. Use it in LDST_PCREL and LDST_GLOBAL. Date: Tue, 21 Jun 2016 08:06:48 +0300 Message-ID: <1466485631-3532-6-git-send-email-ynorov@caviumnetworks.com> In-Reply-To: <1466485631-3532-1-git-send-email-ynorov@caviumnetworks.com> References: <1466485631-3532-1-git-send-email-ynorov@caviumnetworks.com> MIME-Version: 1.0 X-ClientProxiedBy: HE1PR03CA0026.eurprd03.prod.outlook.com (10.163.170.164) To BN4PR07MB2242.namprd07.prod.outlook.com (10.164.63.148) X-MS-Office365-Filtering-Correlation-Id: ce4ea658-f924-43f3-b86d-08d3999215c8 X-Microsoft-Exchange-Diagnostics: 1;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9MxW2KX4V0mwweLcKNweOqKIBDcU4kmocHNHVO1V/bgW1tbKlktqBNZwQroyRNpueZiOt1t5fFPs2g5tKQFcn/pqBP6PQyMwNeJc9nZeFkyc0/8jHp+oW5RkTZhjBbr94gEHOO6NA== X-Microsoft-Exchange-Diagnostics: 1; BN4PR07MB2242; 20:KFCC1YvTKtwtXNX+qDMc4fsKC0l7Kx3Bh48ZU6I8TDKgPhGr7bO5rm3H1muD7uWRU2/Q6Zuj9o9ZulTkvraSpaQxAZ5bBq4Hp01n2b/dssBuzwVZvFhupV4m4MbBkHE74npPUqKcFcKWjAmbYCQ8MS9WPWKDsOCaCmz2cnZR+vhF2rOXHboEHTFL7r4f7KdNTxgVeP0wqvrzLOKBE1D9gREgOTBYDKmXeJ+l0I8M7P8mc75OclcvOzDfz4aiYJFR0C23KCfzCeVYHY3MiAjpxhyMSzhBdjcm2NQwrTdJf/jveA9pKMZRpYclByHTL1WjlLtWXBkhNaJX1Std3tBKLHRD7FZzaiBm607dJpcEdWFjnStpwJNuvj6MLt0DfueNyvBqCczaZe/F3jMENAlKvW8xOl7VOJK3hKCQM0FEXZTtaWwlHHeNJ4GU/cwIsEEIMSmYKXrDHw82H/Eo+DpVHwPrkyach9OvGt3rB7Rh8n3/lzmBx1zrtU3DXpq76+vlLjN3Jpc9cHWFcw9g9eoIJXgLylqgpBm9ChUZSe34LhJFv7gIsrvM9jiTkoYLom3PToKbfvFsrjlciORNUcrcYCQRJxl2oOqJXRLOtkS3iN0= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001); SRVR:BN4PR07MB2242; BCL:0; PCL:0; RULEID:; SRVR:BN4PR07MB2242; X-Microsoft-Exchange-Diagnostics: 1; BN4PR07MB2242; 4:4hRsdMvmeyeLuf5/hQOnVuNNnGUbKXQuPR//Iv7uX5z5uP2HZ0VTT2lUxuABImGPCtUa9zBH7tvSYh3Ze5xuFewMFA4Ibla7bXKXB7x04iLwaoLbKbe506T5a3xnUxa9Hzi6i5AA3jDwhfwme9h8yckdF1sk5APngVJ7igUQF3BOhKBulGs8+4Wq7Es+0PaISzKtPQ0HFkgFDFWKHF9B8GCBL9XZfOFvQHbHN7NicJdO9kwcw8DHTjVZlzrECEKah7OqmgWIoCvOeGSdHsmLUv70Swj9fFsRBi42y1xnriRKCR7xcFeXOWaND7VbS4DpwZX5ec4NellTYt6TrF84vYKzfjv5E3NUs14fHpALwK7mY5GIstLDo9B+rQUVrpiD X-Forefront-PRVS: 098076C36C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(7916002)(199003)(189002)(19580395003)(42186005)(19580405001)(77096005)(76506005)(229853001)(5003940100001)(7736002)(586003)(3846002)(6116002)(4001430100002)(105586002)(92566002)(81156014)(107886002)(2906002)(48376002)(5001770100001)(4326007)(2950100001)(76176999)(7846002)(50986999)(66066001)(50466002)(33646002)(50226002)(47776003)(8676002)(101416001)(106356001)(36756003)(189998001)(97736004)(68736007)(81166006)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN4PR07MB2242; H:localhost; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: caviumnetworks.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN4PR07MB2242; 23:yhydlvsXHYp/GprR4hBcJe0HUs3De08lIRakI/xUD?= =?us-ascii?Q?5VBjZjLK+X3YWti1WvZtb8a1mwV0BulFTcymNnZZUhHvBxFOeQ2sOTsGJqWn?= =?us-ascii?Q?++F+PuB1ZNAVzFDAS6LsecONzwQMOH5ujcgXHUJi1rniVdfZl73voNHtgQk+?= =?us-ascii?Q?OpMpOQVVQhvhxjo9kqqmqg5zmd6FVyqqB5+dBt8G6t4mSjSnUVUx4MuctTw7?= =?us-ascii?Q?fxAIpWoMV2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RM4wQWv?= =?us-ascii?Q?H5xuJJQ0Fw=3D?= X-Microsoft-Exchange-Diagnostics: 1; BN4PR07MB2242; 6:NVG0WJNfA0F6cayH/yTkdZDNc0MCRX89rX30YzkwZGK/Oik5H77qeRJ3rxhpA9g3H6B+JGfIRbYhJbd4MtitanJBZs9F20t6WVzR9FRUJjV8qpt2dKPIDvgp2sJaIv6BhA2CMnjWWdyboHULUoGX6b4JvpTlGe1RSbp5pxRFNzyEvwO3KXlylyb4wswRh1lWf2v6gwNnK9C5DhYP2Cs96Kdhsde1Mz0EkI/I+L31FmZNszsfjwSK0gDrPKz2WnAcogq3U8SKfzbB/YMIz5+FrhohUVjvKWtDWrVr5xjyQ5I=; 5:pb6pO2qYS4flv4w3YLxNZpk+gc1rhUcINl7RRMZHL0nSkiW920qiBofipi2XSJJ00PqW5KTkniVofZR3sHctLKVNRrDN/v1fOvf7+Hx1/RLcNCSWOzgiGYPBdz5nofFrEm0L7oPaheEbGyCriUhcaA==; 24:zcKQoCVcymTzdxZo9uzrTn2zwhgGXPRGmCOew16Zxi589jdAxOktn7DfBmyH0U5+F4VLJ9FZCqOQQ2NXwGsZu7j+VZhy0cUbs1KskWFH6OU=; 7:1H9pC9gc1N0g5Ej0U5NNzqHBtZjdXiHUjiUWPJ6GjuANQ+5X32DuN9Y2qwJu8V5ZOF6W7wb03yzGCC9MldaoMFb8skcFc4UMWX+BE0ifjOhUB8liTVSRZjBVxBkOlMIv358N7jHxG/Kz1eVaLLTpx46EmjMBC/yKlvRd7YloC9XDdDgpjDw7hMcZOEZD9h7XUFHDhGzff1ZTP7/Odgkl8BzMG2gWOhBRO9a+W17u7ijeo5qDH21LgpWZurDKt135 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2016 05:08:29.4869 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN4PR07MB2242 From: Andrew Pinski 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. Signed-off-by: Yury Norov --- 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(-) -- 2.7.4 diff --git a/sysdeps/aarch64/__longjmp.S b/sysdeps/aarch64/__longjmp.S index 65116be..58332be 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 22f4368..da83f19 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 4cb028f..f2ea821 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<