From nobody Mon Nov 23 04:28:03 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=reject dis=none) header.from=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1793733591; cv=none; d=zohomail.com; s=zohoarc; b=jfcGCuHES2tUJgP8pqIUOYEY1sSJSg4WCo8+PRtoqO9Ub9+M6Zd1xoJCZLANrMxuRLk6MnTUzzNk9TuEKkuGAS3CuudZ7pNA07pt3aKLGMAorbzW8IefYsNKYB8IMihEL10X7ZRRKWIlDjWT6nUw8KLRNbUxf/dN0rNZycv4pMc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793733591; h=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:Reply-To:Reply-To:Sender:Subject:Subject:To:To:Message-Id; bh=WfnvFJ9xGjVRk183r1KvOwbUTPgKSfeMXefcfTqlip8=; b=bE15SmLd72IDRqkZGs0cff+qyq3DsUcIp45+sb1A4Vw3i6xqmTQnDzXtBkNv3Te0T4Axbo5Q2PEPueih6QP6K1mK5kkKsQsEja1aQoDmtJa39jxgOWYnGXgsZwIOjc9YLZ+0E4a80mcQHnasqpzhiJl1hcsZWEefC4rcJ2cXeXs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793733591465777.5227592785552; Tue, 3 Nov 2026 11:19:51 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xOK25-0000sO-IV; Tue, 03 Nov 2026 14:18:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xOK1t-0000qA-VR for qemu-devel@nongnu.org; Tue, 03 Nov 2026 14:18:47 -0500 Received: from rev.ng ([94.130.142.21]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xOK1r-0007ru-CT for qemu-devel@nongnu.org; Tue, 03 Nov 2026 14:18:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=rev.ng; s=dkim; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive:List-Unsubscribe:List-Unsubscribe-Post: List-Help; bh=WfnvFJ9xGjVRk183r1KvOwbUTPgKSfeMXefcfTqlip8=; b=i46NSn7JJIYx/ni VcYv5ymNJWZibIUF7Tt/UULCB+TY5ti6TJKdQVs3++ue4dOA/y7hJcHvG3zGRIy0qbE4DKZ+vMZ/N +9rrD5nsrbOGk5QY44LVtqCMJ2RXAnzgWov9KNuIyreWnFX4/XXDauIuIH7fEqzzfn0/GVpNF0mCD P0=; To: qemu-devel@nongnu.org Cc: ale@rev.ng, brian.cain@oss.qualcomm.com, marco.liebel@oss.qualcomm.com, Anton Johansson Subject: [PATCH v1 1/6] target/hexagon: HLX, preserve scalar :mem_noshuf ordering Date: Tue, 3 Nov 2026 20:23:53 +0100 Message-ID: <20261103192358.28589-2-anjo@rev.ng> In-Reply-To: <20261103192358.28589-1-anjo@rev.ng> References: <20261103192358.28589-1-anjo@rev.ng> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=lists1p.gnu.org; Received-SPF: pass client-ip=94.130.142.21; envelope-from=anjo@rev.ng; helo=rev.ng 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_PASS=-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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Anton Johansson From: Anton Johansson via qemu development Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1793733591891158500 Content-Type: text/plain; charset="utf-8" A packet containing HLX instructions currently defers all stores to the end of the packet, this breaks scalar :mem_noshuf ordering. Only reorder HLX stores. Fixes: a6fae6da070d66b9 ("target/hexagon: translate packets with HLX instru= ctions") Signed-off-by: Anton Johansson Reviewed-by: Marco Liebel --- target/hexagon/translate.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/target/hexagon/translate.c b/target/hexagon/translate.c index 8ab28d40d3..f9d4c3fb66 100644 --- a/target/hexagon/translate.c +++ b/target/hexagon/translate.c @@ -1525,8 +1525,10 @@ static void decode_and_translate_packet(CPUHexagonSt= ate *env, DisasContext *ctx) for (int pass =3D 0; pass < 3; pass++) { for (i =3D 0; i < ctx->pkt.num_insns; i++) { Insn *insn =3D &ctx->pkt.insn[i]; + bool hlx =3D GET_ATTRIB(insn->opcode, A_HLX); bool tmp =3D GET_ATTRIB(insn->opcode, A_HLX_TMP); - bool store =3D !tmp && GET_ATTRIB(insn->opcode, A_STOR= E); + bool store =3D !tmp && hlx && + GET_ATTRIB(insn->opcode, A_STORE); if (pass !=3D (tmp ? 0 : store ? 2 : 1)) { continue; } @@ -1534,8 +1536,7 @@ static void decode_and_translate_packet(CPUHexagonSta= te *env, DisasContext *ctx) if (insn->hlx_new_zero) { gen_hlx_new_zero(insn); } - if (GET_ATTRIB(insn->opcode, A_HLX) && - trace_event_get_state_backends( + if (hlx && trace_event_get_state_backends( TRACE_HEXAGON_HLX_OP)) { gen_helper_hlx_trace_op(tcg_env, tcg_constant_i32(insn->opcode)); --=20 2.52.0 From nobody Mon Nov 23 04:28:03 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=reject dis=none) header.from=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1793733568; cv=none; d=zohomail.com; s=zohoarc; b=g82gU3lvKYy7zpk+o/gKGJnSeNOD5aTXcjCp1opDD0qgIaeHX+b14H0etzSDENS7FycG7Eve7o5jlW2rn9HTHsE026r2DeimjGj1wXwJCNPUqbqbjlfwh3EQ1BoVndOYRne9sjWCrFWcYaoTJobGngg6saOMbRGwCzs99N1ICUs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793733568; h=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:Reply-To:Reply-To:Sender:Subject:Subject:To:To:Message-Id; bh=b8lxwQR2D5XEWs7Xoesgyd+M5Ru3/C6qqtlQIy7pMFc=; b=Lm2j3FtHU8pielrRa1IZ9DvgnHEv18ncrQT/B0FyPi4l2FCm0o+rcMMQ8gbhz9Kz6Kgrl6qGk2dx3RiIUN3DRa25BwSl1jVy8SOU/UgvLQR20OkTjbxVA4uCdI0syaPsEj78Afh9k6M+FrHiZq9N+S6ivSDxi5efHMeOkD8NpVA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793733568249834.2529966095087; Tue, 3 Nov 2026 11:19:28 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xOK20-0000rG-1C; Tue, 03 Nov 2026 14:18:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xOK1u-0000qD-Fh for qemu-devel@nongnu.org; Tue, 03 Nov 2026 14:18:47 -0500 Received: from rev.ng ([94.130.142.21]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xOK1s-0007rw-0j for qemu-devel@nongnu.org; Tue, 03 Nov 2026 14:18:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=rev.ng; s=dkim; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive:List-Unsubscribe:List-Unsubscribe-Post: List-Help; bh=b8lxwQR2D5XEWs7Xoesgyd+M5Ru3/C6qqtlQIy7pMFc=; b=SpVgaQuI/H5o0X6 DZFRkPlUeJD2JV50j5EtdnzEsxgezj1tQZrt/SQ32RodSOWvcxH8B6JY9E7TmEi7EY16+jroVLFMi CTtNP9yvW+AVcoMUEQGhQO+xGWSQ3ktRdpeDY9JvVdG+6+xE/rJgporr/swLkLku+o3FbLbZ9R9XM oY=; To: qemu-devel@nongnu.org Cc: ale@rev.ng, brian.cain@oss.qualcomm.com, marco.liebel@oss.qualcomm.com, Anton Johansson Subject: [PATCH v1 2/6] target/hexagon: HLX, search for .new values in pair high register Date: Tue, 3 Nov 2026 20:23:54 +0100 Message-ID: <20261103192358.28589-3-anjo@rev.ng> In-Reply-To: <20261103192358.28589-1-anjo@rev.ng> References: <20261103192358.28589-1-anjo@rev.ng> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=lists1p.gnu.org; Received-SPF: pass client-ip=94.130.142.21; envelope-from=anjo@rev.ng; helo=rev.ng 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_PASS=-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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Anton Johansson From: Anton Johansson via qemu development Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1793733569614158500 Content-Type: text/plain; charset="utf-8" Otherwise, the following packet { L7:6 =3D combine(L0, L1) memw(R7) =3D L7.new } results in memw(R7) being zero-intialized, compared to L6.new which would correctly write the lower bytes of the pair. Fixes: ef81d1b047337e81 ("target/hexagon: decode HLX packets and add load a= nd store") Signed-off-by: Anton Johansson --- target/hexagon/decode.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/target/hexagon/decode.c b/target/hexagon/decode.c index d48630da87..8921ff765d 100644 --- a/target/hexagon/decode.c +++ b/target/hexagon/decode.c @@ -110,9 +110,25 @@ static int hlx_find_new_value_producer(Packet *packet,= int consumer, { for (int i =3D 0; i < packet->num_insns; i++) { Insn *insn =3D &packet->insn[i]; + uint8_t regno; =20 - if (i !=3D consumer && GET_ATTRIB(insn->opcode, A_HLX) && - insn->dest_idx !=3D -1 && insn->regno[insn->dest_idx] =3D=3D l= reg) { + /* + * Skip ourselves, instructions without return values, and + * any non-HLX instructions. + */ + if (i =3D=3D consumer || !GET_ATTRIB(insn->opcode, A_HLX) || + insn->dest_idx =3D=3D -1) { + continue; + } + + regno =3D insn->regno[insn->dest_idx]; + + /* + * Compare against the base register number, and against the top + * register for instructions returning pairs. + */ + if (regno =3D=3D lreg || + (GET_ATTRIB(insn->opcode, A_HLX_PAIRED_ALU) && regno + 1 =3D= =3D lreg)) { return i; } } --=20 2.52.0 From nobody Mon Nov 23 04:28:03 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=reject dis=none) header.from=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1793733569; cv=none; d=zohomail.com; s=zohoarc; b=AOnoCImCoJpYLSO7hfHD9uSnUD2KWh7e0Sm66WAC3hLr45bpsU550apEfZAw1Eq1Wtt5ldaanZkHx3BpCAk5EFoQxfSFnsnNswRHshoeTnZNL8OXobJyBMZJXXb1WgcUaPO9gg7lgrSFJ6pPTSOufWQ0eFiXMMfvug+zHp3O9Po= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793733569; h=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:Reply-To:Reply-To:Sender:Subject:Subject:To:To:Message-Id; bh=DNfsGRGG5uQKioWtNEVt/QstjH+52mQuUs3K5rPiDEk=; b=hpku3Wuw91NWUddgZC5UE6LkKltZVWSGQR+o/DwJ8RBKEtjyl5J1XIMMUnZDj4oEd0ly2mt4+Hk7s4qT7DzxOrSRN23Epj9HTvUNiEZ6MQLvNA4K948xMFbSCnMuceMDrDo5s7sVIUTPeGdu1Zw6231HQ/0veqE7+H8Ew6RyCNs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793733569043303.93793526177024; Tue, 3 Nov 2026 11:19:29 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xOK2B-0000u5-60; Tue, 03 Nov 2026 14:19:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xOK1w-0000qt-J5 for qemu-devel@nongnu.org; Tue, 03 Nov 2026 14:18:48 -0500 Received: from rev.ng ([94.130.142.21]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xOK1t-0007s1-Nu for qemu-devel@nongnu.org; Tue, 03 Nov 2026 14:18:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=rev.ng; s=dkim; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive:List-Unsubscribe:List-Unsubscribe-Post: List-Help; bh=DNfsGRGG5uQKioWtNEVt/QstjH+52mQuUs3K5rPiDEk=; b=Hz19Yn+obYkhnKQ +6T9BBB8DthW8+4KdMsNTUGiO1BzVGeC4u1hEiQ07PjYy4Pru+rCwfxVukzwdmoWUvaHSs+CDs9xC Obf1xduiDh4GQif1l5EyoNOwCGKRpPIxD/4idx6hSjwnpGVViVUiE7BNvE385suzxeM+32mtWhz24 bI=; To: qemu-devel@nongnu.org Cc: ale@rev.ng, brian.cain@oss.qualcomm.com, marco.liebel@oss.qualcomm.com, Anton Johansson Subject: [PATCH v1 3/6] target/hexagon: Forward return address to HLX load/store helpers Date: Tue, 3 Nov 2026 20:23:55 +0100 Message-ID: <20261103192358.28589-4-anjo@rev.ng> In-Reply-To: <20261103192358.28589-1-anjo@rev.ng> References: <20261103192358.28589-1-anjo@rev.ng> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=lists1p.gnu.org; Received-SPF: pass client-ip=94.130.142.21; envelope-from=anjo@rev.ng; helo=rev.ng 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_PASS=-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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Anton Johansson From: Anton Johansson via qemu development Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1793733569670158500 Content-Type: text/plain; charset="utf-8" Fixes: 2db29a3615a5ad2a3 ("target/hexagon: add HLX helper support") Signed-off-by: Anton Johansson --- target/hexagon/macros.h | 13 +++++++++---- target/hexagon/hlx_helper.c | 31 ++++++++++++++++++++++--------- 2 files changed, 31 insertions(+), 13 deletions(-) diff --git a/target/hexagon/macros.h b/target/hexagon/macros.h index 2748e26d6c..5799016ea4 100644 --- a/target/hexagon/macros.h +++ b/target/hexagon/macros.h @@ -22,6 +22,7 @@ #include "hex_regs.h" #include "reg_fields.h" #include "accel/tcg/getpc.h" +#include "hlx_helper.h" =20 #define GET_FIELD(FIELD, REGIN) \ fEXTRACTU_BITS(REGIN, reg_field_info[FIELD].width, \ @@ -738,8 +739,10 @@ static inline TCGv gen_read_ireg(TCGv result, TCGv val= , int shift) EA, tcg_constant_i32(ABOVE), \ tcg_constant_i32(BELOW)) #else -#define fLOADMML(EA, DST, ABOVE, BELOW) \ - do { HELPER(hlx_load_vec)(env, &(DST), (EA), (ABOVE), (BELOW)); } whil= e (0) +#define fLOADMML(EA, DST, ABOVE, BELOW) \ + do { \ + hlx_load_vec_ra(env, &(DST), (EA), (ABOVE), (BELOW), GETPC()); \ + } while (0) #endif =20 /* The helper logs the store for packet commit. */ @@ -748,8 +751,10 @@ static inline TCGv gen_read_ireg(TCGv result, TCGv val= , int shift) gen_helper_hlx_store_vec(tcg_env, EA, tcg_constant_ptr((intptr_t)&(SRC= )), \ tcg_constant_i32(ABOVE), tcg_constant_i32(BEL= OW)) #else -#define fSTOREMML(EA, SRC, ABOVE, BELOW) \ - do { HELPER(hlx_store_vec)(env, (EA), &(SRC), (ABOVE), (BELOW)); } whi= le (0) +#define fSTOREMML(EA, SRC, ABOVE, BELOW) \ + do { \ + hlx_store_vec_ra(env, (EA), &(SRC), (ABOVE), (BELOW), GETPC()); \ + } while (0) #endif =20 /* Helpers receive .new registers in future_LRegs. */ diff --git a/target/hexagon/hlx_helper.c b/target/hexagon/hlx_helper.c index c063706cfa..bc638f6403 100644 --- a/target/hexagon/hlx_helper.c +++ b/target/hexagon/hlx_helper.c @@ -7,6 +7,7 @@ #include "cpu.h" #include "accel/tcg/cpu-ldst.h" #include "exec/helper-proto.h" +#include "hlx_helper.h" #include "hlx/hlx.h" #include "hw/hexagon/hexagon_hlx.h" #include "accel/tcg/probe.h" @@ -15,40 +16,52 @@ #define HLX_MEM_ALIGN_MASK (~(HLX_VEC_SIZE_BYTES - 1)) =20 /* Align down to 2KB. Above and below are unused in V85. */ -void HELPER(hlx_load_vec)(CPUHexagonState *env, void *dst_void, - target_ulong ea, uint32_t above, uint32_t below) +void hlx_load_vec_ra(CPUHexagonState *env, void *dst_void, + target_ulong ea, uint32_t above, uint32_t below, + uintptr_t ra) { HLXVector *dst =3D (HLXVector *)dst_void; target_ulong aligned_ea =3D ea & HLX_MEM_ALIGN_MASK; - uintptr_t raddr =3D GETPC(); int mmu_idx =3D cpu_mmu_index(env_cpu(env), false); =20 /* A 2KB-aligned access stays within one page. */ - void *host =3D probe_read(env, aligned_ea, HLX_VEC_SIZE_BYTES, mmu_idx, - raddr); + void *host =3D probe_read(env, aligned_ea, HLX_VEC_SIZE_BYTES, mmu_idx= , ra); =20 if (host) { memcpy(dst, host, HLX_VEC_SIZE_BYTES); } else { for (int i =3D 0; i < HLX_VEC_SIZE_BYTES; i +=3D 8) { - uint64_t val =3D cpu_ldq_le_data_ra(env, aligned_ea + i, raddr= ); + uint64_t val =3D cpu_ldq_le_data_ra(env, aligned_ea + i, ra); memcpy(&dst->ub[i], &val, 8); } } } =20 -void HELPER(hlx_store_vec)(CPUHexagonState *env, target_ulong ea, - void *src_void, uint32_t above, uint32_t below) +void hlx_store_vec_ra(CPUHexagonState *env, target_ulong ea, + void *src_void, uint32_t above, uint32_t below, + uintptr_t ra) { target_ulong aligned_ea =3D ea & HLX_MEM_ALIGN_MASK; int mmu_idx =3D cpu_mmu_index(env_cpu(env), false); =20 - probe_write(env, aligned_ea, HLX_VEC_SIZE_BYTES, mmu_idx, GETPC()); + probe_write(env, aligned_ea, HLX_VEC_SIZE_BYTES, mmu_idx, ra); memcpy(&env->hlx_store_data, src_void, sizeof(HLXVector)); env->hlx_store_va =3D aligned_ea; env->hlx_store_pending =3D true; } =20 +void HELPER(hlx_load_vec)(CPUHexagonState *env, void *dst_void, + target_ulong ea, uint32_t above, uint32_t below) +{ + hlx_load_vec_ra(env, dst_void, ea, above, below, GETPC()); +} + +void HELPER(hlx_store_vec)(CPUHexagonState *env, target_ulong ea, + void *src_void, uint32_t above, uint32_t below) +{ + hlx_store_vec_ra(env, ea, src_void, above, below, GETPC()); +} + void HELPER(hlx_commit_store)(CPUHexagonState *env) { target_ulong va =3D env->hlx_store_va; --=20 2.52.0 From nobody Mon Nov 23 04:28:03 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=reject dis=none) header.from=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1793733560; cv=none; d=zohomail.com; s=zohoarc; b=DSx/mislEPlRsqrfxFhIs+yb81v+mmd6uSwRR9LTP7NXKqw22d4lB2rjFBpVCWEHs1B7y7Y04mW3ZssmuLnljKEqGq6tkWGv5eEt8Kn7U1Aw3/S9Q9HK6cH7ow1FeTcHoQP2Q1jB9WYgldzXId9K+JPtn68Wjv3rKLTwi7FKt7E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793733560; h=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:Reply-To:Reply-To:Sender:Subject:Subject:To:To:Message-Id; bh=Bow50TkR9fiVY9dRn4UF7eX7CfGSp+upKpKcQ9vH5ro=; b=Gr045MhWBYEixYPuUwqbvj8qVaAFaeI7asIxvijUdIfu/4pdUFraKqjPt905VaKw/1DxdEMGIf8BYiXY2MwYkeedUT68xu05pljXB/pmu3uM2bpikVIjc9j0MKsMMUXxigdu8KO/azdR2zewcyphg+ODLHMejU0OKzWihVa7ar0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793733559737696.4677961864018; Tue, 3 Nov 2026 11:19:19 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xOK20-0000rF-1R; Tue, 03 Nov 2026 14:18:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xOK1s-0000q0-Qk for qemu-devel@nongnu.org; Tue, 03 Nov 2026 14:18:47 -0500 Received: from rev.ng ([94.130.142.21]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xOK1n-0007s5-QR for qemu-devel@nongnu.org; Tue, 03 Nov 2026 14:18:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=rev.ng; s=dkim; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive:List-Unsubscribe:List-Unsubscribe-Post: List-Help; bh=Bow50TkR9fiVY9dRn4UF7eX7CfGSp+upKpKcQ9vH5ro=; b=ll9av6CMUm3RkvI rbOmuicrcGztMwSnYqnubD04882FFKi9KInGazj1+YjAKf/5GkRQ1iTNEsRXFjH8ytGrbC1Y78+6y M5sY4B57kWOYFVDNTVjsUnFrzIQmwBEOj3XKK4GQjjK0ijlTZDCEOI6U4qC+AD7zc/rlz8noF+gXK S4=; To: qemu-devel@nongnu.org Cc: ale@rev.ng, brian.cain@oss.qualcomm.com, marco.liebel@oss.qualcomm.com, Anton Johansson Subject: [PATCH v1 4/6] linux-user/hexagon: Reset hlx_ctx pointer on cpu clone Date: Tue, 3 Nov 2026 20:23:56 +0100 Message-ID: <20261103192358.28589-5-anjo@rev.ng> In-Reply-To: <20261103192358.28589-1-anjo@rev.ng> References: <20261103192358.28589-1-anjo@rev.ng> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=lists1p.gnu.org; Received-SPF: pass client-ip=94.130.142.21; envelope-from=anjo@rev.ng; helo=rev.ng 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_PASS=-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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Anton Johansson From: Anton Johansson via qemu development Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1793733562414158500 Content-Type: text/plain; charset="utf-8" Currently hlx_ctx retains the pointer to the hlx_user_ctx of its parent. Another way to go is similar to hvx_ctx, which in user-mode, is just the struct itself rather than a pointer to the struct. Fixes: cf0bfbc338eaeef2b ("target/hexagon: manage HLX contexts through CCR") Signed-off-by: Anton Johansson Reviewed-by: Marco Liebel --- linux-user/hexagon/target_cpu.h | 1 + 1 file changed, 1 insertion(+) diff --git a/linux-user/hexagon/target_cpu.h b/linux-user/hexagon/target_cp= u.h index ecb76e9268..6c36b7166f 100644 --- a/linux-user/hexagon/target_cpu.h +++ b/linux-user/hexagon/target_cpu.h @@ -25,6 +25,7 @@ static inline void cpu_clone_regs_child(CPUHexagonState *= env, env->gpr[HEX_REG_SP] =3D newsp; } env->gpr[0] =3D 0; + env->hlx_ctx =3D &env->hlx_user_ctx; } =20 static inline void cpu_clone_regs_parent(CPUHexagonState *env, unsigned fl= ags) --=20 2.52.0 From nobody Mon Nov 23 04:28:03 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=reject dis=none) header.from=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1793733559; cv=none; d=zohomail.com; s=zohoarc; b=d6+XszxBT88+onbfJEZq0BNiqL0yNNJU/HbhpVhoi4CEAivIdh3T2NAG5KrlFFcmQRq6nVZtlfmOcQnwc04tagNZFjVtEf5YfhimwHm56x+c3IF5xjH1bvNZ35VIDVJtdbH/fyiFvlCa+lyHrC81fFySbIPF/zT36k6v5SlFRJk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793733559; h=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:Reply-To:Reply-To:Sender:Subject:Subject:To:To:Message-Id; bh=2EipKz/JNo111XyEo5AHTCN/HgZoeWBSHblkdvkWlmc=; b=aAvYSvXKou8rsVacglKJ4kASzkgyfB+UKH++EfbDSQhTdtlRdtzgMbTws2aVpXxty4dVTFQ9ALPOKRmW/2yGW3FhzjNhUk6GGjSGPFRErN36qWASl4et22RCjEE+KGP3smWbmQHs6ghcV58h6O78ioFzhyziAC6pRUX5UNp55Jc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793733559184902.9975826857166; Tue, 3 Nov 2026 11:19:19 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xOK29-0000sk-Fr; Tue, 03 Nov 2026 14:19:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xOK1u-0000qB-Er for qemu-devel@nongnu.org; Tue, 03 Nov 2026 14:18:47 -0500 Received: from rev.ng ([94.130.142.21]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xOK1r-0007sB-HB for qemu-devel@nongnu.org; Tue, 03 Nov 2026 14:18:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=rev.ng; s=dkim; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive:List-Unsubscribe:List-Unsubscribe-Post: List-Help; bh=2EipKz/JNo111XyEo5AHTCN/HgZoeWBSHblkdvkWlmc=; b=DKTdUQi4HFPFMHq fZwRIWYm4x3I0sOPqn4ktSxO6GgoYX1U4HclAClIU5a5opk2qsqxJLdigwB3tx5K+yb/Lz5a2U/JN vJcGt+V0UhUsXH7xrYSK4WWCca1BC8cPoQ+WfhsnYjxIApp/otwxgDfH9vK7/Gq80A9ehpyf9XCOp I0=; To: qemu-devel@nongnu.org Cc: ale@rev.ng, brian.cain@oss.qualcomm.com, marco.liebel@oss.qualcomm.com, Anton Johansson Subject: [PATCH v1 5/6] tests/tcg/hexagon: test HLX scalar :mem_noshuf ordering Date: Tue, 3 Nov 2026 20:23:57 +0100 Message-ID: <20261103192358.28589-6-anjo@rev.ng> In-Reply-To: <20261103192358.28589-1-anjo@rev.ng> References: <20261103192358.28589-1-anjo@rev.ng> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=lists1p.gnu.org; Received-SPF: pass client-ip=94.130.142.21; envelope-from=anjo@rev.ng; helo=rev.ng 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_PASS=-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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Anton Johansson From: Anton Johansson via qemu development Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1793733562418158500 Content-Type: text/plain; charset="utf-8" A packet containing HLX operations defer stores to the end of the packet, make sure this doesn't interfere with scalar :mem_noshuf ordering. Signed-off-by: Anton Johansson --- tests/tcg/hexagon/hlx_mem.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/tcg/hexagon/hlx_mem.c b/tests/tcg/hexagon/hlx_mem.c index 643b499fd9..f5af95115a 100644 --- a/tests/tcg/hexagon/hlx_mem.c +++ b/tests/tcg/hexagon/hlx_mem.c @@ -229,6 +229,25 @@ static void test_store_fault(void) check_h("LX_S16b_new (fault)", buf_out, expected, HLX_HALF_ELEMS); } =20 +static void test_preserve_scalar_noshuf(void) +{ + uint32_t ret =3D 0; + uint32_t ptr =3D 0; + uint32_t val =3D 0x1234; + asm volatile("{\n" + ".word 0xe5007822\n" + " memw(%1) =3D %2\n" + " %0 =3D memw(%1)\n" + "}:mem_noshuf\n" + : "=3Dr"(ret) + : "r"(&ptr), "r"(val) + : "memory"); + if (ret !=3D val) { + printf("FAIL broken scalar :mem_noshuf ordering\n"); + err++; + } +} + int main(void) { init_vtcm(); @@ -253,6 +272,9 @@ int main(void) /* Store in a faulting packet */ test_store_fault(); =20 + /* Make sure HLX packets preserve scalar :mem_noshuf ordering */ + test_preserve_scalar_noshuf(); + puts(err ? "FAIL" : "PASS"); return err; } --=20 2.52.0 From nobody Mon Nov 23 04:28:03 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=reject dis=none) header.from=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1793733588; cv=none; d=zohomail.com; s=zohoarc; b=klV025jHUnkBlhbvZKDGP7Z8ZbAhEJOresIp2VS7VR/nuGfY67MdQFMfRd/N0GrLx/EYhoIOvxE0Bm85gEZOd8sszfBObMQVULiuzOUCxhyiZYi/3QTNwdp2b1///uNyhh7JzswlASay/0ZOVEoETydhvpVbBBh7+oi3qH8HL44= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793733588; h=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:Reply-To:Reply-To:Sender:Subject:Subject:To:To:Message-Id; bh=iSHNehDKF49s99q1JRLz16Yw4BLYwolhxbKCl7pk7YA=; b=VPU7jYktIOk7+MXM417K0HV1Y6ra01LQRc4phUt/qYCgY8IPBl9yHq1RFIwVteR6eJRjXI5g8OWZSBk8Kn8KMzyza+BoSD6ibfBJmwFD7WpR7X7ddfBrJX6PoFRSppm0yNRKcKgzngvKrztWHwFVwCCaYLAcjppW0Du1GiUez3c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793733588601829.3016975799186; Tue, 3 Nov 2026 11:19:48 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xOK25-0000sC-EM; Tue, 03 Nov 2026 14:18:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xOK1u-0000qC-Ey for qemu-devel@nongnu.org; Tue, 03 Nov 2026 14:18:47 -0500 Received: from rev.ng ([94.130.142.21]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xOK1r-0007sE-Gx for qemu-devel@nongnu.org; Tue, 03 Nov 2026 14:18:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=rev.ng; s=dkim; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive:List-Unsubscribe:List-Unsubscribe-Post: List-Help; bh=iSHNehDKF49s99q1JRLz16Yw4BLYwolhxbKCl7pk7YA=; b=WJCoXLtuLmGWNsj Xk6ZI7B6kAztcp6VT0rQ4IY30FddHatMifYyc/Q36PC2Z76Cj57sZt2cJ1W45peJX6GlnvzknqgIr xLdH2jw3zd2NiY1dr9PhoDGWKWNuTC/Cb2Du9Zw4eLOqu8LJGtfuGnzeFTbkSCuvgMl8Wd0lGFYgJ ZY=; To: qemu-devel@nongnu.org Cc: ale@rev.ng, brian.cain@oss.qualcomm.com, marco.liebel@oss.qualcomm.com, Anton Johansson Subject: [PATCH v1 6/6] tests/tcg/hexagon: HLX, test .new on pair high register Date: Tue, 3 Nov 2026 20:23:58 +0100 Message-ID: <20261103192358.28589-7-anjo@rev.ng> In-Reply-To: <20261103192358.28589-1-anjo@rev.ng> References: <20261103192358.28589-1-anjo@rev.ng> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=lists1p.gnu.org; Received-SPF: pass client-ip=94.130.142.21; envelope-from=anjo@rev.ng; helo=rev.ng 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_PASS=-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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Anton Johansson From: Anton Johansson via qemu development Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1793733589899158500 Content-Type: text/plain; charset="utf-8" Makes sure a pair operation is recognized as a producer of a .new value when only the high part is accessed. Signed-off-by: Anton Johansson --- tests/tcg/hexagon/hlx_assign_conv.c | 35 +++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/tests/tcg/hexagon/hlx_assign_conv.c b/tests/tcg/hexagon/hlx_as= sign_conv.c index 8192882b8e..aef82dd63b 100644 --- a/tests/tcg/hexagon/hlx_assign_conv.c +++ b/tests/tcg/hexagon/hlx_assign_conv.c @@ -120,6 +120,40 @@ static void test_assign_rw(void) check_wp("LX_assign_rw", pw_out_lo, pw_out_hi, expected_w, HLX_HALF_EL= EMS); } =20 +static void test_combine_assign_hi(void) +{ + /* + * Tests that a combine operation acts as a producer of a .new value f= or + * the high vector in a pair. + */ + HLX_Vector l_lo; + HLX_Vector l_hi; + + fill_w(pw_a_lo, pw_a_hi, VAL_W); + + l_lo =3D Q6_L_tmp_mem_A(pw_a_lo); + l_hi =3D Q6_L_tmp_mem_A(pw_a_hi); + + hlx_put_v(0, l_lo); + hlx_put_v(2, l_hi); + /* + * { + * L7:6 =3D combine(L0, L1) + * memw(R7) =3D L7.new + * } + */ + asm volatile(HLX_PTRS HLX_LD0 HLX_LD2 + ".word 0xef24602d\n" + ".word 0xa487c007\n" + : : [stage] "r"(hlx_stage) : HLX_CLOBBERS); + Q6_mem_Ku16_new_AL(buf_a, hlx_get_v(7)); + + for (int j =3D 0; j < HLX_HALF_ELEMS; j++) { + expected[j] =3D VAL_A; + } + check_h("LX_assign_w (hi only)", buf_a, expected, HLX_HALF_ELEMS); +} + =20 static void test_combine_w(void) { @@ -336,6 +370,7 @@ int main(void) test_assign_s(); test_assign_u(); test_assign_rw(); + test_combine_assign_hi(); =20 /* Combine and mux */ test_combine_w(); --=20 2.52.0