Wrong implementation of SSE4.1 pmovzxbw and similar instructions

Bug #1245543 reported by Povilas Kanapickas
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
QEMU
Expired
Undecided
Unassigned

Bug Description

QEMU 1.5.0 (and git version, as far as I can tell from the source code) has incorrect implementation of pmovzxbw and similar SSE4.1 instructions. The instruction zero-extends the first 8 8-bit elements of a vector to 16bit vector and puts them to another vector. The current implementation applies this operation only to the first element and zeros out the rest.

To verify, compile the attached program for SSE4.1 (g++ -msse4.1 cvtint.cc). On real hardware, it produces the following output:

$ ./a.out
1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0

On QEMU, the output is as follows:

$ ./a.out
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

QEMU is invoked as:

qemu-system-x86_64 \
    -M pc -cpu Haswell,+sse4.1,+avx,+avx2,+fma,enforce -m 512 \
    -serial stdio -no-reboot \
    -kernel vmlinuz -initrd initrd.img \
    -netdev user,id=user.0 -device rtl8139,netdev=user.0 -redir tcp:2222::22 \
    -hda ubuntu-amd64.ext3 \
    --append "rw console=tty root=/dev/sda"

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

Looking through old bug tickets... is this still an issue with the latest version of QEMU? Or could we close this ticket nowadays?

Changed in qemu:
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for QEMU because there has been no activity for 60 days.]

Changed in qemu:
status: Incomplete → Expired
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.