This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
vec_lvsl is deprecated for little endian; use assignment for unaligned loads
- From: Jeffrey Walton <noloader at gmail dot com>
- To: "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Wed, 20 Sep 2017 04:49:43 -0400
- Subject: vec_lvsl is deprecated for little endian; use assignment for unaligned loads
- Authentication-results: sourceware.org; auth=none
- Reply-to: noloader at gmail dot com
Hi Everyone,
We are catching a warning using AltiVec built-ins:
test.cpp:913:42: warning: vec_lvsl is deprecated for little endian;
use assignment for unaligned loads and stores [-Wdeprecated]
const uint8x16_p8 perm = vec_lvsl(0, src);
The warning is coming from this type of code, which was taken from the
AltiVec PIM:
// Loads a byte array, does not perform an endian conversion.
// This function requires the subkey table is correct endianess.
inline VectorType VectorLoadKey(const byte src[16])
{
const uint8x16_p8 perm = vec_lvsl(0, src);
const uint8x16_p8 low = vec_ld(0, src);
const uint8x16_p8 high = vec_ld(15, src);
return (VectorType)vec_perm(low, high, perm);
}
Its not clear to me how to use assignment to load a vector or store a
vector. I'm also not sure if it includes the automatic endian
conversion, which is something we don't want because the byte arrays
are big endian. (Otherwise we would use a newer function like
vec_vsx_ld).
How do does one load a vector with assignment and not invoke the
automatic endian conversions?
Jeff