public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ubizjak at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/98218] [TARGET_MMX_WITH_SSE] Miss vec_cmpmn/vcondmn expander for 64bit vector
Date: Fri, 18 Dec 2020 13:28:14 +0000	[thread overview]
Message-ID: <bug-98218-4-NIuQ06p7s0@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-98218-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98218

--- Comment #3 from Uroš Bizjak <ubizjak at gmail dot com> ---
Testcase 1:

--cut here--
typedef short vec __attribute__((vector_size(8)));
typedef unsigned short uvec __attribute__((vector_size(8)));

vec lt (vec a, vec b) { return a < b; }
vec le (vec a, vec b) { return a <= b; }
vec eq (vec a, vec b) { return a == b; }
vec ne (vec a, vec b) { return a != b; }
vec ge (vec a, vec b) { return a >= b; }
vec gt (vec a, vec b) { return a > b; }

vec ltu (uvec a, uvec b) { return a < b; }
vec leu (uvec a, uvec b) { return a <= b; }
vec geu (uvec a, uvec b) { return a >= b; }
vec gtu (uvec a, uvec b) { return a > b; }
--cut here--

Testcase 2:

--cut here--
typedef short T;

#define M 4

T a[M];
T b[M];
T s1[M];
T s2[M];
T r[M];

void foo (void)
{
  int j;

  for (j = 0; j < M; j++)
    r[j] = (a[j] < b[j]) ? s1[j] : s2[j];
}
--cut here--

gcc -O3:

foo:
        movq    a(%rip), %xmm1
        movq    b(%rip), %xmm0
        movq    s2(%rip), %xmm2
        pcmpgtw %xmm1, %xmm0
        movq    s1(%rip), %xmm1
        pand    %xmm0, %xmm1
        pandn   %xmm2, %xmm0
        por     %xmm1, %xmm0
        movq    %xmm0, r(%rip)
        ret

  parent reply	other threads:[~2020-12-18 13:28 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-10  1:56 [Bug target/98218] New: " crazylht at gmail dot com
2020-12-10  7:34 ` [Bug target/98218] " rguenth at gcc dot gnu.org
2020-12-18 13:23 ` ubizjak at gmail dot com
2020-12-18 13:28 ` ubizjak at gmail dot com [this message]
2020-12-18 13:29 ` ubizjak at gmail dot com
2021-05-05 13:11 ` cvs-commit at gcc dot gnu.org
2021-05-05 13:28 ` ubizjak at gmail dot com
2021-05-07 15:15 ` cvs-commit at gcc dot gnu.org
2021-05-12  6:16 ` cvs-commit at gcc dot gnu.org
2021-05-12  6:24 ` [Bug target/98218] [TARGET_MMX_WITH_SSE] Implement 64bit vector compares (AVX512 masked compares missing) ubizjak at gmail dot com
2021-05-12  6:25 ` ubizjak at gmail dot com
2021-05-12  6:54 ` crazylht at gmail dot com
2021-05-12 17:39 ` dcb314 at hotmail dot com
2021-05-12 18:38 ` ubizjak at gmail dot com
2021-05-12 18:57 ` ubizjak at gmail dot com
2021-05-12 19:05 ` dcb314 at hotmail dot com
2021-05-12 19:47 ` dcb314 at hotmail dot com
2021-05-13  9:23 ` ubizjak at gmail dot com
2022-05-06  8:30 ` jakub at gcc dot gnu.org
2023-05-08 12:21 ` rguenth at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-98218-4-NIuQ06p7s0@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).