qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/4] target/mips: Fix some issues of MSA emulation on big endian hosts
@ 2019-06-20  8:57 Aleksandar Markovic
  2019-06-20  8:57 ` [Qemu-devel] [PATCH 1/4] target/mips: Fix emulation of ILVEV.<B|H|W> on big endian host Aleksandar Markovic
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Aleksandar Markovic @ 2019-06-20  8:57 UTC (permalink / raw)
  To: qemu-devel; +Cc: arikalo, amarkovic

From: Aleksandar Markovic <amarkovic@wavecomp.com>

Fix some issues of MSA emulation on big endian hosts.

Aleksandar Markovic (4):
  target/mips: Fix emulation of ILVEV.<B|H|W> on big endian host
  target/mips: Fix emulation of ILVOD.<B|H|W> on big endian host
  target/mips: Fix emulation of ILVL.<B|H|W> on big endian host
  target/mips: Fix emulation of ILVR.<B|H|W> on big endian host

 target/mips/msa_helper.c | 148 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 148 insertions(+)

-- 
2.7.4



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Qemu-devel] [PATCH 1/4] target/mips: Fix emulation of ILVEV.<B|H|W> on big endian host
  2019-06-20  8:57 [Qemu-devel] [PATCH 0/4] target/mips: Fix some issues of MSA emulation on big endian hosts Aleksandar Markovic
@ 2019-06-20  8:57 ` Aleksandar Markovic
  2019-06-20  8:58 ` [Qemu-devel] [PATCH 2/4] target/mips: Fix emulation of ILVOD.<B|H|W> " Aleksandar Markovic
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Aleksandar Markovic @ 2019-06-20  8:57 UTC (permalink / raw)
  To: qemu-devel; +Cc: arikalo, amarkovic

From: Aleksandar Markovic <amarkovic@wavecomp.com>

Fix emulation of ILVEV.<B|H|W> on big endian host by applying
mapping of data element indexes from one endian to another.

Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
---
 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];
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Qemu-devel] [PATCH 2/4] target/mips: Fix emulation of ILVOD.<B|H|W> on big endian host
  2019-06-20  8:57 [Qemu-devel] [PATCH 0/4] target/mips: Fix some issues of MSA emulation on big endian hosts Aleksandar Markovic
  2019-06-20  8:57 ` [Qemu-devel] [PATCH 1/4] target/mips: Fix emulation of ILVEV.<B|H|W> on big endian host Aleksandar Markovic
@ 2019-06-20  8:58 ` Aleksandar Markovic
  2019-06-20  8:58 ` [Qemu-devel] [PATCH 3/4] target/mips: Fix emulation of ILVL.<B|H|W> " Aleksandar Markovic
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Aleksandar Markovic @ 2019-06-20  8:58 UTC (permalink / raw)
  To: qemu-devel; +Cc: arikalo, amarkovic

From: Aleksandar Markovic <amarkovic@wavecomp.com>

Fix emulation of ILVOD.<B|H|W> on big endian host by applying
mapping of data element indexes from one endian to another.

Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
---
 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 215d8af..9f411c1 100644
