mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
tcg/i386: Expand sari of bits-1 as pcmpgt
Expand arithmetic right shift of bits-1 as a comparison vs 0. Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
@@ -4357,6 +4357,12 @@ static void expand_vec_sari(TCGType type, unsigned vece,
|
||||
{
|
||||
TCGv_vec t1, t2;
|
||||
|
||||
if (imm >= (8 << vece) - 1) {
|
||||
tcg_gen_cmp_vec(TCG_COND_LT, vece, v0, v1,
|
||||
tcg_constant_vec(type, MO_64, 0));
|
||||
return;
|
||||
}
|
||||
|
||||
switch (vece) {
|
||||
case MO_8:
|
||||
/* Unpack to 16-bit, shift, and repack. */
|
||||
|
||||
Reference in New Issue
Block a user