[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 2/7] target/mips: Fix copy_s.<b|h|w> for MIPS big
From: |
Mateja Marjanovic |
Subject: |
[Qemu-devel] [PATCH v2 2/7] target/mips: Fix copy_s.<b|h|w> for MIPS big endian host |
Date: |
Mon, 25 Mar 2019 15:52:41 +0100 |
From: Mateja Marjanovic <address@hidden>
Signed element copy from MSA registers to GPR 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 <address@hidden>
---
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 421dced..012f373 100644
--- a/target/mips/msa_helper.c
+++ b/target/mips/msa_helper.c
@@ -1435,6 +1435,13 @@ void helper_msa_copy_s_df(CPUMIPSState *env, uint32_t
df, uint32_t rd,
uint32_t ws, uint32_t n)
{
n %= DF_ELEMENTS(df);
+#if defined(HOST_WORDS_BIGENDIAN)
+ if (n < DF_ELEMENTS(df) / 2) {
+ n = DF_ELEMENTS(df) / 2 - n - 1;
+ } else {
+ n = 3 * DF_ELEMENTS(df) / 2 - n - 1;
+ }
+#endif
switch (df) {
case DF_BYTE:
--
2.7.4
[Qemu-devel] [PATCH v2 3/7] target/mips: Fix copy_u.<b|h|w> for MIPS big endian host, Mateja Marjanovic, 2019/03/25
[Qemu-devel] [PATCH v2 6/7] target/mips: Eliminate unreachable case for MSA instructions insert, Mateja Marjanovic, 2019/03/25
[Qemu-devel] [PATCH v2 7/7] target/mips: Eliminate unreachable case for MSA instructions fill, Mateja Marjanovic, 2019/03/25
Re: [Qemu-devel] [PATCH v2 0/7] target/mips: Add support for MSA instructions on a big endian host, Aleksandar Markovic, 2019/03/25