From patchwork Mon Apr 27 11:16:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wilco X-Patchwork-Id: 464954 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 EFEA8140082 for ; Mon, 27 Apr 2015 21:16:27 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass reason="1024-bit key; unprotected key" header.d=sourceware.org header.i=@sourceware.org header.b=OpUvKEaN; dkim-adsp=none (unprotected policy); 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:from:to:subject:date:message-id:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=raH YwTA7FmjgYs2rwssh9p7KzE+PR8n+aINh7KQABNWdlOCEGAaA+vYJLEqchBuW45d 2gWP/IZFmGBkKbWcV878kgXNg1131rIlzXDOmapZ5kUXxiR+Jr0WR0opgwFzPOTO n/e75vagg9vfgXNUwbdF5sE6rd6bB4EdtJ7dWc1c= 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:subject:date:message-id:mime-version :content-type:content-transfer-encoding; s=default; bh=474s9kq7C +xoCliomtAPaioTv0U=; b=OpUvKEaNaR6zMRjHgkcMXyhnadgCOiFv6+fWgv3Mn XGGxKideaeuIbKSuVdwspoTM3gNtCaSNRMYH6SeVysE2q3dMWRz9SbuizvE7VGsM lyjpgFOKcHQtiIRveaLATddQ8R4eb8iuoS+1xVsvlidB9FFoK+xH7YpLVQ59ghb3 q0= Received: (qmail 83313 invoked by alias); 27 Apr 2015 11:16:22 -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 83302 invoked by uid 89); 27 Apr 2015 11:16:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, SPF_PASS autolearn=ham version=3.3.2 X-HELO: eu-smtp-delivery-143.mimecast.com From: "Wilco Dijkstra" To: Subject: [PATCH][AArch64] Inline mempcpy Date: Mon, 27 Apr 2015 12:16:09 +0100 Message-ID: <000101d080db$904af8d0$b0e0ea70$@com> MIME-Version: 1.0 X-MC-Unique: CI9s61_vQeevS4U1_cQCzQ-1 Add inlining of mempcpy on AArch64 to expand into memcpy. OK for commit? 2015-04-27 Wilco Dijkstra * sysdeps/aarch64/bits/string.h: New file. (_STRING_ARCH_unaligned): Define. (mempcpy): Redirect to __mempcpy_inline. (__mempcpy): Likewise. (__mempcpy_inline): New function. --- sysdeps/aarch64/bits/string.h | 50 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 sysdeps/aarch64/bits/string.h diff --git a/sysdeps/aarch64/bits/string.h b/sysdeps/aarch64/bits/string.h new file mode 100644 index 0000000..b0dacd6 --- /dev/null +++ b/sysdeps/aarch64/bits/string.h @@ -0,0 +1,50 @@ +/* Optimized, inlined string functions. AArch64 version. + Copyright (C) 2015 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _STRING_H +# error "Never use directly; include instead." +#endif + +/* AArch64 implementations support efficient unaligned access. */ +#define _STRING_ARCH_unaligned 1 + +#if !defined __NO_STRING_INLINES + +# ifndef __STRING_INLINE +# ifndef __extern_inline +# define __STRING_INLINE inline +# else +# define __STRING_INLINE __extern_inline +# endif +# endif + +# ifdef __USE_GNU +# define _HAVE_STRING_ARCH_mempcpy 1 +# define mempcpy(dest, src, n) __mempcpy_inline (dest, src, n) +# define __mempcpy(dest, src, n) __mempcpy_inline (dest, src, n) + +__STRING_INLINE void * +__mempcpy_inline (void *__restrict __dest, + const void *__restrict __src, size_t __n) +{ + return memcpy (__dest, __src, __n) + __n; +} + +# endif + +#endif