Skip to contentSkip to conversation

target/ppc: fix xxspltw for big endian hosts

PATCH In review [email protected] 3 participants 3 messages Mar 10, 2022 – Mar 14, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target/ppc: fix xxspltw for big endian hosts

From: Matheus Ferst <[email protected]>

Fix a typo in the host endianness macro and add a simple test to detect regressions.

Fixes 9bb0048ec6f8 ("target/ppc: convert xxspltw to vector operations")
---
 target/ppc/translate/vsx-impl.c.inc |  2 +-
 tests/tcg/ppc64/Makefile.target     |  1 +
 tests/tcg/ppc64le/Makefile.target   |  1 +
 tests/tcg/ppc64le/xxspltw.c         | 46 +++++++++++++++++++++++++++++
 4 files changed, 49 insertions(+), 1 deletion(-)
 create mode 100644 tests/tcg/ppc64le/xxspltw.c
target/ppc/translate/vsx-impl.c.inc +1 -1
index 48a97b2d7e..e67fbf2bb8 100644
@@ -1552,7 +1552,7 @@ static bool trans_XXSPLTW(DisasContext *ctx, arg_XX2_uim2 *a)
     tofs = vsr_full_offset(a->xt);
     bofs = vsr_full_offset(a->xb);
     bofs += a->uim << MO_32;
-#ifndef HOST_WORDS_BIG_ENDIAN
+#ifndef HOST_WORDS_BIGENDIAN
     bofs ^= 8 | 4;
 #endif
 
tests/tcg/ppc64/Makefile.target +1 -0
index c9498053df..8197c288a7 100644
@@ -27,5 +27,6 @@ run-sha512-vector: QEMU_OPTS+=-cpu POWER10
 run-plugin-sha512-vector-with-%: QEMU_OPTS+=-cpu POWER10
 
 PPC64_TESTS += signal_save_restore_xer
+PPC64_TESTS += xxspltw
 
 TESTS += $(PPC64_TESTS)
tests/tcg/ppc64le/Makefile.target +1 -0
index 12d85e946b..9624bb1e9c 100644
@@ -25,5 +25,6 @@ run-plugin-sha512-vector-with-%: QEMU_OPTS+=-cpu POWER10
 
 PPC64LE_TESTS += mtfsf
 PPC64LE_TESTS += signal_save_restore_xer
+PPC64LE_TESTS += xxspltw
 
 TESTS += $(PPC64LE_TESTS)
tests/tcg/ppc64le/xxspltw.c new file +46 -0

46 lines not on this page · raw message

Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · On 3/10/22 09:20, [email protected] wrote:

From: Matheus Ferst<[email protected]>

Fix a typo in the host endianness macro and add a simple test to detect regressions.

Fixes 9bb0048ec6f8 ("target/ppc: convert xxspltw to vector operations")
Quoted 7 lines
---
  target/ppc/translate/vsx-impl.c.inc |  2 +-
  tests/tcg/ppc64/Makefile.target     |  1 +
  tests/tcg/ppc64le/Makefile.target   |  1 +
  tests/tcg/ppc64le/xxspltw.c         | 46 +++++++++++++++++++++++++++++
  4 files changed, 49 insertions(+), 1 deletion(-)

create mode 100644 tests/tcg/ppc64le/xxspltw.c

r~

#2 lore raw
In reply to [email protected]
Quoted 7 lines · On 3/10/22 18:20, [email protected] wrote:

From: Matheus Ferst <[email protected]>

Fix a typo in the host endianness macro and add a simple test to detect regressions.

Fixes 9bb0048ec6f8 ("target/ppc: convert xxspltw to vector operations")
Quoted 8 lines
---
  target/ppc/translate/vsx-impl.c.inc |  2 +-
  tests/tcg/ppc64/Makefile.target     |  1 +
  tests/tcg/ppc64le/Makefile.target   |  1 +
  tests/tcg/ppc64le/xxspltw.c         | 46 +++++++++++++++++++++++++++++
  4 files changed, 49 insertions(+), 1 deletion(-)

create mode 100644 tests/tcg/ppc64le/xxspltw.c

Queued for 7.0

Thanks,

C.