]> git.proxmox.com Git - mirror_qemu.git/commit
target/i386: fix pmovsx/pmovzx in-place operations
authorJoseph Myers <joseph@codesourcery.com>
Tue, 8 Aug 2017 20:21:01 +0000 (20:21 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 19 Sep 2017 12:09:10 +0000 (14:09 +0200)
commitc6a56c8e990b213a1638af2d34352771d5fa4d9c
tree0ed40fe117bff541286343fb2f96097e8fdb866c
parent11e06ce1ed28fd0ffcbc1e2436b72f3412b4ecc8
target/i386: fix pmovsx/pmovzx in-place operations

The SSE4.1 pmovsx* and pmovzx* instructions take packed 1-byte, 2-byte
or 4-byte inputs and sign-extend or zero-extend them to a wider vector
output.  The associated helpers for these instructions do the
extension on each element in turn, starting with the lowest.  If the
input and output are the same register, this means that all the input
elements after the first have been overwritten before they are read.
This patch makes the helpers extend starting with the highest element,
not the lowest, to avoid such overwriting.  This fixes many GCC test
failures (161 in the gcc testsuite in my GCC 6-based testing) when
testing with a default CPU setting enabling those instructions.

Signed-off-by: Joseph Myers <joseph@codesourcery.com>
Message-Id: <alpine.DEB.2.20.1708082018390.23380@digraph.polyomino.org.uk>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
target/i386/ops_sse.h