tcg/i386: Remove expansion for missing minmax

This is now handled by code within tcg-op-vec.c.

Backports commit 3ec3538a45f2fead475b0cca6945092c87927b4f from qemu
This commit is contained in:
Richard Henderson 2019-05-24 18:34:43 -04:00 committed by Lioncash
parent 68cb096196
commit ffdbc1a233
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -3325,7 +3325,6 @@ int tcg_can_emit_vec_op(TCGOpcode opc, TCGType type, unsigned vece)
case INDEX_op_smax_vec:
case INDEX_op_umin_vec:
case INDEX_op_umax_vec:
return vece <= MO_32 ? 1 : -1;
case INDEX_op_abs_vec:
return vece <= MO_32;
@ -3579,25 +3578,6 @@ static void expand_vec_cmpsel(TCGContext *s, TCGType type, unsigned vece, TCGv_v
tcg_temp_free_vec(s, t);
}
static void expand_vec_minmax(TCGContext *s, TCGType type, unsigned vece,
TCGCond cond, bool min,
TCGv_vec v0, TCGv_vec v1, TCGv_vec v2)
{
TCGv_vec t1 = tcg_temp_new_vec(s, type);
tcg_debug_assert(vece == MO_64);
tcg_gen_cmp_vec(s, cond, vece, t1, v1, v2);
if (min) {
TCGv_vec t2;
t2 = v1, v1 = v2, v2 = t2;
}
vec_gen_4(s, INDEX_op_x86_vpblendvb_vec, type, vece,
tcgv_vec_arg(s, v0), tcgv_vec_arg(s, v1),
tcgv_vec_arg(s, v2), tcgv_vec_arg(s, t1));
tcg_temp_free_vec(s, t1);
}
void tcg_expand_vec_op(TCGContext *s, TCGOpcode opc, TCGType type, unsigned vece,
TCGArg a0, ...)
{
@ -3637,23 +3617,6 @@ void tcg_expand_vec_op(TCGContext *s, TCGOpcode opc, TCGType type, unsigned vece
expand_vec_cmpsel(s, type, vece, v0, v1, v2, v3, v4, va_arg(va, TCGArg));
break;
case INDEX_op_smin_vec:
v2 = temp_tcgv_vec(s, arg_temp(a2));
expand_vec_minmax(s, type, vece, TCG_COND_GT, true, v0, v1, v2);
break;
case INDEX_op_smax_vec:
v2 = temp_tcgv_vec(s, arg_temp(a2));
expand_vec_minmax(s, type, vece, TCG_COND_GT, false, v0, v1, v2);
break;
case INDEX_op_umin_vec:
v2 = temp_tcgv_vec(s, arg_temp(a2));
expand_vec_minmax(s, type, vece, TCG_COND_GTU, true, v0, v1, v2);
break;
case INDEX_op_umax_vec:
v2 = temp_tcgv_vec(s, arg_temp(a2));
expand_vec_minmax(s, type, vece, TCG_COND_GTU, false, v0, v1, v2);
break;
default:
break;
}