public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/99754] New: [sse2] new _mm_loadu_si16 and _mm_loadu_si32 implemented incorrectly
@ 2021-03-24 18:07 evan@coeus-group.com
  2021-03-25  6:52 ` [Bug target/99754] " crazylht at gmail dot com
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: evan@coeus-group.com @ 2021-03-24 18:07 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 99754
           Summary: [sse2] new _mm_loadu_si16 and _mm_loadu_si32
                    implemented incorrectly
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: evan@coeus-group.com
  Target Milestone: ---

Created attachment 50470
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50470&action=edit
Trivial patch

_mm_loadu_si16 and _mm_loadu_si32 were implemented in GCC 11, but incorrectly. 
The value pointed to by the argument is supposed to go in the first element,
but _mm_set_epi16 / _mm_set_epi32 reverse the argument order so in GCC they go
in the *last* elemement.

The most straightforward solution would be to change the _mm_set_* calls so the
input is used for the last argument instead of the first (patch attached).

FWIW, here is LLVM's implementation:
<https://github.com/llvm/llvm-project/blob/a76d0207d5f94af698525d7dc1f0953ed35901a6/clang/lib/Headers/emmintrin.h#L1670-L1710>.
I've verified that LLVM's implementation matches ICC's.

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

end of thread, other threads:[~2022-05-07  7:26 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-24 18:07 [Bug target/99754] New: [sse2] new _mm_loadu_si16 and _mm_loadu_si32 implemented incorrectly evan@coeus-group.com
2021-03-25  6:52 ` [Bug target/99754] " crazylht at gmail dot com
2022-03-11 15:15 ` peter at cordes dot ca
2022-03-11 15:21 ` peter at cordes dot ca
2022-03-11 15:53 ` jakub at gcc dot gnu.org
2022-03-14  9:45 ` cvs-commit at gcc dot gnu.org
2022-03-26 23:03 ` peter at cordes dot ca
2022-03-28  1:44 ` crazylht at gmail dot com
2022-03-28  2:33 ` cvs-commit at gcc dot gnu.org
2022-03-28  2:35 ` crazylht at gmail dot com
2022-05-07  7:26 ` jakub 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).