https://gcc.gnu.org/g:1d635e79b3c2d26f864964b79717132bffbcad20

commit r16-162-g1d635e79b3c2d26f864964b79717132bffbcad20
Author: Jan Hubicka <hubi...@ucw.cz>
Date:   Sat Apr 26 22:10:19 2025 +0200

    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

Diff:
---
 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 78df3d9525ae..3171d6e0ad45 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

Reply via email to