From nobody Mon Nov 25 05:11:07 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=quicinc.com ARC-Seal: i=1; a=rsa-sha256; t=1717894780; cv=none; d=zohomail.com; s=zohoarc; b=AAe4i3smZquT1ILlb35z52hxlP0yA22gVrc8SdjCjzp01Dspx4ugkrY4sG17Rh0qTdiU1RrUXd1IuCyKfftxTWTcGbTHiMkegUmYKDAbs72B0hFb6Zcl4zc8y8XX8Foe2MjnZGKYXUQxSq4VFfZgrOmQtGChia/kDrC+mmqzy6w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1717894780; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=/hTHLZvz4KGUdCEfcRHQa8TgJ5Q7rjuwuSRnIqOb6gA=; b=CKARql09i+D7o8IJZ59G4iFnV2wp9lOQaKFC+xYeYFeA6wo8zMvZ+oTbNnSTxfBxu5IgBvgcmSK08Vb2SvOChuyjFWNL4CjPr1ZmISeLRBLOlSkTo75YK0HyGHQaITQu8ZTV/DQLxGw7ROhZk+vSahc/QUE/RI5aiGs1EF804C0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1717894780300480.5642879601654; Sat, 8 Jun 2024 17:59:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sG6sH-0007mN-Iu; Sat, 08 Jun 2024 20:57:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sG6sG-0007lU-BG for qemu-devel@nongnu.org; Sat, 08 Jun 2024 20:57:32 -0400 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sG6sC-0003td-9j for qemu-devel@nongnu.org; Sat, 08 Jun 2024 20:57:30 -0400 Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 458N0TQ1006317; Sun, 9 Jun 2024 00:57:23 GMT Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3ymgfk14yr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 09 Jun 2024 00:57:22 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.17.1.19/8.17.1.19) with ESMTPS id 4590vLrs024413 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 9 Jun 2024 00:57:22 GMT Received: from hu-bcain-lv.qualcomm.com (10.49.16.6) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Sat, 8 Jun 2024 17:57:21 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= /hTHLZvz4KGUdCEfcRHQa8TgJ5Q7rjuwuSRnIqOb6gA=; b=HoAmb10DlPMCarxJ dCX51KCV7tcjb0lW7Mu7ifcZhuD/zc8+LdqeZXSb13UR72kVaFkls+cxMdns1eQA s7A44pzrP0+1D8xf/MMMDrmFJF1D1lEBCbpJe+dZfYkABSwDfCkxEhCl2pjos5P9 E+eaf07nAJ3AqcPxrfdO9bbFu7Hq9M3XWmS2o3EYzyGkE+WrYV88Tpls1YJ8sWk3 Ng3jKi6SYilv0TC2XNIzMIVxQnYDClFlnNsDHvhKO3W423wxscKFeFrccUCE93nC bwasqUU9/KqbKJnnqJznXsRDf8ynBCaeiY+lSYuAIEg8pAH/h5snPs/hiqHkv8fB bv4pfA== From: Brian Cain To: CC: , , , , , , , , , , Subject: [PULL 6/6] target/hexagon: idef-parser simplify predicate init Date: Sat, 8 Jun 2024 17:57:05 -0700 Message-ID: <20240609005705.2809037-7-bcain@quicinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240609005705.2809037-1-bcain@quicinc.com> References: <20240609005705.2809037-1-bcain@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.49.16.6] X-ClientProxiedBy: nalasex01a.na.qualcomm.com (10.47.209.196) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: GdiOYVNkpe8YoHmL5MW-oW94XVJEFROp X-Proofpoint-ORIG-GUID: GdiOYVNkpe8YoHmL5MW-oW94XVJEFROp X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-08_16,2024-06-06_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 clxscore=1015 priorityscore=1501 phishscore=0 adultscore=0 spamscore=0 malwarescore=0 mlxlogscore=729 suspectscore=0 impostorscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405170001 definitions=main-2406090006 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=205.220.168.131; envelope-from=bcain@quicinc.com; helo=mx0a-0031df01.pphosted.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @quicinc.com) X-ZM-MESSAGEID: 1717894781018100001 From: Anton Johansson Only predicate instruction arguments need to be initialized by idef-parser. This commit removes registers from the init_list and simplifies gen_inst_init_args() slightly. Signed-off-by: Anton Johansson Reviewed-by: Taylor Simpson Reviewed-by: Brian Cain Message-Id: <20240523125901.27797-5-anjo@rev.ng> Signed-off-by: Brian Cain --- target/hexagon/idef-parser/idef-parser.y | 2 -- target/hexagon/idef-parser/parser-helpers.c | 26 +++++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/target/hexagon/idef-parser/idef-parser.y b/target/hexagon/idef= -parser/idef-parser.y index cd2612eb8c..9ffb9f9699 100644 --- a/target/hexagon/idef-parser/idef-parser.y +++ b/target/hexagon/idef-parser/idef-parser.y @@ -233,8 +233,6 @@ code : '{' statements '}' argument_decl : REG { emit_arg(c, &@1, &$1); - /* Enqueue register into initialization list */ - g_array_append_val(c->inst.init_list, $1); } | PRED { diff --git a/target/hexagon/idef-parser/parser-helpers.c b/target/hexagon/i= def-parser/parser-helpers.c index c150c308be..a7dcd85fe4 100644 --- a/target/hexagon/idef-parser/parser-helpers.c +++ b/target/hexagon/idef-parser/parser-helpers.c @@ -1652,26 +1652,28 @@ void gen_inst(Context *c, GString *iname) =20 =20 /* - * Initialize declared but uninitialized registers, but only for - * non-conditional instructions + * Initialize declared but uninitialized instruction arguments. Only neede= d for + * predicate arguments, initialization of registers is handled by the Hexa= gon + * frontend. */ void gen_inst_init_args(Context *c, YYLTYPE *locp) { + HexValue *val =3D NULL; + char suffix; + + /* If init_list is NULL arguments have already been initialized */ if (!c->inst.init_list) { return; } =20 for (unsigned i =3D 0; i < c->inst.init_list->len; i++) { - HexValue *val =3D &g_array_index(c->inst.init_list, HexValue, i); - if (val->type =3D=3D REGISTER_ARG) { - /* Nothing to do here */ - } else if (val->type =3D=3D PREDICATE) { - char suffix =3D val->is_dotnew ? 'N' : 'V'; - EMIT_HEAD(c, "tcg_gen_movi_i%u(P%c%c, 0);\n", val->bit_width, - val->pred.id, suffix); - } else { - yyassert(c, locp, false, "Invalid arg type!"); - } + val =3D &g_array_index(c->inst.init_list, HexValue, i); + suffix =3D val->is_dotnew ? 'N' : 'V'; + yyassert(c, locp, val->type =3D=3D PREDICATE, + "Only predicates need to be initialized!"); + yyassert(c, locp, val->bit_width =3D=3D 32, + "Predicates should always be 32 bits"); + EMIT_HEAD(c, "tcg_gen_movi_i32(P%c%c, 0);\n", val->pred.id, suffix= ); } =20 /* Free argument init list once we have initialized everything */ --=20 2.25.1