[Pixman] [PATCH 1/5] vmx: fix splat_alpha for ppc64le

Oded Gabbay oded.gabbay at gmail.com
Tue Jun 16 08:27:58 PDT 2015


The permutation vector isn't correct for LE, so correct its values
in case we are in LE mode.

Signed-off-by: Oded Gabbay <oded.gabbay at gmail.com>
---
 pixman/pixman-vmx.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/pixman/pixman-vmx.c b/pixman/pixman-vmx.c
index c33631c..23537f6 100644
--- a/pixman/pixman-vmx.c
+++ b/pixman/pixman-vmx.c
@@ -37,10 +37,17 @@
 static force_inline vector unsigned int
 splat_alpha (vector unsigned int pix)
 {
-    return vec_perm (pix, pix,
-		     (vector unsigned char)AVV (
-			 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x04, 0x04,
-			 0x08, 0x08, 0x08, 0x08, 0x0C, 0x0C, 0x0C, 0x0C));
+#ifdef _LITTLE_ENDIAN
+        return vec_perm (pix, pix,
+             (vector unsigned char) AVV (
+             0x03, 0x03, 0x03, 0x03, 0x07, 0x07, 0x07, 0x07,
+             0x0B, 0x0B, 0x0B, 0x0B, 0x0F, 0x0F, 0x0F, 0x0F));
+#else
+        return vec_perm (pix, pix,
+             (vector unsigned char)AVV (
+             0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x04, 0x04,
+             0x08, 0x08, 0x08, 0x08, 0x0C, 0x0C, 0x0C, 0x0C));
+#endif
 }
 
 static force_inline vector unsigned int
-- 
2.4.3



More information about the Pixman mailing list