]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix i386 vectorizer cost of FP scalar MAX_EXPR and MIN_EXPR
authorJan Hubicka <hubicka@ucw.cz>
Sat, 26 Apr 2025 20:10:19 +0000 (22:10 +0200)
committerJan Hubicka <hubicka@ucw.cz>
Sat, 26 Apr 2025 20:11:11 +0000 (22:11 +0200)
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

index 78df3d9525ae14185fa8e9c32d8a60a17652a203..3171d6e0ad458eb7db601f66abb82a8101cf8d33 100644 (file)
@@ -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