Name V2SF logic insns, so expand_simple_binop works with V2SF modes.

2021-08-09  Uroš Bizjak  <ubiz...@gmail.com>

gcc/
    PR target/101812
    * config/i386/mmx.md (<any_logic:code>v2sf3):
    Rename from *mmx_<any_logic:code>v2sf3

gcc/testsuite/
    PR target/101812
    * gcc.target/i386/pr101812.c: New test.

Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}.

Pushed to master.

Uros.
diff --git a/gcc/config/i386/mmx.md b/gcc/config/i386/mmx.md
index 0984f7cc44d..2d3b63f0834 100644
--- a/gcc/config/i386/mmx.md
+++ b/gcc/config/i386/mmx.md
@@ -952,7 +952,7 @@
    (set_attr "prefix" "orig,vex")
    (set_attr "mode" "V4SF")])
 
-(define_insn "*mmx_<code>v2sf3"
+(define_insn "<code>v2sf3"
   [(set (match_operand:V2SF 0 "register_operand" "=x,x")
        (any_logic:V2SF
          (match_operand:V2SF 1 "register_operand" "%0,x")
diff --git a/gcc/testsuite/gcc.target/i386/pr101812.c 
b/gcc/testsuite/gcc.target/i386/pr101812.c
new file mode 100644
index 00000000000..07e84a37d67
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr101812.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -ftree-loop-vectorize -fvect-cost-model=unlimited" }  */
+
+#define LTGT(a, b) (__builtin_islessgreater (a, b) ? a : b)
+void foo (int ilast,float* w, float* w2)
+{
+  int i;
+  for (i = 0; i < ilast; ++i)
+  {
+    w[i] = LTGT (0.0f, w2[i]);
+  }
+}

Reply via email to