--- a/target/mips/msa_helper.c
+++ b/target/mips/msa_helper.c
@@ -1825,6 +1825,24 @@ void helper_msa_ilvod_df(CPUMIPSState *env, uint32_t df, uint32_t wd,
 
     switch (df) {
     case DF_BYTE:
+#if defined(TARGET_WORDS_BIGENDIAN)
+        pwd->b[7]  = pwt->b[6];
+        pwd->b[6]  = pws->b[6];
+        pwd->b[5]  = pwt->b[4];
+        pwd->b[4]  = pws->b[4];
+        pwd->b[3]  = pwt->b[2];
+        pwd->b[2]  = pws->b[2];
+        pwd->b[1]  = pwt->b[0];
+        pwd->b[0]  = pws->b[0];
+        pwd->b[15] = pwt->b[14];
+        pwd->b[14] = pws->b[14];
+        pwd->b[13] = pwt->b[12];
+        pwd->b[12] = pws->b[12];
+        pwd->b[11] = pwt->b[10];
+        pwd->b[10] = pws->b[10];
+        pwd->b[9]  = pwt->b[8];
+        pwd->b[8]  = pws->b[8];
+#else
         pwd->b[0]  = pwt->b[1];
         pwd->b[1]  = pws->b[1];
         pwd->b[2]  = pwt->b[3];
@@ -1841,8 +1859,19 @@ void helper_msa_ilvod_df(CPUMIPSState *env, uint32_t df, uint32_t wd,
         pwd->b[13] = pws->b[13];
         pwd->b[14] = pwt->b[15];
         pwd->b[15] = pws->b[15];
+#endif
         break;
     case DF_HALF:
+#if defined(TARGET_WORDS_BIGENDIAN)
+        pwd->h[3] = pwt->h[2];
+        pwd->h[2] = pws->h[2];
+        pwd->h[1] = pwt->h[0];
+        pwd->h[0] = pws->h[0];
+        pwd->h[7] = pwt->h[6];
+        pwd->h[6] = pws->h[6];
+        pwd->h[5] = pwt->h[4];
+        pwd->h[4] = pws->h[4];
+#else
         pwd->h[0] = pwt->h[1];
         pwd->h[1] = pws->h[1];
         pwd->h[2] = pwt->h[3];
@@ -1851,12 +1880,20 @@ void helper_msa_ilvod_df(CPUMIPSState *env, uint32_t df, uint32_t wd,
         pwd->h[5] = pws->h[5];
         pwd->h[6] = pwt->h[7];
         pwd->h[7] = pws->h[7];
+#endif
         break;
     case DF_WORD:
+#if defined(TARGET_WORDS_BIGENDIAN)
+        pwd->w[1] = pwt->w[0];
+        pwd->w[0] = pws->w[0];
+        pwd->w[3] = pwt->w[2];
+        pwd->w[2] = pws->w[2];
+#else
         pwd->w[0] = pwt->w[1];
         pwd->w[1] = pws->w[1];
         pwd->w[2] = pwt->w[3];
         pwd->w[3] = pws->w[3];
+#endif
         break;
     case DF_DOUBLE:
         pwd->d[0] = pwt->d[1];
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Qemu-devel] [PATCH 3/4] target/mips: Fix emulation of ILVL.<B|H|W> on big endian host
  2019-06-20  8:57 [Qemu-devel] [PATCH 0/4] target/mips: Fix some issues of MSA emulation on big endian hosts Aleksandar Markovic
  2019-06-20  8:57 ` [Qemu-devel] [PATCH 1/4] target/mips: Fix emulation of ILVEV.<B|H|W> on big endian host Aleksandar Markovic
  2019-06-20  8:58 ` [Qemu-devel] [PATCH 2/4] target/mips: Fix emulation of ILVOD.<B|H|W> " Aleksandar Markovic
@ 2019-06-20  8:58 ` Aleksandar Markovic
  2019-06-20  8:58 ` [Qemu-devel] [PATCH 4/4] target/mips: Fix emulation of ILVR.<B|H|W> " Aleksandar Markovic
  2019-06-20 10:25 ` [Qemu-devel] [PATCH 0/4] target/mips: Fix some issues of MSA emulation on big endian hosts Aleksandar Rikalo
  4 siblings, 0 replies; 6+ messages in thread
From: Aleksandar Markovic @ 2019-06-20  8:58 UTC (permalink / raw)
  To: qemu-devel; +Cc: arikalo, amarkovic

From: Aleksandar Markovic <amarkovic@wavecomp.com>

Fix emulation of ILVL.<B|H|W> on big endian host by applying
mapping of data element indexes from one endian to another.

Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
---
 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 9f411c1..458c840 100644
--- a/target/mips/msa_helper.c
+++ b/target/mips/msa_helper.c
@@ -1913,6 +1913,24 @@ void helper_msa_ilvl_df(CPUMIPSState *env, uint32_t df, uint32_t wd,
 
     switch (df) {
     case DF_BYTE:
+#if defined(TARGET_WORDS_BIGENDIAN)
+        pwd->b[7]  = pwt->b[15];
+        pwd->b[6]  = pws->b[15];
+        pwd->b[5]  = pwt->b[14];
+        pwd->b[4]  = pws->b[14];
+        pwd->b[3]  = pwt->b[13];
+        pwd->b[2]  = pws->b[13];
+        pwd->b[1]  = pwt->b[12];
+        pwd->b[0]  = pws->b[12];
+        pwd->b[15] = pwt->b[11];
+        pwd->b[14] = pws->b[11];
+        pwd->b[13] = pwt->b[10];
+        pwd->b[12] = pws->b[10];
+        pwd->b[11] = pwt->b[9];
+        pwd->b[10] = pws->b[9];
+        pwd->b[9]  = pwt->b[8];
+        pwd->b[8]  = pws->b[8];
+#else
         pwd->b[0]  = pwt->b[8];
         pwd->b[1]  = pws->b[8];
         pwd->b[2]  = pwt->b[9];
@@ -1929,8 +1947,19 @@ void helper_msa_ilvl_df(CPUMIPSState *env, uint32_t df, uint32_t wd,
         pwd->b[13] = pws->b[14];
         pwd->b[14] = pwt->b[15];
         pwd->b[15] = pws->b[15];
+#endif
         break;
     case DF_HALF:
+#if defined(TARGET_WORDS_BIGENDIAN)
+        pwd->h[3] = pwt->h[7];
+        pwd->h[2] = pws->h[7];
+        pwd->h[1] = pwt->h[6];
+        pwd->h[0] = pws->h[6];
+        pwd->h[7] = pwt->h[5];
+        pwd->h[6] = pws->h[5];
+        pwd->h[5] = pwt->h[4];
+        pwd->h[4] = pws->h[4];
+#else
         pwd->h[0] = pwt->h[4];
         pwd->h[1] = pws->h[4];
         pwd->h[2] = pwt->h[5];
@@ -1939,12 +1968,20 @@ void helper_msa_ilvl_df(CPUMIPSState *env, uint32_t df, uint32_t wd,
         pwd->h[5] = pws->h[6];
         pwd->h[6] = pwt->h[7];
         pwd->h[7] = pws->h[7];
+#endif
         break;
     case DF_WORD:
+#if defined(TARGET_WORDS_BIGENDIAN)
+        pwd->w[1] = pwt->w[3];
+        pwd->w[0] = pws->w[3];
+        pwd->w[3] = pwt->w[2];
+        pwd->w[2] = pws->w[2];
+#else
         pwd->w[0] = pwt->w[2];
         pwd->w[1] = pws->w[2];
         pwd->w[2] = pwt->w[3];
         pwd->w[3] = pws->w[3];
+#endif
         break;
     case DF_DOUBLE:
         pwd->d[0] = pwt->d[1];
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Qemu-devel] [PATCH 4/4] target/mips: Fix emulation of ILVR.<B|H|W> on big endian host
  2019-06-20  8:57 [Qemu-devel] [PATCH 0/4] target/mips: Fix some issues of MSA emulation on big endian hosts Aleksandar Markovic
                   ` (2 preceding siblings ...)
  2019-06-20  8:58 ` [Qemu-devel] [PATCH 3/4] target/mips: Fix emulation of ILVL.<B|H|W> " Aleksandar Markovic
@ 2019-06-20  8:58 ` Aleksandar Markovic
  2019-06-20 10:25 ` [Qemu-devel] [PATCH 0/4] target/mips: Fix some issues of MSA emulation on big endian hosts Aleksandar Rikalo
  4 siblings, 0 replies; 6+ messages in thread
From: Aleksandar Markovic @ 2019-06-20  8:58 UTC (permalink / raw)
  To: qemu-devel; +Cc: arikalo, amarkovic

From: Aleksandar Markovic <amarkovic@wavecomp.com>

Fix emulation of ILVR.<B|H|W> on big endian host by applying
mapping of data element indexes from one endian to another.

Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
---
 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 458c840..7a9bfb3 100644
--- a/target/mips/msa_helper.c
+++ b/target/mips/msa_helper.c
@@ -2001,6 +2001,24 @@ void helper_msa_ilvr_df(CPUMIPSState *env, uint32_t df, uint32_t wd,
 
     switch (df) {
     case DF_BYTE:
+#if defined(TARGET_WORDS_BIGENDIAN)
+        pwd->b[8]  = pws->b[0];
+        pwd->b[9]  = pwt->b[0];
+        pwd->b[10] = pws->b[1];
+        pwd->b[11] = pwt->b[1];
+        pwd->b[12] = pws->b[2];
+        pwd->b[13] = pwt->b[2];
+        pwd->b[14] = pws->b[3];
+        pwd->b[15] = pwt->b[3];
+        pwd->b[0]  = pws->b[4];
+        pwd->b[1]  = pwt->b[4];
+        pwd->b[2]  = pws->b[5];
+        pwd->b[3]  = pwt->b[5];
+        pwd->b[4]  = pws->b[6];
+        pwd->b[5]  = pwt->b[6];
+        pwd->b[6]  = pws->b[7];
+        pwd->b[7]  = pwt->b[7];
+#else
         pwd->b[15] = pws->b[7];
         pwd->b[14] = pwt->b[7];
         pwd->b[13] = pws->b[6];
@@ -2017,8 +2035,19 @@ void helper_msa_ilvr_df(CPUMIPSState *env, uint32_t df, uint32_t wd,
         pwd->b[2]  = pwt->b[1];
         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[0];
+        pwd->h[5] = pwt->h[0];
+        pwd->h[6] = pws->h[1];
+        pwd->h[7] = pwt->h[1];
+        pwd->h[0] = pws->h[2];
+        pwd->h[1] = pwt->h[2];
+        pwd->h[2] = pws->h[3];
+        pwd->h[3] = pwt->h[3];
+#else
         pwd->h[7] = pws->h[3];
         pwd->h[6] = pwt->h[3];
         pwd->h[5] = pws->h[2];
@@ -2027,12 +2056,20 @@ void helper_msa_ilvr_df(CPUMIPSState *env, uint32_t df, uint32_t wd,
         pwd->h[2] = pwt->h[1];
         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[0];
+        pwd->w[3] = pwt->w[0];
+        pwd->w[0] = pws->w[1];
+        pwd->w[1] = pwt->w[1];
+#else
         pwd->w[3] = pws->w[1];
         pwd->w[2] = pwt->w[1];
         pwd->w[1] = pws->w[0];
         pwd->w[0] = pwt->w[0];
+#endif
         break;
     case DF_DOUBLE:
         pwd->d[1] = pws->d[0];
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH 0/4] target/mips: Fix some issues of MSA emulation on big endian hosts
  2019-06-20  8:57 [Qemu-devel] [PATCH 0/4] target/mips: Fix some issues of MSA emulation on big endian hosts Aleksandar Markovic
                   ` (3 preceding siblings ...)
  2019-06-20  8:58 ` [Qemu-devel] [PATCH 4/4] target/mips: Fix emulation of ILVR.<B|H|W> " Aleksandar Markovic
@ 2019-06-20 10:25 ` Aleksandar Rikalo
  4 siblings, 0 replies; 6+ messages in thread
From: Aleksandar Rikalo @ 2019-06-20 10:25 UTC (permalink / raw)
  To: Aleksandar Markovic, qemu-devel; +Cc: Aleksandar Markovic

> From: Aleksandar Markovic <aleksandar.markovic@rt-rk.com>
> Sent: Thursday, June 20, 2019 10:57 AM
> To: qemu-devel@nongnu.org
> Cc: Aleksandar Markovic; Aleksandar Rikalo
> Subject: [PATCH 0/4] target/mips: Fix some issues of MSA emulation on big endian hosts
>
> From: Aleksandar Markovic <amarkovic@wavecomp.com>
>
> Fix some issues of MSA emulation on big endian hosts.
>
> Aleksandar Markovic (4):
>   target/mips: Fix emulation of ILVEV.<B|H|W> on big endian host
>   target/mips: Fix emulation of ILVOD.<B|H|W> on big endian host
>   target/mips: Fix emulation of ILVL.<B|H|W> on big endian host
>   target/mips: Fix emulation of ILVR.<B|H|W> on big endian host
>
>  target/mips/msa_helper.c | 148 +++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 148 insertions(+)
>
> --
> 2.7.4

For the whole series.
Reviewed-by: Aleksandar Rikalo <arikalo@wavecomp.com>


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-06-20 10:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-20  8:57 [Qemu-devel] [PATCH 0/4] target/mips: Fix some issues of MSA emulation on big endian hosts Aleksandar Markovic
2019-06-20  8:57 ` [Qemu-devel] [PATCH 1/4] target/mips: Fix emulation of ILVEV.<B|H|W> on big endian host Aleksandar Markovic
2019-06-20  8:58 ` [Qemu-devel] [PATCH 2/4] target/mips: Fix emulation of ILVOD.<B|H|W> " Aleksandar Markovic
2019-06-20  8:58 ` [Qemu-devel] [PATCH 3/4] target/mips: Fix emulation of ILVL.<B|H|W> " Aleksandar Markovic
2019-06-20  8:58 ` [Qemu-devel] [PATCH 4/4] target/mips: Fix emulation of ILVR.<B|H|W> " Aleksandar Markovic
2019-06-20 10:25 ` [Qemu-devel] [PATCH 0/4] target/mips: Fix some issues of MSA emulation on big endian hosts Aleksandar Rikalo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).