Message ID | 1553525566-14913-3-git-send-email-mateja.marjanovic@rt-rk.com |
---|---|
State | New |
Headers | show |
Series | target/mips: Add support for MSA instructions on a big endian host | expand |
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: