From patchwork Mon Oct 3 18:15:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Taylor Simpson X-Patchwork-Id: 12997739 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 24FCFC433FE for ; Mon, 3 Oct 2022 18:25:17 +0000 (UTC) Received: from localhost ([::1]:47044 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ofQ7v-0001In-W0 for qemu-devel@archiver.kernel.org; Mon, 03 Oct 2022 14:25:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39990) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ofPyX-0006Cn-Qr for qemu-devel@nongnu.org; Mon, 03 Oct 2022 14:15:35 -0400 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]:54900) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ofPyR-0000pN-Q2 for qemu-devel@nongnu.org; Mon, 03 Oct 2022 14:15:31 -0400 Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 293GcVPx012364; Mon, 3 Oct 2022 18:15:15 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-type : content-transfer-encoding; s=qcppdkim1; bh=PxxPM6pVKCbSsk6AsuCOOwHeR8WdyUGqEJoL4V+NODk=; b=UNu29PEQmQOCxRbLNHimyilDoOfYON2O1bNZJ5qfy6afO9jyjLsyHisVMEU3pW3iVR2I ATSukOBzvjjyDvH2JsXt3+AYnAxuEYvJcPymt4TJO44tKewlsIXHZV953ezBECVs+bnN fUiJZX5OGXoaVSaQcDhZmBwSatLjcn35ovzjQ5zdmdsMYF9J0CErZ542KkY2G9sMy5UC jaMimdz12NRwgqURdbyleFML8ZCl0UxPhiedDqHX2rJ9oYM1hm2slvDUjYgpfgi4Xv1O lmTFqtDaYt4X4POAYcsXOGyTY3AG/5RKYvbx0tYsaVWABye63UzUeinOBkoT6XzTRS3A Ww== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3jxawu4g61-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 03 Oct 2022 18:15:15 +0000 Received: from pps.filterd (NALASPPMTA04.qualcomm.com [127.0.0.1]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTP id 293IFE03013431; Mon, 3 Oct 2022 18:15:14 GMT Received: from pps.reinject (localhost [127.0.0.1]) by NALASPPMTA04.qualcomm.com (PPS) with ESMTP id 3jxemkgptv-1; Mon, 03 Oct 2022 18:15:14 +0000 Received: from NALASPPMTA04.qualcomm.com (NALASPPMTA04.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 293ID5nd009286; Mon, 3 Oct 2022 18:15:14 GMT Received: from hu-devc-lv-u18-c.qualcomm.com (hu-tsimpson-lv.qualcomm.com [10.47.235.220]) by NALASPPMTA04.qualcomm.com (PPS) with ESMTP id 293IFDcS013421; Mon, 03 Oct 2022 18:15:14 +0000 Received: by hu-devc-lv-u18-c.qualcomm.com (Postfix, from userid 47164) id 877A25000B0; Mon, 3 Oct 2022 11:15:13 -0700 (PDT) From: Taylor Simpson To: qemu-devel@nongnu.org Cc: tsimpson@quicinc.com, richard.henderson@linaro.org, f4bug@amsat.org, peter.maydell@linaro.org, bcain@quicinc.com, quic_mathbern@quicinc.com, stefanha@redhat.com Subject: [PULL v3 4/4] Hexagon (gen_tcg_funcs.py): avoid duplicated tcg code on A_CVI_NEW Date: Mon, 3 Oct 2022 11:15:11 -0700 Message-Id: <20221003181511.5535-5-tsimpson@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221003181511.5535-1-tsimpson@quicinc.com> References: <20221003181511.5535-1-tsimpson@quicinc.com> MIME-Version: 1.0 X-QCInternal: smtphost X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: 9VB27m4twm11iUFFvtTczaSL-939unIU X-Proofpoint-ORIG-GUID: 9VB27m4twm11iUFFvtTczaSL-939unIU X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-10-03_02,2022-09-29_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=361 phishscore=0 clxscore=1015 malwarescore=0 spamscore=0 suspectscore=0 lowpriorityscore=0 adultscore=0 impostorscore=0 priorityscore=1501 mlxscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210030109 Received-SPF: pass client-ip=205.220.180.131; envelope-from=tsimpson@qualcomm.com; helo=mx0b-0031df01.pphosted.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Matheus Tavares Bernardino Hexagon instructions with the A_CVI_NEW attribute produce a vector value that can be used in the same packet. The python function responsible for generating code for such instructions has a typo ("if" instead of "elif"), which makes genptr_dst_write_ext() be executed twice, thus also generating the same tcg code twice. Fortunately, this doesn't cause any problems for correctness, but it is less efficient than it could be. Fix it by using an "elif" and avoiding the unnecessary extra code gen. Signed-off-by: Matheus Tavares Bernardino Signed-off-by: Taylor Simpson Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Taylor Simpson Message-Id: --- target/hexagon/gen_tcg_funcs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/hexagon/gen_tcg_funcs.py b/target/hexagon/gen_tcg_funcs.py index d72c689ad7..6dea02b0b9 100755 --- a/target/hexagon/gen_tcg_funcs.py +++ b/target/hexagon/gen_tcg_funcs.py @@ -548,7 +548,7 @@ def genptr_dst_write_opn(f,regtype, regid, tag): if (hex_common.is_hvx_reg(regtype)): if (hex_common.is_new_result(tag)): genptr_dst_write_ext(f, tag, regtype, regid, "EXT_NEW") - if (hex_common.is_tmp_result(tag)): + elif (hex_common.is_tmp_result(tag)): genptr_dst_write_ext(f, tag, regtype, regid, "EXT_TMP") else: genptr_dst_write_ext(f, tag, regtype, regid, "EXT_DFL")