public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/102812] New: Unoptimal (and wrong) code for _Float16 insert
@ 2021-10-18 11:51 ubizjak at gmail dot com
  2021-10-19  1:44 ` [Bug target/102812] " crazylht at gmail dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: ubizjak at gmail dot com @ 2021-10-18 11:51 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 102812
           Summary: Unoptimal (and wrong) code for _Float16 insert
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ubizjak at gmail dot com
  Target Milestone: ---

Following code:

--cut here--
typedef _Float16 v8hf __attribute__((__vector_size__ (16)));

v8hf t (_Float16 a)
{
  return (v8hf){a, 0, 0, 0, 0, 0, 0, 0};
}
--cut here--

compiles with -msse4 to:

        pxor    %xmm15, %xmm15
        movaps  %xmm15, -56(%rsp)
        pextrw  $0, %xmm0, -56(%rsp)
        vmovdqa64       -56(%rsp), %xmm0

PBLWNDW with cleared %xmm15 would be much more optimal, and wouldn't use
memory.

Also, VMOVDQA64 is an AVX512F/AVX512VL, not a SSE4 (not even AVX) instruction.

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

end of thread, other threads:[~2021-12-16 19:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-18 11:51 [Bug target/102812] New: Unoptimal (and wrong) code for _Float16 insert ubizjak at gmail dot com
2021-10-19  1:44 ` [Bug target/102812] " crazylht at gmail dot com
2021-10-20  8:17 ` ubizjak at gmail dot com
2021-10-20  9:08 ` wwwhhhyyy333 at gmail dot com
2021-10-21  1:15 ` crazylht at gmail dot com
2021-10-21  8:59 ` cvs-commit at gcc dot gnu.org
2021-12-16 19:45 ` 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).