[Bug target/78303] PowerPC vec-init-{1,2,4,5,8,9} tests do not run on -mlittle -maltivec=be
meissner at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Feb 6 20:43:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78303
--- Comment #1 from Michael Meissner <meissner at gcc dot gnu.org> ---
The problem is the tests use initialization (both static and auto
initialization). Unfortunately, when initializing a vector, the -maltivec=be
option is not checked when laying out the structure in memory.
Consider the following case:
vector int va = { 100, 200, 300, 400 };
This is laid out in memory for big endian, normal little endian, and little
endian with BE semantics as:
.long 100
.long 200
.long 300
.long 400
Because the vector is byte swapped when loaded on a LE system, and then the
index is swapped for normal -maltivec=LE but not for -maltivec=BE, vec_extract
will deliver the wrong element for vectors that are initialized.
More information about the Gcc-bugs
mailing list