提交 dbdaaff4 编写于 作者: R Richard Henderson

target/s390x: Fix risbg handling

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
Reviewed-by: NAurelien Jarno <aurelien@aurel32.net>
Reported-by: NDavid Hildenbrand <david@redhat.com>
Suggested-by: NAurelien Jarno <aurelien@aurel32.net>
Signed-off-by: NRichard Henderson <rth@twiddle.net>
上级 19d70587
......@@ -3479,8 +3479,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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册