Commit 97eaef2a authored by Alexandra Hájková's avatar Alexandra Hájková Committed by Henrik Gramner

ppc: Fix the pre-VSX vec_vsx_st() fallback macro

It would previously only work correctly with 8-bit data types.

Fixes compilation with --disable-vsx.
parent 2ebe09a4
......@@ -267,15 +267,16 @@ p2 += i2;
vec_perm(vec_ld(off, src), vec_ld(off + 15, src), vec_lvsl(off, src))
#undef vec_vsx_st
#define vec_vsx_st(v, off, dst) \
do { \
vec_u8_t _v = (vec_u8_t)(v); \
vec_u8_t _a = vec_ld(off, dst); \
vec_u8_t _b = vec_ld(off + 15, dst); \
vec_u8_t _e = vec_perm(_b, _a, vec_lvsl(0, dst)); \
vec_u8_t _m = vec_lvsr(0, dst); \
\
vec_st(vec_perm(_v, _e, _m), off + 15, dst); \
vec_st(vec_perm(_e, _v, _m), off, dst); \
#define vec_vsx_st(v, off, dst) \
do { \
uint8_t *_dst = (uint8_t*)(dst); \
vec_u8_t _v = (vec_u8_t)(v); \
vec_u8_t _a = vec_ld(off, _dst); \
vec_u8_t _b = vec_ld(off + 15, _dst); \
vec_u8_t _e = vec_perm(_b, _a, vec_lvsl(0, _dst)); \
vec_u8_t _m = vec_lvsr(0, _dst); \
\
vec_st(vec_perm(_v, _e, _m), off + 15, _dst); \
vec_st(vec_perm(_e, _v, _m), off, _dst); \
} while( 0 )
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment