From nobody Mon Feb 9 11:51:17 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1553525776392542.3703755313849; Mon, 25 Mar 2019 07:56:16 -0700 (PDT) Received: from localhost ([127.0.0.1]:43770 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h8R1C-00064l-1y for importer@patchew.org; Mon, 25 Mar 2019 10:56:06 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47935) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h8Qz9-0004qY-4i for qemu-devel@nongnu.org; Mon, 25 Mar 2019 10:54:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h8Qz8-0003uw-2O for qemu-devel@nongnu.org; Mon, 25 Mar 2019 10:53:59 -0400 Received: from mx2.rt-rk.com ([89.216.37.149]:47570 helo=mail.rt-rk.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h8Qz7-0003bf-Pc for qemu-devel@nongnu.org; Mon, 25 Mar 2019 10:53:58 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id 07C021A200A; Mon, 25 Mar 2019 15:52:55 +0100 (CET) Received: from rtrkw310-lin.domain.local (rtrkw310-lin.domain.local [10.10.13.97]) by mail.rt-rk.com (Postfix) with ESMTPSA id D8ADA1A2067; Mon, 25 Mar 2019 15:52:54 +0100 (CET) X-Virus-Scanned: amavisd-new at rt-rk.com From: Mateja Marjanovic To: qemu-devel@nongnu.org Date: Mon, 25 Mar 2019 15:52:43 +0100 Message-Id: <1553525566-14913-5-git-send-email-mateja.marjanovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1553525566-14913-1-git-send-email-mateja.marjanovic@rt-rk.com> References: <1553525566-14913-1-git-send-email-mateja.marjanovic@rt-rk.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 89.216.37.149 Subject: [Qemu-devel] [PATCH v2 4/7] target/mips: Fix insert. for MIPS big endian host X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: arikalo@wavecomp.com, amarkovic@wavecomp.com, aurelien@aurel32.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Mateja Marjanovic Inserting from GPR to an element in a MSA register when executed on a MIPS big endian CPU, didn't pick the right element, and was behaving like on little endian. Signed-off-by: Mateja Marjanovic --- target/mips/msa_helper.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/target/mips/msa_helper.c b/target/mips/msa_helper.c index 8caf186..ac5d41e 100644 --- a/target/mips/msa_helper.c +++ b/target/mips/msa_helper.c @@ -1500,6 +1500,13 @@ void helper_msa_insert_df(CPUMIPSState *env, uint32_= t df, uint32_t wd, { wr_t *pwd =3D &(env->active_fpu.fpr[wd].wr); target_ulong rs =3D env->active_tc.gpr[rs_num]; +#if defined(HOST_WORDS_BIGENDIAN) + if (n < DF_ELEMENTS(df) / 2) { + n =3D DF_ELEMENTS(df) / 2 - n - 1; + } else { + n =3D 3 * DF_ELEMENTS(df) / 2 - n - 1; + } +#endif =20 switch (df) { case DF_BYTE: --=20 2.7.4