public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/94871] New: Failure to convert cmpeqpd+pxor with -1 into cmpneqpd
@ 2020-04-30  9:20 gabravier at gmail dot com
  2020-04-30 10:36 ` [Bug target/94871] " rguenth at gcc dot gnu.org
  2021-08-15 21:51 ` pinskia at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: gabravier at gmail dot com @ 2020-04-30  9:20 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 94871
           Summary: Failure to convert cmpeqpd+pxor with -1 into cmpneqpd
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gabravier at gmail dot com
  Target Milestone: ---

typedef double v2df __attribute__((vector_size(16)));
typedef int64_t v2di __attribute__((vector_size(16)));
typedef int8_t v16qi __attribute__((vector_size(16)));

inline v2di set1_epi8(int8_t a)
{
    return (v2di)(v16qi){a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a};
}

v2di cmpneq_pd(v2df a, v2df b)
{
    return ((v2di)__builtin_ia32_cmpeqpd(a, b) ^ set1_epi8(0xFF));
}

With -O3, LLVM outputs : 

cmpneq_pd(double __vector(2), double __vector(2)):
  cmpneqpd xmm0, xmm1
  ret

GCC outputs :

cmpneq_pd(double __vector(2), double __vector(2)):
  cmpeqpd xmm0, xmm1
  pcmpeqd xmm1, xmm1
  pxor xmm0, xmm1
  ret

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug target/94871] Failure to convert cmpeqpd+pxor with -1 into cmpneqpd
  2020-04-30  9:20 [Bug target/94871] New: Failure to convert cmpeqpd+pxor with -1 into cmpneqpd gabravier at gmail dot com
@ 2020-04-30 10:36 ` rguenth at gcc dot gnu.org
  2021-08-15 21:51 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-04-30 10:36 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Target|                            |x86_64-*-* i?86-*-*
           Keywords|                            |missed-optimization
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2020-04-30

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Requires some x86 specific builtin folding or open-coding it.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug target/94871] Failure to convert cmpeqpd+pxor with -1 into cmpneqpd
  2020-04-30  9:20 [Bug target/94871] New: Failure to convert cmpeqpd+pxor with -1 into cmpneqpd gabravier at gmail dot com
  2020-04-30 10:36 ` [Bug target/94871] " rguenth at gcc dot gnu.org
@ 2021-08-15 21:51 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-15 21:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---

v2di cmpneq_pd1(v2df a, v2df b)
{
    return ((v2di)(a==b) ^ set1_epi8(0xFF));
}
Produces the correct thing on gimple level:
  _5 = .VCOND (a_2(D), b_3(D), { 0, 0 }, { -1, -1 }, 113);

But the RTL during combine (even with -ffast-math) produces:
(set (reg:V2DI 82 [ <retval> ])
    (not:V2DI (eq:V2DI (reg:V2DF 89)
            (reg:V2DF 90))))

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-08-15 21:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-30  9:20 [Bug target/94871] New: Failure to convert cmpeqpd+pxor with -1 into cmpneqpd gabravier at gmail dot com
2020-04-30 10:36 ` [Bug target/94871] " rguenth at gcc dot gnu.org
2021-08-15 21:51 ` pinskia at gcc dot gnu.org

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).