From 9d2d660aab2f332b1e3f69a2fb3419cf3cc33b47 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Mon, 9 Aug 2021 16:38:54 +0200 Subject: [PATCH] i386: Name V2SF logic insns [PR101812] MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Name V2SF logic insns, so expand_simple_binop works with V2SF modes. 2021-08-09 Uroš Bizjak gcc/ PR target/101812 * config/i386/mmx.md (v2sf3): Rename from *mmx_v2sf3 gcc/testsuite/ PR target/101812 * gcc.target/i386/pr101812.c: New test. --- gcc/config/i386/mmx.md | 2 +- gcc/testsuite/gcc.target/i386/pr101812.c | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.target/i386/pr101812.c diff --git a/gcc/config/i386/mmx.md b/gcc/config/i386/mmx.md index 0984f7c..2d3b63f 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_v2sf3" +(define_insn "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 0000000..07e84a3 --- /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]); + } +} -- 2.7.4