From patchwork Thu Jun 20 13:45:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksandar Markovic X-Patchwork-Id: 11006723 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4775C112C for ; Thu, 20 Jun 2019 14:03:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 17706287C9 for ; Thu, 20 Jun 2019 14:03:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0B6FA28767; Thu, 20 Jun 2019 14:03:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A5743287CD for ; Thu, 20 Jun 2019 14:03:40 +0000 (UTC) Received: from localhost ([::1]:47966 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdxf9-0002SJ-UM for patchwork-qemu-devel@patchwork.kernel.org; Thu, 20 Jun 2019 10:03:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52668) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdxOM-0004XN-LR for qemu-devel@nongnu.org; Thu, 20 Jun 2019 09:46:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hdxOH-0003Uy-Ij for qemu-devel@nongnu.org; Thu, 20 Jun 2019 09:46:17 -0400 Received: from mx2.rt-rk.com ([89.216.37.149]:36050 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 1hdxOB-0003Mq-MJ for qemu-devel@nongnu.org; Thu, 20 Jun 2019 09:46:09 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id D96A81A46D5; Thu, 20 Jun 2019 15:45:55 +0200 (CEST) X-Virus-Scanned: amavisd-new at rt-rk.com Received: from rtrkw774-lin.domain.local (rtrkw774-lin.domain.local [10.10.13.43]) by mail.rt-rk.com (Postfix) with ESMTPSA id BC7941A4643; Thu, 20 Jun 2019 15:45:55 +0200 (CEST) From: Aleksandar Markovic To: qemu-devel@nongnu.org Date: Thu, 20 Jun 2019 15:45:46 +0200 Message-Id: <1561038349-17105-2-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561038349-17105-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1561038349-17105-1-git-send-email-aleksandar.markovic@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 1/4] target/mips: Fix emulation of ILVEV. on big endian host X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: arikalo@wavecomp.com, amarkovic@wavecomp.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Aleksandar Markovic Fix emulation of ILVEV. on big endian host by applying mapping of data element indexes from one endian to another. Signed-off-by: Aleksandar Markovic Reviewed-by: Aleksandar Rikalo --- target/mips/msa_helper.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/target/mips/msa_helper.c b/target/mips/msa_helper.c index be059a3..215d8af 100644 --- a/target/mips/msa_helper.c +++ b/target/mips/msa_helper.c @@ -1737,6 +1737,24 @@ void helper_msa_ilvev_df(CPUMIPSState *env, uint32_t df, uint32_t wd, switch (df) { case DF_BYTE: +#if defined(TARGET_WORDS_BIGENDIAN) + pwd->b[8] = pws->b[9]; + pwd->b[9] = pwt->b[9]; + pwd->b[10] = pws->b[11]; + pwd->b[11] = pwt->b[11]; + pwd->b[12] = pws->b[13]; + pwd->b[13] = pwt->b[13]; + pwd->b[14] = pws->b[15]; + pwd->b[15] = pwt->b[15]; + pwd->b[0] = pws->b[1]; + pwd->b[1] = pwt->b[1]; + pwd->b[2] = pws->b[3]; + pwd->b[3] = pwt->b[3]; + pwd->b[4] = pws->b[5]; + pwd->b[5] = pwt->b[5]; + pwd->b[6] = pws->b[7]; + pwd->b[7] = pwt->b[7]; +#else pwd->b[15] = pws->b[14]; pwd->b[14] = pwt->b[14]; pwd->b[13] = pws->b[12]; @@ -1753,8 +1771,19 @@ void helper_msa_ilvev_df(CPUMIPSState *env, uint32_t df, uint32_t wd, pwd->b[2] = pwt->b[2]; pwd->b[1] = pws->b[0]; pwd->b[0] = pwt->b[0]; +#endif break; case DF_HALF: +#if defined(TARGET_WORDS_BIGENDIAN) + pwd->h[4] = pws->h[5]; + pwd->h[5] = pwt->h[5]; + pwd->h[6] = pws->h[7]; + pwd->h[7] = pwt->h[7]; + pwd->h[0] = pws->h[1]; + pwd->h[1] = pwt->h[1]; + pwd->h[2] = pws->h[3]; + pwd->h[3] = pwt->h[3]; +#else pwd->h[7] = pws->h[6]; pwd->h[6] = pwt->h[6]; pwd->h[5] = pws->h[4]; @@ -1763,12 +1792,20 @@ void helper_msa_ilvev_df(CPUMIPSState *env, uint32_t df, uint32_t wd, pwd->h[2] = pwt->h[2]; pwd->h[1] = pws->h[0]; pwd->h[0] = pwt->h[0]; +#endif break; case DF_WORD: +#if defined(TARGET_WORDS_BIGENDIAN) + pwd->w[2] = pws->w[3]; + pwd->w[3] = pwt->w[3]; + pwd->w[0] = pws->w[1]; + pwd->w[1] = pwt->w[1]; +#else pwd->w[3] = pws->w[2]; pwd->w[2] = pwt->w[2]; pwd->w[1] = pws->w[0]; pwd->w[0] = pwt->w[0]; +#endif break; case DF_DOUBLE: pwd->d[1] = pws->d[0];