Revisión | dbdaaff43adc49f1debd935b1fd58e2b47ba7676 (tree) |
---|---|
Tiempo | 2017-07-18 06:13:17 |
Autor | Richard Henderson <rth@twid...> |
Commiter | 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: Aurelien Jarno <aurelien@aurel32.net>
Reported-by: David Hildenbrand <david@redhat.com>
Suggested-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
@@ -3479,8 +3479,8 @@ static ExitStatus op_risbg(DisasContext *s, DisasOps *o) | ||
3479 | 3479 | } |
3480 | 3480 | |
3481 | 3481 | /* In some cases we can implement this with extract. */ |
3482 | - if (imask == 0 && pos == 0 && len > 0 && rot + len <= 64) { | |
3483 | - tcg_gen_extract_i64(o->out, o->in2, rot, len); | |
3482 | + if (imask == 0 && pos == 0 && len > 0 && len <= rot) { | |
3483 | + tcg_gen_extract_i64(o->out, o->in2, 64 - rot, len); | |
3484 | 3484 | return NO_EXIT; |
3485 | 3485 | } |
3486 | 3486 |