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 (QUIC)" X-Patchwork-Id: 189797 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2bc4:b0:101:a8e8:374 with SMTP id hx4csp1959321dyb; Sat, 20 Jan 2024 23:30:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IEi2vusH6qS49wgZUIh72trD4s+xS+tX9Pzysnyjn7S+PAyBEkQ7yrppDXq6PWN65J/AkqE X-Received: by 2002:a05:6214:27ef:b0:686:5d97:9d49 with SMTP id jt15-20020a05621427ef00b006865d979d49mr1438244qvb.54.1705822243298; Sat, 20 Jan 2024 23:30:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705822243; cv=pass; d=google.com; s=arc-20160816; b=gtfbFfxeo+Csp/6xxgVdQH8QFpkbcqm3kOv5WEsi89tm0WbApfGrN8owY2B05mk7I0 2+qVGdV4xlX0Nwwd4TDDSHsi6xgMaWgAUTLBpujiG3TDibX/bBk4LGN0Z5FfKJkg21il q8r7nBICNMPBeSA7Ulp+ItJvD6ozHfeX6kDwQUG6xWGqJXL7Y5bnzaBQy/TFRfnfdGfK lffllpqF95YZYet4cKzca3rLFPN5vlWEPpUB+AJmZKJHVp3sRLCtfJhQkXoHFeC/TViB Zw9wtLAvWiBezSHn48v+uQJ/Yv1iusozoxSpKmqO9nI9r6KGA0bjyT23W1DAJnMUPSCH ExIA== 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=UO7PLDITHLmciF9khgn80Vi5k7jYusRTCa202wZoXGY=; fh=o3CEdS3yGN/eIa89Zn0Kf01WYLxTE9IjKuSQGVPeOHI=; b=nVdZK+I+sQmvmU3OHYeSidpV7DpAntiE/aRrrg/NYgtGU0ygP2oqUtPRhQ7zn41KxS zUhELF87r/aO2ecAn9yehtXZSwpVDddCGo9uwZiz/DdJ8doodThBNQEcaVi4OMPBZcff qeR64KuIU7Vn3fq5RPcQiG2r2xavQq1qVsamyefM8Ir+o/VYqiy14qt1vfwy0s0vOHXR UnEmV/4eCSViJ7hmX92jBphvKJnsbAcnBfW0tt50BaMsIo2q0ySkanyQZa7kiQpZzBQ1 v+6Gu5Fa43+alZjcs+4s+qkJXVGKVtxQl+LnhmKGgU62GLqKQ2CxP/e4dKSUaD7YR4JX YkGg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Ya+dpr6G; 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 (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id x26-20020a0cb21a000000b0067a90d3023esi3176578qvd.279.2024.01.20.23.30.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 Jan 2024 23:30:43 -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=Ya+dpr6G; 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 07D233858D33 for ; Sun, 21 Jan 2024 07:30:43 +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+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788684264579146263 X-GMAIL-MSGID: 1788684264579146263 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" } }