qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] tcg: ppc64: Fix mask generation for vextractdm
@ 2023-05-04  9:35 Shivaprasad G Bhat
  2023-05-04  9:35 ` [PATCH v2 1/2] " Shivaprasad G Bhat
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Shivaprasad G Bhat @ 2023-05-04  9:35 UTC (permalink / raw)
  To: philmd, richard.henderson, danielhb413, lucas.araujo, qemu-ppc,
	clg, david, groug, qemu-ppc
  Cc: john_platts, sbhat, qemu-devel

While debugging gitlab issue[1] 1536, I happen to try the
vextract[X]m instructions on the real hardware. The test
used in [1] is failing for vextractdm.

On debugging it is seen, in function do_extractm() the
mask is calculated as dup_const(1 << (element_width - 1)).
'1' being signed int works fine for MO_8,16,32. For MO_64,
on PPC64 host this ends up becoming 0 on compilation. The
vextractdm uses MO_64, and it ends up having mask as 0.

The first patch here fixes that by explicitly using
1ULL instead of signed int 1 like its used everywhere else.
Second patch introduces the test case from [1] into qemu
tcg/ppc64 along with fixes/tweaks to make it work for both
big and little-endian targets.

References:
[1] : https://gitlab.com/qemu-project/qemu/-/issues/1536

---
Changelog:
Since v1 : https://lists.gnu.org/archive/html/qemu-devel/2023-04/msg01958.html
 - Added "Resolves: " to first patch description
 - Rebased to top of the tree. I see with d044b7c33a5, Alex has limited the
   scope of plugin tests to just the MULTIARCH_TESTS. So, removed the plugin
   tests for the test case added in the second patch.
 - Changed the test case to use the HOST_BIG_ENDIAN from compiler.h

Shivaprasad G Bhat (2):
      tcg: ppc64: Fix mask generation for vextractdm
      tests: tcg: ppc64: Add tests for Vector Extract Mask Instructions


 target/ppc/translate/vmx-impl.c.inc |  2 +-
 tests/tcg/ppc64/Makefile.target     |  6 +++-
 tests/tcg/ppc64/vector.c            | 51 +++++++++++++++++++++++++++++
 3 files changed, 57 insertions(+), 2 deletions(-)
 create mode 100644 tests/tcg/ppc64/vector.c

--
Signature



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

end of thread, other threads:[~2023-05-04 11:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-04  9:35 [PATCH v2 0/2] tcg: ppc64: Fix mask generation for vextractdm Shivaprasad G Bhat
2023-05-04  9:35 ` [PATCH v2 1/2] " Shivaprasad G Bhat
2023-05-04  6:20   ` Cédric Le Goater
2023-05-04  9:36 ` [PATCH v2 2/2] tests: tcg: ppc64: Add tests for Vector Extract Mask Instructions Shivaprasad G Bhat
2023-05-04  6:22   ` Cédric Le Goater
2023-05-04 11:06 ` [PATCH v2 0/2] tcg: ppc64: Fix mask generation for vextractdm Daniel Henrique Barboza

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).