public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/104039] New: AArch64 Redundant instruction moving general to vector register
@ 2022-01-15  3:27 nate at thatsmathematics dot com
  2022-01-15  3:40 ` [Bug target/104039] " pinskia at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: nate at thatsmathematics dot com @ 2022-01-15  3:27 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 104039
           Summary: AArch64 Redundant instruction moving general to vector
                    register
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nate at thatsmathematics dot com
  Target Milestone: ---

Compiling the following code on AArch64 with -O2 or -O3:

typedef unsigned long u64x2 __attribute__((vector_size(16)));

u64x2 combine(unsigned long a, unsigned long b) {
        u64x2 v = {a,b};
    return v;
}

yields the following assembly:

combine:
        fmov    d0, x0
        ins     v0.d[1], x1
        ins     v0.d[1], x1
        ret

where the second ins is entirely redundant with the first and serves no
apparent purpose.  (Unless it is something extremely clever...)

This seems to be a regression from 8.x to 9.x; Godbolt's 8.5 looks correct with
just one ins, but 9.3 has the two.

Originally noticed by Peter Cordes on StackOverflow:
https://stackoverflow.com/questions/70717360/how-to-load-vector-registers-from-integer-registers-in-arm64-m1/70718572#comment125016906_70717360

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

end of thread, other threads:[~2023-03-10 20:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-15  3:27 [Bug target/104039] New: AArch64 Redundant instruction moving general to vector register nate at thatsmathematics dot com
2022-01-15  3:40 ` [Bug target/104039] " pinskia at gcc dot gnu.org
2022-01-17  2:26 ` pinskia at gcc dot gnu.org
2022-01-18 13:49 ` [Bug target/104039] [9/10/11/12 Regression] " rguenth at gcc dot gnu.org
2022-04-07 19:22 ` tnfchris at gcc dot gnu.org
2022-05-27  9:47 ` [Bug target/104039] [10/11/12/13 " rguenth at gcc dot gnu.org
2022-06-28 10:47 ` jakub at gcc dot gnu.org
2023-03-10 20:45 ` [Bug target/104039] [10/11 " 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).