From patchwork Wed Apr 11 21:16:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 133173 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp1037419ljb; Wed, 11 Apr 2018 14:16:49 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+MyBX/OWHJ0YllN/pG+tP7x8DV6mmSVn/KDrT/LscykOzQltlnv6S+1uIN2ViQ1GHSgo/N X-Received: by 10.99.95.142 with SMTP id t136mr4494142pgb.302.1523481409326; Wed, 11 Apr 2018 14:16:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523481409; cv=none; d=google.com; s=arc-20160816; b=Kxk02zhCqb4BPj5kV96bkH70Dt8VhgYgSbXLiaETF7UyVr1amSxIyfHg0kFbust6BK KIvwu9UgoWZrPZogdoPQF72bsH8TrHwWMvswn8xvCdsjfQrqnV7j9+t985WKWJe1+03Z qJjF/ZXr0lXfI+gE51cDRTl9YCgysbVqwK7ASDJNyHmV46NHR1qpE2UaTd9hKCY01LW2 fYpwmtyBgJW+luLSxGKfL9bWJRLamvg6SLQAAl4Tg7/3Y4d8CmhOBCwk9Vxw7W6dJFnh Y/AUyiJCzFnC0KYqL50/sbYZ+zBOTL1xyi1sdAyJhFdY4suwGkQ6W3bn6SpXRMIJ7szv eOhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject: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=k2PURCzAKrYq84Ui92ryKubW2SLZnlspVYb5f72V3gg=; b=rTe+w1EKBE4XS3YLKXhaKLpK8jGCo5bECLBv6JrQ8ngZrju2SiikGOlk/T0tbbUDOP B60cxQ5fTht9Y4O04ZeEzXupj1Jyaj0hcHHYzgvCh3ik9mErMPBnK1TrVC5kLn9MWrre pCeHpAMu6n3rV55Jhi8H1He3S1niMIyW27W8pLhc4yJsFoV+7g3U76OuitW4qZbZFt3u HkXDtIFm9h84BN8z4rblmGNpqzBCUpaUrqmv0L5NFW5UXp2C5nLj6vB/RWYb8cI89y1d TKTgOZaAsdV5dejlvNSCox53aU3ZK3Z6+N0U59rwtEAUzty41M/a4CJf1RN6fgu7o5WN t1sA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=mz0NwISE; spf=pass (google.com: domain of libc-alpha-return-91504-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-91504-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 q64si1456741pfq.385.2018.04.11.14.16.48 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Apr 2018 14:16:49 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-91504-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=mz0NwISE; spf=pass (google.com: domain of libc-alpha-return-91504-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-91504-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:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=as9RRMaNsbMel3SkZVRjIOVtOCAzK4W iWusklXjSQ3gNyqoMCjsAutDo9Zpv6pSkJEgbtdrpn+5AA9hDe3isWjp1s/5XGM7 m8H4PbAyuh4nehTeTsaD/bZdxirGY9p/k/1zlR/sDIOqojUQT3FRZLcAxGdqdGS4 dfzXjitVmUo8= 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:in-reply-to :references; s=default; bh=DXC/Y+GyHERX9sKWUbQ4fiQaj+A=; b=mz0Nw ISE667I9rxWSx6zr8txKI/eu4iI9P6Tm5dEtpnmsjfgPlqsw+StYbcoYmxlVMlG0 u6tCyxTNUxGgqenT2GB0pbASLWR7VnMLtFdGj1jx6qAMmliMdbu48CWbauL8198W kli26/Ry4tDI4OOOiueITHnbZzev5xUXXRnp/M= Received: (qmail 117673 invoked by alias); 11 Apr 2018 21:16:31 -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 117583 invoked by uid 89); 11 Apr 2018 21:16:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.8 required=5.0 tests=AWL, 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=mvn X-HELO: mail-qt0-f179.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:subject:date:message-id:in-reply-to :references; bh=k2PURCzAKrYq84Ui92ryKubW2SLZnlspVYb5f72V3gg=; b=aToadpgHGBBaz4MgqVDGzLHJxibqFjprq1bhooDs0gIyHNSE1h348rZUizeYfQhXDf mbh7DBv/Gagx1bc57uvyjzlRrujbZFn+cqO6YmsTYQYnUfW4NMXzrniSU++NI+sGP/RG SuePiccFNIGUnbyjTVy9z0D237x6cM9v9OoCP1JQ7vtu4hJX0DLdTfWrXkKjgtnm5AmU kj9zdtflms95eYkwD9mHiDrBvFk8gKs/R2VPR9OOAm7Dcnlo2zqXg0ZbyOjSOpnBxvN8 ZdlPRH7oqFyuohEKt2wja01iZ1D3hHIHaHVpWsnZfJpqE6EdL9Soh/kxe2YCfDBDCQHw h//w== X-Gm-Message-State: ALQs6tBy9oM2oDcQVXEf8aa1EZsDZhbMWiFl2S20EMfBxBIzGztPqs+b cPxMZAI00WY/vz/mXlXLw1jH1pPibAA= X-Received: by 10.200.81.200 with SMTP id d8mr9608352qtn.1.1523481387207; Wed, 11 Apr 2018 14:16:27 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 2/4] arm: Fix armv7 neon strcmp on ARM mode Date: Wed, 11 Apr 2018 18:16:16 -0300 Message-Id: <1523481378-16290-2-git-send-email-adhemerval.zanella@linaro.org> In-Reply-To: <1523481378-16290-1-git-send-email-adhemerval.zanella@linaro.org> References: <1523481378-16290-1-git-send-email-adhemerval.zanella@linaro.org> Current optimized armv7 neon strcmp uses the NO_THUMB wrongly to conditionalize thumb instruction usage. The flags is meant to be defined before sysdep.h inclusion and to indicate the assembly requires to build in ARM mode, not to check whether thumb is enable or not. This patch fixes it by using the GCC provided '__thumb__' instead. Also, even if the implementation is fixed to not use thumb instructions it was clearly not proper checked in ARM mode: the 'prepare_mask' does not build (it sets the 'mvn' instruction to use register predicate in shift amount). This patch fixes it by using a S2HI plus mvn to mimic the expected nor operation. Checked on arm-linux-gnueabihf (with -marm and -mthumb mode). [BZ #23031] * sysdeps/arm/armv7/strcmp.S [!__thumb__] (prepare_mask): Fix build and logic. --- ChangeLog | 4 ++++ sysdeps/arm/armv7/strcmp.S | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) -- 2.7.4 diff --git a/sysdeps/arm/armv7/strcmp.S b/sysdeps/arm/armv7/strcmp.S index 060b865..a20b3e5 100644 --- a/sysdeps/arm/armv7/strcmp.S +++ b/sysdeps/arm/armv7/strcmp.S @@ -82,8 +82,7 @@ #define data2 r3 #define syndrome tmp2 - -#ifndef NO_THUMB +#ifdef __thumb__ /* This code is best on Thumb. */ .thumb @@ -97,7 +96,8 @@ #else /* In ARM code we don't have ORN, but we can use MVN with a register shift. */ .macro prepare_mask mask_reg, nbits_reg - mvn \mask_reg, const_m1, S2HI \nbits_reg + S2HI \mask_reg, const_m1, \nbits_reg + mvn \mask_reg, \mask_reg .endm .macro apply_mask data_reg, mask_reg orr \data_reg, \data_reg, \mask_reg