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:
Richard Henderson
2025-09-04 09:49:23 +02:00
parent b8eb3dd495
commit 26c41cc4a3
+6
View File
@@ -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. */