This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/70010] powerpc: -flto forgets 'no-vsx' function attributes


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

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |msebor at gcc dot gnu.org

--- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> ---
I'm not an expert but from your description and based on my own testing it
isn't clear to me what you believe is wrong.  no-vsx disables the VSX
extensions to Altivec, no-altivec disables all vectorization.  In my testing it
seems to behave as expected.  For the following reduced test case:

#define vector     __attribute__ ((vector_size (16)))
#define no_altivec __attribute__((__target__("no-altivec")))
#define no_vsx     __attribute__((__target__("no-vsx")))

vector int a, b, c;

void no_vsx vadd_no_vsx (void) {
    c = a + b;
}

void no_altivec vadd_no_altivec (void) {
    c = a + b;
}

void vadd (void) {
    c = a + b;
}

GCC 5.x emits the following with -O2 (regardless of -flto).  AFAICT, none of
the no-vsx instructions are VSX.  VSX instructions are used in the unadorned
vadd function which is expected.

<.vadd_no_vsx>:
 a70:   60 00 00 00     nop
 a74:   e9 42 80 38     ld      r10,-32712(r2)
 a78:   60 00 00 00     nop
 a7c:   e9 22 80 40     ld      r9,-32704(r2)
 a80:   7c 00 50 ce     lvx     v0,0,r10
 a84:   60 00 00 00     nop
 a88:   7c 20 48 ce     lvx     v1,0,r9
 a8c:   e9 22 80 30     ld      r9,-32720(r2)
 a90:   10 00 08 80     vadduwm v0,v0,v1
 a94:   7c 00 49 ce     stvx    v0,0,r9
 a98:   4e 80 00 20     blr

<.vadd_no_altivec>:
        (not vectorized)

<.vadd>:
 9b0:   60 00 00 00     nop
 9b4:   e9 42 80 38     ld      r10,-32712(r2)
 9b8:   60 00 00 00     nop
 9bc:   e9 22 80 40     ld      r9,-32704(r2)
 9c0:   7c 00 56 19     lxvw4x  vs32,0,r10
 9c4:   60 00 00 00     nop
 9c8:   7c 20 4e 19     lxvw4x  vs33,0,r9
 9cc:   e9 22 80 30     ld      r9,-32720(r2)
 9d0:   10 00 08 80     vadduwm v0,v0,v1
 9d4:   7c 00 4f 19     stxvw4x vs32,0,r9
 9d8:   4e 80 00 20     blr

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]