From patchwork Mon Jun 11 09:46:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hongbo Zhang X-Patchwork-Id: 138208 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp3838941lji; Mon, 11 Jun 2018 02:46:46 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIAjezvK07M6im13X7ophzTBzS4ngdkMzzXuTsAbqQW5bky4l+EObSRLbwLTTfBzBzp21Ri X-Received: by 2002:a17:902:758e:: with SMTP id j14-v6mr17488146pll.160.1528710404419; Mon, 11 Jun 2018 02:46:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528710404; cv=none; d=google.com; s=arc-20160816; b=UIDffkX755RG2ZOWiD1EWePqLOhr/OaSsprdug9pIqXZsCa+Fq9kMB5dvXP4LU1kSV lb5sBhTZ1zIeI4iB0rGCyBaGP7ezTF3JDazanWwEi7EsYDSF25whusnBlugJEROSzKob oqMSmXcC8y5lOPIv+MWrCtV1CzLtAaSQdzX27ceJpJR0JbW8YF0To88D6pgyLc2XtNlJ RmM/euNIU76WI2GtFS/UTJtiwinIjHAQYPthOfBs+0lbXV43sJul0BzEUCBp0ZGTEI/W Z7vpshrTJkIfQgj265kEocZ7OPkuLHGyvHZw+DguXS4u/zD5PlDOxZt7Gk1qIEES8/Zf G/1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:delivered-to:sender:list-help :list-post:list-archive:list-subscribe:list-unsubscribe:list-id :precedence:mailing-list:dkim-signature:domainkey-signature :arc-authentication-results; bh=I32UdlykoOv0uOJQhstV1G9pXN181PjmFAOYHdGPfw8=; b=jylsKD6rxEibSBFDVpaHIMMA5m51+CXTCH2YR2BFPrr9/GFc+ExMaYLYA3+790nZeE 9n1g2uaZ79G7xHuERgJwId1kOeBd5pn8Mgo3ipjPI53PZXiUq9xZ90SvHKBzChFSITSe 7QmaAR0SUHncK+BzArnC+wjvwhaXFyR5APhiHiQwl5KInuiS1ywO+RgIUT2GXWalBjA5 hsktO4329nDDAqACjs1eevYR3jVDQtj4VambLXXNctiLMsVFMhUjhgkh3Io1EYSBVjSj flkxwmiIo+oTQPDTzBJrWE+jfrNelpzzldunIro685fqHZqOr7IEqOvQkeQjrivGvYBJ FcIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=TzJuLYF/; spf=pass (google.com: domain of libc-alpha-return-93023-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-93023-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id i3-v6si61389625pld.189.2018.06.11.02.46.40 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Jun 2018 02:46:44 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-93023-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 header.s=default header.b=TzJuLYF/; spf=pass (google.com: domain of libc-alpha-return-93023-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-93023-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.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; q=dns; s= default; b=rF9fhqzY6m/xt9GeWwqltgt+O+IsrXLSlHhtJR/BG+ZL/dhPRu8iS +gvA3a1Pxnd75ka2A7zsBstZzZ2/nPmBxTqzlS4aancMG0fTEmb8sa1j7xzex+FE /qhXJF0mWcXKNsSjI7G0FCelQZqIk0VZvsq7TalataounlG4jDBnBA= 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; s=default; bh=YUCrGW3rFGJJ0t2FlNCV3CrAZpg=; b=TzJuLYF/TPYRalnQneMvHEDFF2qd SVuNAefvnHEaDEQ9dVtlXmHUqlvERGSVHyIhJiOQdYFUuHREFoJx4i2jxw2kpAo3 N9Db65dAw3sR3Ynt4e+5WA6NIc7JzF32UPJx0LO8xoZTdRRitRzJRshnoVybm1Cq mGnAhKRgKhEsmLY= Received: (qmail 123861 invoked by alias); 11 Jun 2018 09:46:32 -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 123428 invoked by uid 89); 11 Jun 2018 09:46:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=H*p:D*org, H*r:sk:v131-v6, HX-Received:sk:x21-v6m X-HELO: mail-yw0-f195.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=I32UdlykoOv0uOJQhstV1G9pXN181PjmFAOYHdGPfw8=; b=uJNZ6zooLlrgobWc96hr9lr1tepEMOZHj6QKweOeLRVPeabOagp6VQG3djpc2bcdae ZN3eobgEqkB4eRarkotvDw8HsW/fod/tew06ulrQmY70Vl4zYQWL9ym7spS1vxG8Ywlw 87rK/j+xLVLelmou+jb1fSuzqbdzBRfioqz2efLFhx/W+jMwcjePmdMmvuEBnKGbRd2B yQXUH97XsHFpVJNVtMVq1Eaqt0HcWMIeopdbGiB0Kt53mhawhMnZy249EJRjaAQgDQCo uvYa+FCjl5atBgDPXuk8UQUnsHazAA583N4dn63j5W6vd6uHdh/ILn2Il4YBmHRyXBeF afaA== X-Gm-Message-State: APt69E1eFMJzieEJ51OdRB8+9XYa4AoXrWSUB+deMvyhC/6X74RcbKKb 3QIKulmAFMP2bvnAeJa35a7q6w== X-Received: by 2002:a0d:d515:: with SMTP id x21-v6mr9465718ywd.3.1528710388788; Mon, 11 Jun 2018 02:46:28 -0700 (PDT) From: Hongbo Zhang To: marcus.shawcroft@arm.com, szabolcs.nagy@arm.com, libc-alpha@sourceware.org Cc: Hongbo Zhang Subject: [PATCH] aarch64: add HXT Phecda core memory operation ifuncs Date: Mon, 11 Jun 2018 17:46:03 +0800 Message-Id: <1528710363-25909-1-git-send-email-hongbo.zhang@linaro.org> Phecda is HXT semiconductor's CPU core, this patch adds memory operation ifuncs for it: sharing the same optimized implementation with Qualcomm's Falkor core. 2018-06-07 Minfeng Kang Hongbo Zhang * sysdeps/aarch64/multiarch/memcpy.c (libc_ifunc): reuse __memcpy_falkor for phecda core. * sysdeps/aarch64/multiarch/memmove.c (libc_ifunc): reuse __memmove_falkor for phecda core. * sysdeps/aarch64/multiarch/memset.c (libc_ifunc): reuse __memset_falkor for phecda core. * sysdeps/unix/sysv/linux/aarch64/cpu-features.c: add MIDR entry for phecda core. * sysdeps/unix/sysv/linux/aarch64/cpu-features.h (IS_PHECDA): add macro to identify phecda core. --- sysdeps/aarch64/multiarch/memcpy.c | 2 +- sysdeps/aarch64/multiarch/memmove.c | 2 +- sysdeps/aarch64/multiarch/memset.c | 7 ++++--- sysdeps/unix/sysv/linux/aarch64/cpu-features.c | 1 + sysdeps/unix/sysv/linux/aarch64/cpu-features.h | 3 +++ 5 files changed, 10 insertions(+), 5 deletions(-) -- 2.7.4 diff --git a/sysdeps/aarch64/multiarch/memcpy.c b/sysdeps/aarch64/multiarch/memcpy.c index b94c655..4a04a63 100644 --- a/sysdeps/aarch64/multiarch/memcpy.c +++ b/sysdeps/aarch64/multiarch/memcpy.c @@ -36,7 +36,7 @@ extern __typeof (__redirect_memcpy) __memcpy_falkor attribute_hidden; libc_ifunc (__libc_memcpy, (IS_THUNDERX (midr) ? __memcpy_thunderx - : (IS_FALKOR (midr) + : (IS_FALKOR (midr) || IS_PHECDA (midr) ? __memcpy_falkor : (IS_THUNDERX2 (midr) || IS_THUNDERX2PA (midr) ? __memcpy_thunderx2 diff --git a/sysdeps/aarch64/multiarch/memmove.c b/sysdeps/aarch64/multiarch/memmove.c index afd8dd2..e69d816 100644 --- a/sysdeps/aarch64/multiarch/memmove.c +++ b/sysdeps/aarch64/multiarch/memmove.c @@ -35,7 +35,7 @@ extern __typeof (__redirect_memmove) __memmove_falkor attribute_hidden; libc_ifunc (__libc_memmove, (IS_THUNDERX (midr) ? __memmove_thunderx - : (IS_FALKOR (midr) + : (IS_FALKOR (midr) || IS_PHECDA (midr) ? __memmove_falkor : __memmove_generic))); diff --git a/sysdeps/aarch64/multiarch/memset.c b/sysdeps/aarch64/multiarch/memset.c index 6df93d5..d74ed3a 100644 --- a/sysdeps/aarch64/multiarch/memset.c +++ b/sysdeps/aarch64/multiarch/memset.c @@ -31,9 +31,10 @@ extern __typeof (__redirect_memset) __libc_memset; extern __typeof (__redirect_memset) __memset_falkor attribute_hidden; extern __typeof (__redirect_memset) __memset_generic attribute_hidden; -libc_ifunc (__libc_memset, (IS_FALKOR (midr) && zva_size == 64 - ? __memset_falkor - : __memset_generic)); +libc_ifunc (__libc_memset, + ((IS_FALKOR (midr) || IS_PHECDA (midr)) && zva_size == 64 + ? __memset_falkor + : __memset_generic)); # undef memset strong_alias (__libc_memset, memset); diff --git a/sysdeps/unix/sysv/linux/aarch64/cpu-features.c b/sysdeps/unix/sysv/linux/aarch64/cpu-features.c index 33b87a8..203f839 100644 --- a/sysdeps/unix/sysv/linux/aarch64/cpu-features.c +++ b/sysdeps/unix/sysv/linux/aarch64/cpu-features.c @@ -35,6 +35,7 @@ static struct cpu_list cpu_list[] = { {"thunderxt88", 0x430F0A10}, {"thunderx2t99", 0x431F0AF0}, {"thunderx2t99p1", 0x420F5160}, + {"phecda", 0x680F0000}, {"generic", 0x0} }; diff --git a/sysdeps/unix/sysv/linux/aarch64/cpu-features.h b/sysdeps/unix/sysv/linux/aarch64/cpu-features.h index cde655b..eb35adf 100644 --- a/sysdeps/unix/sysv/linux/aarch64/cpu-features.h +++ b/sysdeps/unix/sysv/linux/aarch64/cpu-features.h @@ -49,6 +49,9 @@ #define IS_FALKOR(midr) (MIDR_IMPLEMENTOR(midr) == 'Q' \ && MIDR_PARTNUM(midr) == 0xc00) +#define IS_PHECDA(midr) (MIDR_IMPLEMENTOR(midr) == 'h' \ + && MIDR_PARTNUM(midr) == 0x000) + struct cpu_features { uint64_t midr_el1;