Message ID | 20240202212400.2522387-1-quic_apinski@quicinc.com |
---|---|
State | Accepted |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:9bc1:b0:106:209c:c626 with SMTP id op1csp706944dyc; Fri, 2 Feb 2024 13:24:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IGpJdgtUIqWXyji7ZrIgM67I9ll/JWy3U4aCyH5HntWvs0ZXTppkjHiM6BFRZbqk4hliHDd X-Received: by 2002:a05:6214:ca8:b0:68c:8793:35bc with SMTP id s8-20020a0562140ca800b0068c879335bcmr3526348qvs.28.1706909099133; Fri, 02 Feb 2024 13:24:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706909099; cv=pass; d=google.com; s=arc-20160816; b=NwrxX/e5UD0+tgoqQ4feXrlAx/8OcDfOx1XlSJXJWbCGLx9JSzg4IZ6fWuzZDfSMrD 3zzX15LBjN3qGMRztg9EaJlmnxhhhTS7wM3noxelZtfUdA5tOtU3ecwoV0NdRpyluWmK 6ToV825GClGbGK+RUFCNbpVmLJiH5Xqr7y3nLN6kNLe06y4IUITmtOQLOIutgbXZgDby KJ+xwKIpZ9z1wLH5geE5bvskDb/uzIvJ7vGiWDDs+lRFheh8PvTTyu5eL5EWMEM977OT BlWCdYbi7wO2n5NCmflc5rJQ/B9zKeJRzY9cexYQBk2ADnTykNSk10DQpdPi1TyDHyLx MsKw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=bKt2A2fun9F4diLrODG2LCnNXzgdI8Z/AJr/6Ce/GYc=; fh=7M3kHPVZQ2KjA3K73s6mvHtui60nLB+mwZFO5SyzPLI=; b=GiVbLOEVpvq0Fn9Zb2qazpoJV/h3IGSKMScKc+0WN2BuSyDbnuAL2CFEj8tZg0TKZM RselKeMoobwXe8RpeDXpzkKaGXmLjx8hstBFxpzWhRr0Iy9a6AvxUVaBRdFKSXUIZI0n 9C8IOwfGbOmeng1hEEZu3LzozzI/IWaZNujSiosiGXKkvi4ORFKVaWEXc1Rdbuvc+XHD s2FpvE0RhQPn9V7M+CJLhBYYBcft5S4hxUbjY//H3NMzpNLNyENYAjPXFnQRPxyPsfjn KAcBzYiF3b0rjjqlwZBrenk1/p01Zw8qogmTUPfw+0uPPNFrlBiTd4RV4Ry/xHzVtkQe wxtA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=BI3sogxX; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com X-Forwarded-Encrypted: i=1; AJvYcCXM10xo6++JZJIYY635BHPEX5QTzv6vEoe/A3J15w1J1vxpUFepEIyVIvrsj9HbE1QiiinzTlKxDC5yawrOWNadLE2kPQ== Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id o9-20020a0ccb09000000b006889961da29si2997926qvk.491.2024.02.02.13.24.59 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 13:24:59 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=BI3sogxX; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BFBF6385842F for <ouuuleilei@gmail.com>; Fri, 2 Feb 2024 21:24:58 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by sourceware.org (Postfix) with ESMTPS id 09769385802D for <gcc-patches@gcc.gnu.org>; Fri, 2 Feb 2024 21:24:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 09769385802D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=quicinc.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 09769385802D Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706909057; cv=none; b=Lws0+zuws4qGnoAec6KfcbAHyfNZuclkHiF3FGFgeLWBpD3mtDDPpCVJOOE0Plrq/1utA5j+4vwPueu1JpYZ7an4jdv+1eMZ2NY8TA1M8wwX65+d6oNBDQglQJtLXNkSs2d9EyxpOsIAyuwKj2OOVBEKf6xxHu2cEWCZODOFqVY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706909057; c=relaxed/simple; bh=uATTRUYb2KLYLUKFlyhPRElMTlRnTcfkT6k/bt+j8MI=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=ouO0qVjvFS5+kIi9nMwqEDjBvPQVi33C/kI+AJACEkRZUowdQSIbeVznYNioroCGExoIL7lmPtmdUE1bRi4Qa33xhm4TAu/1pb2LYrMzzsYcqqx808lDujEYvqPkwjCuRDbbjj7eNTDl18L493LbKCCH0+7b/i42ZYYvU9rbPhs= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 412Js6Q6015119 for <gcc-patches@gcc.gnu.org>; Fri, 2 Feb 2024 21:24:14 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding:content-type; s=qcppdkim1; bh=bKt2A2f un9F4diLrODG2LCnNXzgdI8Z/AJr/6Ce/GYc=; b=BI3sogxX17TDZu1gjRQunjc nOC85jpjyUKBz5ASgpe082fNxNW0/k+CkXKV+yqcM7q+N66/JGZ+5IiM6HJkgT6s LTM6Nhpzbv6I9LKLAoVrzohGWKXE0SVtVjaNJZMsdVoG9wCSMVhnUOAI3LQQn4Uz TlIF3UhJQ6x+eRbpjKabgJQjOi5O9EjR1T0DLRhpfBQQIvau1g9jwZFgO0IDjmdJ EgmSs9s7fqdvZZtqqUSkaue5SD48wZuHMdMYCqAL4jerXP8sO0tCuIKrx8aZIRUW ftot6HUtO25m6O2UoAf33vElnr2P0aPXna/+9l5Mkrjhd/TNmJeqBMNIfCTFTXw= = Received: from nasanppmta04.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3w0pu1tf4e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for <gcc-patches@gcc.gnu.org>; Fri, 02 Feb 2024 21:24:13 +0000 (GMT) Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 412LOC3a011451 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for <gcc-patches@gcc.gnu.org>; Fri, 2 Feb 2024 21:24:13 GMT Received: from hu-apinski-lv.qualcomm.com (10.49.16.6) by nasanex01c.na.qualcomm.com (10.45.79.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Fri, 2 Feb 2024 13:24:12 -0800 From: Andrew Pinski <quic_apinski@quicinc.com> To: <gcc-patches@gcc.gnu.org> CC: Andrew Pinski <quic_apinski@quicinc.com> Subject: [PATCH] aarch64: Fix undefined code in vect_ctz_1.c Date: Fri, 2 Feb 2024 13:24:00 -0800 Message-ID: <20240202212400.2522387-1-quic_apinski@quicinc.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.49.16.6] X-ClientProxiedBy: nalasex01a.na.qualcomm.com (10.47.209.196) To nasanex01c.na.qualcomm.com (10.45.79.139) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: 7Jpcnqmv7LVMf-TUyiLR-oDSLrkJoxcI X-Proofpoint-ORIG-GUID: 7Jpcnqmv7LVMf-TUyiLR-oDSLrkJoxcI X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-02_14,2024-01-31_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 mlxscore=0 impostorscore=0 clxscore=1015 mlxlogscore=869 malwarescore=0 lowpriorityscore=0 phishscore=0 priorityscore=1501 adultscore=0 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2401310000 definitions=main-2402020157 X-Spam-Status: No, score=-13.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789823915909752266 X-GMAIL-MSGID: 1789823915909752266 |
Series |
aarch64: Fix undefined code in vect_ctz_1.c
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
Commit Message
Andrew Pinski (QUIC)
Feb. 2, 2024, 9:24 p.m. UTC
The testcase gcc.target/aarch64/vect_ctz_1.c fails execution when running
with -march=armv9-a due to the testcase calls __builtin_ctz with a value of 0.
The testcase should not depend on undefined behavior of __builtin_ctz. So this
changes it to use the g form with the 2nd argument of 32. Now the execution part
of the testcase work. It still has a scan-assembler failure which should be fixed
seperately.
OK? Tested on aarch64-linux-gnu.
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/vect_ctz_1.c (TEST): Use g form of the builtin and pass 32
as the value expected at 0.
Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
---
gcc/testsuite/gcc.target/aarch64/vect_ctz_1.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
Andrew Pinski <quic_apinski@quicinc.com> writes: > The testcase gcc.target/aarch64/vect_ctz_1.c fails execution when running > with -march=armv9-a due to the testcase calls __builtin_ctz with a value of 0. > The testcase should not depend on undefined behavior of __builtin_ctz. So this > changes it to use the g form with the 2nd argument of 32. Now the execution part > of the testcase work. It still has a scan-assembler failure which should be fixed > seperately. > > OK? Tested on aarch64-linux-gnu. > > gcc/testsuite/ChangeLog: > > * gcc.target/aarch64/vect_ctz_1.c (TEST): Use g form of the builtin and pass 32 > as the value expected at 0. OK, but it looks like vect-clz.c could use the same fix. I think we have enough coverage elsewhere that we still use CLZ for the "normal" builtins (e.g. sve/clz_1.c). Richard > Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com> > --- > gcc/testsuite/gcc.target/aarch64/vect_ctz_1.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/gcc/testsuite/gcc.target/aarch64/vect_ctz_1.c b/gcc/testsuite/gcc.target/aarch64/vect_ctz_1.c > index c4eaf5b3a91..5fcf1e31ab2 100644 > --- a/gcc/testsuite/gcc.target/aarch64/vect_ctz_1.c > +++ b/gcc/testsuite/gcc.target/aarch64/vect_ctz_1.c > @@ -9,7 +9,7 @@ count_tz_##name (unsigned *__restrict a, int *__restrict b) \ > { \ > int i; \ > for (i = 0; i < count; i++) \ > - b[i] = __builtin_##subname (a[i]); \ > + b[i] = __builtin_##subname##g (a[i], 32); \ > } > > #define CHECK(name, count, input, output) \
diff --git a/gcc/testsuite/gcc.target/aarch64/vect_ctz_1.c b/gcc/testsuite/gcc.target/aarch64/vect_ctz_1.c index c4eaf5b3a91..5fcf1e31ab2 100644 --- a/gcc/testsuite/gcc.target/aarch64/vect_ctz_1.c +++ b/gcc/testsuite/gcc.target/aarch64/vect_ctz_1.c @@ -9,7 +9,7 @@ count_tz_##name (unsigned *__restrict a, int *__restrict b) \ { \ int i; \ for (i = 0; i < count; i++) \ - b[i] = __builtin_##subname (a[i]); \ + b[i] = __builtin_##subname##g (a[i], 32); \ } #define CHECK(name, count, input, output) \