[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 8/8] target/s390x: Fix risbg handling
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PATCH v2 8/8] target/s390x: Fix risbg handling |
Date: |
Sat, 1 Jul 2017 13:26:00 -0700 |
The rotation is to the left, but extract shifts to the right.
The computation of the extract parameters needs adjusting.
For the entry condition, simplify
64 - rot + len <= 64
-rot + len <= 0
len <= rot
Reported-by: David Hildenbrand <address@hidden>
Suggested-by: Aurelien Jarno <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>
---
target/s390x/translate.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/target/s390x/translate.c b/target/s390x/translate.c
index 1f0c401..89b2ea5 100644
--- a/target/s390x/translate.c
+++ b/target/s390x/translate.c
@@ -3472,8 +3472,8 @@ static ExitStatus op_risbg(DisasContext *s, DisasOps *o)
}
/* In some cases we can implement this with extract. */
- if (imask == 0 && pos == 0 && len > 0 && rot + len <= 64) {
- tcg_gen_extract_i64(o->out, o->in2, rot, len);
+ if (imask == 0 && pos == 0 && len > 0 && len <= rot) {
+ tcg_gen_extract_i64(o->out, o->in2, 64 - rot, len);
return NO_EXIT;
}
--
2.9.4
- [Qemu-devel] [PATCH v2 4/8] target/s390x: Implement SRSTU, (continued)
- [Qemu-devel] [PATCH v2 4/8] target/s390x: Implement SRSTU, Richard Henderson, 2017/07/01
- [Qemu-devel] [PATCH v2 6/8] target/s390x: Mark ETF3 and ETF3_ENH facilities as available, Richard Henderson, 2017/07/01
- [Qemu-devel] [PATCH v2 7/8] target/s390x: Allow to enable "idtes" feature for TCG, Richard Henderson, 2017/07/01
- [Qemu-devel] [PATCH v2 3/8] target/s390x: Tidy SRST, Richard Henderson, 2017/07/01
- [Qemu-devel] [PATCH v2 2/8] target/s390x: Implement CONVERT UNICODE insns, Richard Henderson, 2017/07/01
- [Qemu-devel] [PATCH v2 5/8] target/s390x: Implement TRTR, Richard Henderson, 2017/07/01
- [Qemu-devel] [PATCH v2 8/8] target/s390x: Fix risbg handling,
Richard Henderson <=