qemu doesn't seem to support lxvwsx for POWER9 target

Bug #1793608 reported by Sergey Evlashev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
QEMU
Fix Released
Undecided
Unassigned

Bug Description

When running a simple program built for POWER9 on QEMU 3.0.0 in linux-user mode, it crashes with a message: "illegal instruction". It turns out that lxvwsx instruction "Load Word and Splat Indexed" is not supported. If workaround is implemented by issuing two separate instructions (first load then splat) then all tests pass correctly.

Operating system: Ubuntu Mate 16.04.2 64-bit (or Linux Mint 18 64-bit).
Cross-compiler for gcc-powerpc64le-linux-gnu is installed (gcc-5 series).
QEMU 3.0.0 is built from source and installed with: sudo make install

The program in question: https://github.com/VectorChief/UniSIMD-assembler
Turn off the workaround: RT_ELEM_COMPAT_PW9 should be set to 1 in the following file:
https://github.com/VectorChief/UniSIMD-assembler/blob/master/core/config/rtarch_p32_128x1v2.h

Change to the "test" directory and type "make -f simd_make_p64.mk".
powerpc64le-linux-gnu-objdump -d simd_test.p64_32Lp9 > simd_test_p64_32Lp9.txt
Open newly created text file simd_test_p64_32Lp9.txt and search for lxvwsx (in s_test01, ...)
The instruction shows up in objdump correctly.

Revision history for this message
Sergey Evlashev (vectorchiefrocks) wrote :

Small clarification to the bug description above.

Host architecture: x86_64 (AMD64)
Instructions used for building QEMU 3.0.0 from source are here:
https://github.com/VectorChief/UniSIMD-assembler/blob/master/INSTALL

The command line for emulating POWER9 target is below:
qemu-ppc64le -cpu POWER9 simd_test.p64_32Lp9 -c 1

With the workaround for lxvwsx instruction turned off (as described above)
QEMU crashes in s_test08 function of the following common SIMD test file:
https://github.com/VectorChief/UniSIMD-assembler/blob/master/test/simd_test.cpp

Revision history for this message
Thomas Huth (th-huth) wrote :

A patch has been posted here:
https://lists.gnu.org/archive/html/qemu-devel/2020-11/msg02218.html
("ppc/translate: Implement lxvwsx opcode")

Changed in qemu:
status: New → In Progress
Revision history for this message
Thomas Huth (th-huth) wrote :

Released with QEMU v5.2.0.

Changed in qemu:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.