Re: vec_lvsl is deprecated for little endian; use assignment for unaligned loads

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jeffrey,

On Wed, Sep 20, 2017 at 04:49:43AM -0400, Jeffrey Walton wrote:
> 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?

Maybe you want vec_xl_be?


Segher



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux