public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/98317] New: Vector Extensions aligned(1) not generating unaligned loads/stores
@ 2020-12-16 11:30 danielhanchen at gmail dot com
  2020-12-16 11:34 ` [Bug c++/98317] " danielhanchen at gmail dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: danielhanchen at gmail dot com @ 2020-12-16 11:30 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98317
           Summary: Vector Extensions aligned(1) not generating unaligned
                    loads/stores
           Product: gcc
           Version: 10.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: danielhanchen at gmail dot com
  Target Milestone: ---

The ordering of aligned(1) causes GCC to generate movaps / movups.

typedef float   float128_tv1    __attribute__ ((aligned(1), vector_size(16)));
typedef float   float128_tv2    __attribute__ ((vector_size(16), aligned(1)));

float128_tv1 provides MOVAPS
float128_tv2 provides MOVUPS

It seems like the ordering of the arguments changes the assembly.

https://gcc.godbolt.org/z/5qs7e7

It seems like GCC 10.2 and 9.2 all have this issue.
Unless if this was already documentated, this issue can cause massive issues if
memory is unaligned and an aligned load/store is used instead.

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

end of thread, other threads:[~2020-12-18  9:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-16 11:30 [Bug c++/98317] New: Vector Extensions aligned(1) not generating unaligned loads/stores danielhanchen at gmail dot com
2020-12-16 11:34 ` [Bug c++/98317] " danielhanchen at gmail dot com
2020-12-16 12:22 ` jakub at gcc dot gnu.org
2020-12-16 12:30 ` danielhanchen at gmail dot com
2020-12-18  9:11 ` danielhanchen 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).