From patchwork Tue Mar 7 02:58:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taylor Simpson X-Patchwork-Id: 1752881 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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=aqklRVUJ; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PW0Xy74XKz1yWx for ; Tue, 7 Mar 2023 13:59:46 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZNXL-0000Tn-Ac; Mon, 06 Mar 2023 21:58:47 -0500 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 1pZNXE-0000A6-OK for qemu-devel@nongnu.org; Mon, 06 Mar 2023 21:58:42 -0500 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 1pZNXA-0005n5-1a for qemu-devel@nongnu.org; Mon, 06 Mar 2023 21:58:40 -0500 Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3270obCS032160; Tue, 7 Mar 2023 02:58:32 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-type : content-transfer-encoding; s=qcppdkim1; bh=DzrwYl9J1SE3kUMcpWzQ+MH3ogFaNa678XNvxwH9rSM=; b=aqklRVUJhzieXHGN+DtQ7g7PH4q2GwFKT87O4RyYGuZhJZ8ZYk6W8Dxw8ofr8aPRJzoa hsyFYiPcRPsEl4S0EbyosN/OquA+fk69ydrq2Ihmn/B046hJszdFFahOF0bHuCUt9ZSJ nJnswWccs5AHhur8z1nAK9RU/HRBBSqKFExLh8xCQ6/ZEpQX9MmSDiw/wpMToAa/fRrS I7VjMxt/3AtswTotETkLGCEgGELLWTyya8Sb3TUAGpkpHGVYPOBlvuYDpc5PAP10bM7E izrb/E7oT87yD5dyRQwBYa7tGYIBCbFvcwKPzlPEjA1mtMKqTren5JNlfJN8ApdxPWaZ /g== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3p41916qp6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 07 Mar 2023 02:58:32 +0000 Received: from pps.filterd (NALASPPMTA03.qualcomm.com [127.0.0.1]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTP id 3272qoSd018008; Tue, 7 Mar 2023 02:58:31 GMT Received: from pps.reinject (localhost [127.0.0.1]) by NALASPPMTA03.qualcomm.com (PPS) with ESMTPS id 3p4fjsun8h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 07 Mar 2023 02:58:31 +0000 Received: from NALASPPMTA03.qualcomm.com (NALASPPMTA03.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3272wVP8023780; Tue, 7 Mar 2023 02:58:31 GMT Received: from hu-devc-sd-u20-a-1.qualcomm.com (hu-tsimpson-lv.qualcomm.com [10.47.204.221]) by NALASPPMTA03.qualcomm.com (PPS) with ESMTPS id 3272wUQP023777 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 07 Mar 2023 02:58:31 +0000 Received: by hu-devc-sd-u20-a-1.qualcomm.com (Postfix, from userid 47164) id BDA7467A; Mon, 6 Mar 2023 18:58:30 -0800 (PST) From: Taylor Simpson To: qemu-devel@nongnu.org Cc: tsimpson@quicinc.com, richard.henderson@linaro.org, philmd@linaro.org, ale@rev.ng, anjo@rev.ng, bcain@quicinc.com, quic_mathbern@quicinc.com Subject: [PATCH v6 00/14] Hexagon: COF overrides, new generator, test/bug update Date: Mon, 6 Mar 2023 18:58:14 -0800 Message-Id: <20230307025828.1612809-1-tsimpson@quicinc.com> X-Mailer: git-send-email 2.25.1 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-ORIG-GUID: 8ge_Cp4k5NxfjbX-Ts9ohxXiFvDl1b3U X-Proofpoint-GUID: 8ge_Cp4k5NxfjbX-Ts9ohxXiFvDl1b3U X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-06_14,2023-03-06_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 lowpriorityscore=0 malwarescore=0 priorityscore=1501 mlxlogscore=728 clxscore=1015 impostorscore=0 bulkscore=0 spamscore=0 phishscore=0 suspectscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2303070025 Received-SPF: pass client-ip=205.220.168.131; envelope-from=tsimpson@qualcomm.com; helo=mx0a-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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The idef-parser skips the change-of-flow (COF) instructions, so add overrides The new toolchain allows us to execute the HVX tests New generator enables significant improvement to TCG generation for predicated instructions by removing the need for slot_cancelled **** Changes in v2 **** Add a new generator for analyze_ instructions. Pouplate the DisasContext ahead of generating code. **** Changes in v3 **** Cleanup of analysis code: Added test updates enabled by new toolchain container **** Changes in v4 **** Additional patch for bug fix Remove pkt_has_store_s1 from runtime state with dealloc-return patch New patches to utilize new analyzer to improve predicated instructions **** Changes in v5 **** Don't remove code that is needed for --disable-hexagon-idef-parser config pkt_has_store_s1 runtime field and mem_load[1248] functions Add understanding of idef-parser to analyzer Additional patch to determine when pkt_has_store_s1 needs to be set Update fGEN_TCG_ to preserve --disable-hexagon-idef-parser config in Remove gen_log_predicated_reg_write[_pair] patch Move tcg_temp_free_i64 into gen_log_vreg_write Add get_result_qreg function **** Changes in v6 **** Address feedback from Anton Johansson Adapt to Richard Henderson's recent patches - Don't call tcg_temp_local_* - Don't call tcg_temp_free_* Taylor Simpson (14): Hexagon (target/hexagon) Add overrides for jumpr31 instructions Hexagon (target/hexagon) Add overrides for callr Hexagon (target/hexagon) Add overrides for endloop1/endloop01 Hexagon (target/hexagon) Add overrides for dealloc-return instructions Hexagon (target/hexagon) Analyze packet before generating TCG Hexagon (target/hexagon) Don't set pkt_has_store_s1 when not needed Hexagon (target/hexagon) Analyze packet for HVX Hexagon (tests/tcg/hexagon) Update preg_alias.c Hexagon (tests/tcg/hexagon) Remove __builtin from scatter_gather Hexagon (tests/tcg/hexagon) Enable HVX tests Hexagon (target/hexagon) Change subtract from zero to change sign Hexagon (target/hexagon) Remove gen_log_predicated_reg_write[_pair] Hexagon (target/hexagon) Reduce manipulation of slot_cancelled Hexagon (target/hexagon) Improve code gen for predicated HVX instructions target/hexagon/cpu.h | 5 +- target/hexagon/gen_tcg.h | 82 +++- target/hexagon/gen_tcg_hvx.h | 17 +- target/hexagon/macros.h | 29 +- target/hexagon/op_helper.h | 3 +- target/hexagon/translate.h | 86 ++-- target/hexagon/attribs_def.h.inc | 1 + target/hexagon/genptr.c | 296 ++++++----- target/hexagon/idef-parser/parser-helpers.c | 12 +- target/hexagon/op_helper.c | 60 +-- target/hexagon/translate.c | 288 ++++++----- tests/tcg/hexagon/fpstuff.c | 31 +- tests/tcg/hexagon/preg_alias.c | 10 +- tests/tcg/hexagon/scatter_gather.c | 513 +++++++++++--------- target/hexagon/README | 31 +- target/hexagon/gen_analyze_funcs.py | 252 ++++++++++ target/hexagon/gen_helper_funcs.py | 19 +- target/hexagon/gen_helper_protos.py | 12 +- target/hexagon/gen_tcg_funcs.py | 152 +++--- target/hexagon/hex_common.py | 10 +- target/hexagon/idef-parser/idef-parser.lex | 4 +- target/hexagon/idef-parser/idef-parser.y | 7 +- target/hexagon/meson.build | 11 +- tests/tcg/hexagon/Makefile.target | 13 +- 24 files changed, 1201 insertions(+), 743 deletions(-) create mode 100755 target/hexagon/gen_analyze_funcs.py