public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/94866] New: Failure to optimize pinsrq of 0 with index 1 into movq
@ 2020-04-30  0:21 gabravier at gmail dot com
  2020-04-30  7:13 ` [Bug target/94866] " rguenth at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: gabravier at gmail dot com @ 2020-04-30  0:21 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 94866
           Summary: Failure to optimize pinsrq of 0 with index 1 into movq
           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 int64_t v2di __attribute__((vector_size(16)));
typedef int32_t v2si __attribute__((vector_size(8)));

v2di _mm_move_epi64(v2di a)
{
    return v2di{a[0], 0LL};
}

LLVM with `-O3 -msse4.1` compiles this to this : 

_mm_move_epi64(long __vector(2)): # @_mm_move_epi64(long __vector(2))
  movq xmm0, xmm0 # xmm0 = xmm0[0],zero
  ret

GCC gives :

_mm_move_epi64(long __vector(2)):
  xor eax, eax
  pinsrq xmm0, rax, 1
  ret

GCC's output seems like it would naturally be much slower, so unless there is
something seriously messed up with x86 chips that I've missed, LLVM's version
should be faster

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

end of thread, other threads:[~2023-08-24 20:27 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-30  0:21 [Bug target/94866] New: Failure to optimize pinsrq of 0 with index 1 into movq gabravier at gmail dot com
2020-04-30  7:13 ` [Bug target/94866] " rguenth at gcc dot gnu.org
2023-08-22  9:35 ` rguenth at gcc dot gnu.org
2023-08-22 12:43 ` ubizjak at gmail dot com
2023-08-23  1:12 ` crazylht at gmail dot com
2023-08-23 11:21 ` ubizjak at gmail dot com
2023-08-23 11:23 ` ubizjak at gmail dot com
2023-08-23 13:39 ` crazylht at gmail dot com
2023-08-23 14:54 ` ubizjak at gmail dot com
2023-08-24  1:12 ` crazylht at gmail dot com
2023-08-24 20:25 ` cvs-commit at gcc dot gnu.org
2023-08-24 20:27 ` ubizjak at gmail dot com

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