[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 01/50] target/i386: fix pmovsx/pmovzx in-place operat
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 01/50] target/i386: fix pmovsx/pmovzx in-place operations |
Date: |
Tue, 19 Sep 2017 14:28:50 +0200 |
From: Joseph Myers <address@hidden>
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 <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
target/i386/ops_sse.h | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/target/i386/ops_sse.h b/target/i386/ops_sse.h
index 16509d0..d578216 100644
--- a/target/i386/ops_sse.h
+++ b/target/i386/ops_sse.h
@@ -1617,18 +1617,18 @@ void glue(helper_ptest, SUFFIX)(CPUX86State *env, Reg
*d, Reg *s)
#define SSE_HELPER_F(name, elem, num, F) \
void glue(name, SUFFIX)(CPUX86State *env, Reg *d, Reg *s) \
{ \
- d->elem(0) = F(0); \
- d->elem(1) = F(1); \
if (num > 2) { \
- d->elem(2) = F(2); \
- d->elem(3) = F(3); \
if (num > 4) { \
- d->elem(4) = F(4); \
- d->elem(5) = F(5); \
- d->elem(6) = F(6); \
d->elem(7) = F(7); \
+ d->elem(6) = F(6); \
+ d->elem(5) = F(5); \
+ d->elem(4) = F(4); \
} \
+ d->elem(3) = F(3); \
+ d->elem(2) = F(2); \
} \
+ d->elem(1) = F(1); \
+ d->elem(0) = F(0); \
}
SSE_HELPER_F(helper_pmovsxbw, W, 8, (int8_t) s->B)
--
1.8.3.1
- [Qemu-devel] [PULL 00/50] Misc patches for 2017-09-19, Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 02/50] target/i386: set rip_offset for further SSE instructions, Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 05/50] target/i386: fix phminposuw in-place operation, Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 04/50] target/i386: fix pcmpxstrx substring search, Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 03/50] target/i386: fix packusdw in-place operation, Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 01/50] target/i386: fix pmovsx/pmovzx in-place operations,
Paolo Bonzini <=
- [Qemu-devel] [PULL 06/50] virtio-scsi: Add virtqueue_size parameter allowing virtqueue size to be set., Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 09/50] scsi: Improve scsi_sense_to_errno, Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 08/50] scsi: Refactor scsi sense interpreting code, Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 11/50] scsi-block: Support rerror/werror, Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 14/50] scsi: introduce scsi_build_sense, Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 10/50] scsi: Introduce scsi_sense_buf_to_errno, Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 07/50] scsi-bus: correct responses for INQUIRY and REQUEST SENSE, Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 12/50] scsi: rename scsi_build_sense to scsi_convert_sense, Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 15/50] scsi: introduce sg_io_sense_from_errno, Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 16/50] scsi: move block/scsi.h to include/scsi/constants.h, Paolo Bonzini, 2017/09/19