From patchwork Sun Jan 21 07:29:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Pinski X-Patchwork-Id: 1888865 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=quicinc.com header.i=@quicinc.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=Ya+dpr6G; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4THlPc3fH9z1yPJ for ; Sun, 21 Jan 2024 18:30:27 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 878C13858C5F for ; Sun, 21 Jan 2024 07:30:24 +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 325853858D33 for ; Sun, 21 Jan 2024 07:30:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 325853858D33 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 325853858D33 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=1705822209; cv=none; b=wo0x/Is1rc9mqv6PVavdw2i/dF54BdAakAzuoJUk/lbtaWuktNAQxmZTCSNu7KHQg0r5qWcjxZW28P3E4sVi3N8TQ45O8B/nuMq9u9TKmZi91awL7wMpodDbRwB2OD0jnG17oJflTOQXw9V4AxC8oRUCZ7935CC3lYoeu2/5cwU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705822209; c=relaxed/simple; bh=pSkAz3f2lDb2HDkjWoMfuXcsIE7E3dPHauTLC/5xQQ8=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=q6dIUKqneFMI4IAxUqW1A/jKo1TNGo5pcluW9VmKeykpblc1wcZL/kCLGGv+UWow7NkZCGOQWBQF3IwD+6TFQCdq6LrpA2z9o78DzJU622JZj6fAaJ4GqTLchtsL4PK/I1gMsXkURCi1FDc+X/XLjOUp4Si07NCfGJLX36S/da0= 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 40L7PnXZ024037 for ; Sun, 21 Jan 2024 07:30:06 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=UO7PLDI THLmciF9khgn80Vi5k7jYusRTCa202wZoXGY=; b=Ya+dpr6GqdgP1bhF5rFYF0U E+9klj4MaPca08CiNocycM1qt/aahiXK9PhR0xF13ys9UMtGzXqV4lXnTheWNYhP 50mPHO7ML9DElEMe1ktTsI5TvjTRzZ9GcfiFfj6Q+hgMNOFm6zGHjeZGPFfCWo5t Sjegs94D+dujS5AsooQ/OeyJWU0MAu9G7jKHQ2hQ3l4tafOZQkDV6qbp1LOMKzzB be5wdPAeyZxao36wxlIJ0TMOM8SNhp08jjo5jORKdjb6jVJPNAVqzy67okiPAkHm P+L76GYNkSMoFHEONNXAAXjS/kKbtCXjAWvnstMBY+NZg0bS8/6fvR0DQGtHutQ= = Received: from nasanppmta03.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3vr5gphkca-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sun, 21 Jan 2024 07:30:06 +0000 (GMT) Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 40L7U5is003074 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sun, 21 Jan 2024 07:30:05 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; Sat, 20 Jan 2024 23:30:05 -0800 From: Andrew Pinski To: CC: Andrew Pinski Subject: [PATCH] arm: Fix parsecpu.awk for aliases [PR113030] Date: Sat, 20 Jan 2024 23:29:53 -0800 Message-ID: <20240121072953.2241859-1-quic_apinski@quicinc.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Originating-IP: [10.49.16.6] X-ClientProxiedBy: nalasex01b.na.qualcomm.com (10.47.209.197) 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: MJj2vctTXdEv2RKtqXtrg2FBrhonIUQp X-Proofpoint-ORIG-GUID: MJj2vctTXdEv2RKtqXtrg2FBrhonIUQp X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-01-20_06,2024-01-19_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 bulkscore=0 suspectscore=0 adultscore=0 clxscore=1015 mlxscore=0 malwarescore=0 impostorscore=0 mlxlogscore=540 lowpriorityscore=0 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2401210057 X-Spam-Status: No, score=-13.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org So the problem here is the 2 functions check_cpu and check_arch use the wrong variable to check if an alias is valid for that cpu/arch. check_cpu uses cpu_optaliases instead of cpu_opt_alias. cpu_optaliases is an array of index'ed by the cpuname that contains all of the valid aliases for that cpu but cpu_opt_alias is an double index array which is index'ed by cpuname and the alias which provides what is the alias for that option. Similar thing happens for check_arch and arch_optaliases vs arch_optaliases. Tested by running: ``` awk -f config/arm/parsecpu.awk -v cmd="chkarch armv7-a+simd" config/arm/arm-cpus.in awk -f config/arm/parsecpu.awk -v cmd="chkarch armv7-a+neon" config/arm/arm-cpus.in awk -f config/arm/parsecpu.awk -v cmd="chkarch armv7-a+neon-vfpv3" config/arm/arm-cpus.in ``` And they don't return error back. gcc/ChangeLog: PR target/113030 * config/arm/parsecpu.awk (check_cpu): Use cpu_opt_alias instead of cpu_optaliases. (check_arch): Use arch_opt_alias instead of arch_optaliases. Signed-off-by: Andrew Pinski --- gcc/config/arm/parsecpu.awk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/config/arm/parsecpu.awk b/gcc/config/arm/parsecpu.awk index ddd4f3b440a..384462bdb5b 100644 --- a/gcc/config/arm/parsecpu.awk +++ b/gcc/config/arm/parsecpu.awk @@ -529,7 +529,7 @@ function check_cpu (name) { for (n = 2; n <= exts; n++) { if (!((cpu_name, extensions[n]) in cpu_opt_remove) \ - && !((cpu_name, extensions[n]) in cpu_optaliases)) { + && !((cpu_name, extensions[n]) in cpu_opt_alias)) { return "error" } } @@ -552,7 +552,7 @@ function check_arch (name) { for (n = 2; n <= exts; n++) { if (!((extensions[1], extensions[n]) in arch_opt_remove) \ - && !((extensions[1], extensions[n]) in arch_optaliases)) { + && !((extensions[1], extensions[n]) in arch_opt_alias)) { return "error" } }