From 1d635e79b3c2d26f864964b79717132bffbcad20 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Sat, 26 Apr 2025 22:10:19 +0200 Subject: [PATCH] Fix i386 vectorizer cost of FP scalar MAX_EXPR and MIN_EXPR I introduced a bug by last minute cleanups unifying the scalar and vector SSE conditional. This patch fixes it and restores cost of 1 of SSE scalar MIN/MAX Bootstrapped/regtested x86_64-linux, comitted. gcc/ChangeLog: PR target/105275 * config/i386/i386.cc (ix86_vector_costs::add_stmt_cost): Fix cost of FP scalar MAX_EXPR and MIN_EXPR --- gcc/config/i386/i386.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc index 78df3d9525a..3171d6e0ad4 100644 --- a/gcc/config/i386/i386.cc +++ b/gcc/config/i386/i386.cc @@ -25420,7 +25420,8 @@ ix86_vector_costs::add_stmt_cost (int count, vect_cost_for_stmt kind, case MAX_EXPR: if (fp) { - if (X87_FLOAT_MODE_P (mode)) + if (X87_FLOAT_MODE_P (mode) + && !SSE_FLOAT_MODE_SSEMATH_OR_HFBF_P (mode)) /* x87 requires conditional branch. We don't have cost for that. */ ; @@ -25457,7 +25458,8 @@ ix86_vector_costs::add_stmt_cost (int count, vect_cost_for_stmt kind, case ABSU_EXPR: if (fp) { - if (X87_FLOAT_MODE_P (mode)) + if (X87_FLOAT_MODE_P (mode) + && !SSE_FLOAT_MODE_SSEMATH_OR_HFBF_P (mode)) /* fabs. */ stmt_cost = ix86_cost->fabs; else -- 2.47.3