]> granicus.if.org Git - libx264/commitdiff
ppc: Fix the pre-VSX vec_vsx_st() fallback macro
authorAlexandra Hájková <alexandra@khirnov.net>
Sat, 21 Jan 2017 12:34:49 +0000 (12:34 +0000)
committerHenrik Gramner <henrik@gramner.com>
Sat, 21 Jan 2017 13:10:36 +0000 (14:10 +0100)
It would previously only work correctly with 8-bit data types.

Fixes compilation with --disable-vsx.

common/ppc/ppccommon.h

index 07e371cdb86ebf039afccbf84cd02f96d2e39b8d..28359ac83fd3b134c7edf5a93bf61d5d700245bf 100644 (file)
@@ -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