pixman: Branch 'master' - 5 commits
Pekka Paalanen
pq at kemper.freedesktop.org
Thu Jul 2 00:07:30 PDT 2015
pixman/pixman-vmx.c | 152 ++++++++++++++++++++++++++++++++++++++++------------
1 file changed, 119 insertions(+), 33 deletions(-)
New commits:
commit 2be523b20402b7c9f548ac33b8c0f0ed00156c64
Author: Oded Gabbay <oded.gabbay at gmail.com>
Date: Thu Jun 25 15:59:57 2015 +0300
vmx: fix pix_multiply for ppc64le
vec_mergeh/l operates differently for BE and LE, because of the order of
the vector elements (l->r in BE and r->l in LE).
To fix that, we simply need to swap between the input parameters, in case
we are working in LE.
v2:
- replace _LITTLE_ENDIAN with WORDS_BIGENDIAN for consistency
- fixed whitespaces and indentation issues
Signed-off-by: Oded Gabbay <oded.gabbay at gmail.com>
Reviewed-by: Adam Jackson <ajax at redhat.com>
Acked-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
diff --git a/pixman/pixman-vmx.c b/pixman/pixman-vmx.c
index c963c28..cef921f 100644
--- a/pixman/pixman-vmx.c
+++ b/pixman/pixman-vmx.c
@@ -57,12 +57,22 @@ pix_multiply (vector unsigned int p, vector unsigned int a)
/* unpack to short */
hi = (vector unsigned short)
+#ifdef WORDS_BIGENDIAN
vec_mergeh ((vector unsigned char)AVV (0),
(vector unsigned char)p);
+#else
+ vec_mergeh ((vector unsigned char) p,
+ (vector unsigned char) AVV (0));
+#endif
mod = (vector unsigned short)
+#ifdef WORDS_BIGENDIAN
vec_mergeh ((vector unsigned char)AVV (0),
(vector unsigned char)a);
+#else
+ vec_mergeh ((vector unsigned char) a,
+ (vector unsigned char) AVV (0));
+#endif
hi = vec_mladd (hi, mod, (vector unsigned short)
AVV (0x0080, 0x0080, 0x0080, 0x0080,
@@ -74,11 +84,22 @@ pix_multiply (vector unsigned int p, vector unsigned int a)
/* unpack to short */
lo = (vector unsigned short)
+#ifdef WORDS_BIGENDIAN
vec_mergel ((vector unsigned char)AVV (0),
(vector unsigned char)p);
+#else
+ vec_mergel ((vector unsigned char) p,
+ (vector unsigned char) AVV (0));
+#endif
+
mod = (vector unsigned short)
+#ifdef WORDS_BIGENDIAN
vec_mergel ((vector unsigned char)AVV (0),
(vector unsigned char)a);
+#else
+ vec_mergel ((vector unsigned char) a,
+ (vector unsigned char) AVV (0));
+#endif
lo = vec_mladd (lo, mod, (vector unsigned short)
AVV (0x0080, 0x0080, 0x0080, 0x0080,
commit 8d379ad88e208bed9697065f6911c9ef83d85276
Author: Oded Gabbay <oded.gabbay at gmail.com>
Date: Thu Jun 25 15:59:56 2015 +0300
vmx: fix unused var warnings
v2: don't put ';' at the end of macro definition. Instead, move it to
each line the macro is used.
Signed-off-by: Oded Gabbay <oded.gabbay at gmail.com>
Reviewed-by: Adam Jackson <ajax at redhat.com>
Acked-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
diff --git a/pixman/pixman-vmx.c b/pixman/pixman-vmx.c
index f28a0fd..c963c28 100644
--- a/pixman/pixman-vmx.c
+++ b/pixman/pixman-vmx.c
@@ -176,6 +176,9 @@ do { \
vec_perm (tmp1, tmp2, mask ## _mask); \
} while (0);
+#define DECLARE_SRC_MASK_VAR vector unsigned char src_mask
+#define DECLARE_MASK_MASK_VAR vector unsigned char mask_mask
+
#else
/* Now the COMPUTE_SHIFT_{MASK, MASKS, MASKC} below are just no-op.
@@ -198,6 +201,9 @@ do { \
v ## dest = *((typeof(v ## dest)*)dest); \
v ## mask = *((typeof(v ## mask)*)mask);
+#define DECLARE_SRC_MASK_VAR
+#define DECLARE_MASK_MASK_VAR
+
#endif /* WORDS_BIGENDIAN */
#define LOAD_VECTORSM(dest, source, mask) \
@@ -215,7 +221,7 @@ vmx_combine_over_u_no_mask (uint32_t * dest,
{
int i;
vector unsigned int vdest, vsrc;
- vector unsigned char src_mask;
+ DECLARE_SRC_MASK_VAR;
while (width && ((uintptr_t)dest & 15))
{
@@ -265,7 +271,8 @@ vmx_combine_over_u_mask (uint32_t * dest,
{
int i;
vector unsigned int vdest, vsrc, vmask;
- vector unsigned char src_mask, mask_mask;
+ DECLARE_SRC_MASK_VAR;
+ DECLARE_MASK_MASK_VAR;
while (width && ((uintptr_t)dest & 15))
{
@@ -336,7 +343,7 @@ vmx_combine_over_reverse_u_no_mask (uint32_t * dest,
{
int i;
vector unsigned int vdest, vsrc;
- vector unsigned char src_mask;
+ DECLARE_SRC_MASK_VAR;
while (width && ((uintptr_t)dest & 15))
{
@@ -384,7 +391,8 @@ vmx_combine_over_reverse_u_mask (uint32_t * dest,
{
int i;
vector unsigned int vdest, vsrc, vmask;
- vector unsigned char src_mask, mask_mask;
+ DECLARE_SRC_MASK_VAR;
+ DECLARE_MASK_MASK_VAR;
while (width && ((uintptr_t)dest & 15))
{
@@ -452,7 +460,7 @@ vmx_combine_in_u_no_mask (uint32_t * dest,
{
int i;
vector unsigned int vdest, vsrc;
- vector unsigned char src_mask;
+ DECLARE_SRC_MASK_VAR;
while (width && ((uintptr_t)dest & 15))
{
@@ -497,7 +505,8 @@ vmx_combine_in_u_mask (uint32_t * dest,
{
int i;
vector unsigned int vdest, vsrc, vmask;
- vector unsigned char src_mask, mask_mask;
+ DECLARE_SRC_MASK_VAR;
+ DECLARE_MASK_MASK_VAR;
while (width && ((uintptr_t)dest & 15))
{
@@ -562,7 +571,7 @@ vmx_combine_in_reverse_u_no_mask (uint32_t * dest,
{
int i;
vector unsigned int vdest, vsrc;
- vector unsigned char src_mask;
+ DECLARE_SRC_MASK_VAR;
while (width && ((uintptr_t)dest & 15))
{
@@ -609,7 +618,8 @@ vmx_combine_in_reverse_u_mask (uint32_t * dest,
{
int i;
vector unsigned int vdest, vsrc, vmask;
- vector unsigned char src_mask, mask_mask;
+ DECLARE_SRC_MASK_VAR;
+ DECLARE_MASK_MASK_VAR;
while (width && ((uintptr_t)dest & 15))
{
@@ -676,7 +686,7 @@ vmx_combine_out_u_no_mask (uint32_t * dest,
{
int i;
vector unsigned int vdest, vsrc;
- vector unsigned char src_mask;
+ DECLARE_SRC_MASK_VAR;
while (width && ((uintptr_t)dest & 15))
{
@@ -723,7 +733,8 @@ vmx_combine_out_u_mask (uint32_t * dest,
{
int i;
vector unsigned int vdest, vsrc, vmask;
- vector unsigned char src_mask, mask_mask;
+ DECLARE_SRC_MASK_VAR;
+ DECLARE_MASK_MASK_VAR;
while (width && ((uintptr_t)dest & 15))
{
@@ -788,7 +799,7 @@ vmx_combine_out_reverse_u_no_mask (uint32_t * dest,
{
int i;
vector unsigned int vdest, vsrc;
- vector unsigned char src_mask;
+ DECLARE_SRC_MASK_VAR;
while (width && ((uintptr_t)dest & 15))
{
@@ -836,7 +847,8 @@ vmx_combine_out_reverse_u_mask (uint32_t * dest,
{
int i;
vector unsigned int vdest, vsrc, vmask;
- vector unsigned char src_mask, mask_mask;
+ DECLARE_SRC_MASK_VAR;
+ DECLARE_MASK_MASK_VAR;
while (width && ((uintptr_t)dest & 15))
{
@@ -903,7 +915,7 @@ vmx_combine_atop_u_no_mask (uint32_t * dest,
{
int i;
vector unsigned int vdest, vsrc;
- vector unsigned char src_mask;
+ DECLARE_SRC_MASK_VAR;
while (width && ((uintptr_t)dest & 15))
{
@@ -955,7 +967,8 @@ vmx_combine_atop_u_mask (uint32_t * dest,
{
int i;
vector unsigned int vdest, vsrc, vmask;
- vector unsigned char src_mask, mask_mask;
+ DECLARE_SRC_MASK_VAR;
+ DECLARE_MASK_MASK_VAR;
while (width && ((uintptr_t)dest & 15))
{
@@ -1031,7 +1044,7 @@ vmx_combine_atop_reverse_u_no_mask (uint32_t * dest,
{
int i;
vector unsigned int vdest, vsrc;
- vector unsigned char src_mask;
+ DECLARE_SRC_MASK_VAR;
while (width && ((uintptr_t)dest & 15))
{
@@ -1083,7 +1096,8 @@ vmx_combine_atop_reverse_u_mask (uint32_t * dest,
{
int i;
vector unsigned int vdest, vsrc, vmask;
- vector unsigned char src_mask, mask_mask;
+ DECLARE_SRC_MASK_VAR;
+ DECLARE_MASK_MASK_VAR;
while (width && ((uintptr_t)dest & 15))
{
@@ -1159,7 +1173,7 @@ vmx_combine_xor_u_no_mask (uint32_t * dest,
{
int i;
vector unsigned int vdest, vsrc;
- vector unsigned char src_mask;
+ DECLARE_SRC_MASK_VAR;
while (width && ((uintptr_t)dest & 15))
{
@@ -1211,7 +1225,8 @@ vmx_combine_xor_u_mask (uint32_t * dest,
{
int i;
vector unsigned int vdest, vsrc, vmask;
- vector unsigned char src_mask, mask_mask;
+ DECLARE_SRC_MASK_VAR;
+ DECLARE_MASK_MASK_VAR;
while (width && ((uintptr_t)dest & 15))
{
@@ -1287,7 +1302,7 @@ vmx_combine_add_u_no_mask (uint32_t * dest,
{
int i;
vector unsigned int vdest, vsrc;
- vector unsigned char src_mask;
+ DECLARE_SRC_MASK_VAR;
while (width && ((uintptr_t)dest & 15))
{
@@ -1333,7 +1348,8 @@ vmx_combine_add_u_mask (uint32_t * dest,
{
int i;
vector unsigned int vdest, vsrc, vmask;
- vector unsigned char src_mask, mask_mask;
+ DECLARE_SRC_MASK_VAR;
+ DECLARE_MASK_MASK_VAR;
while (width && ((uintptr_t)dest & 15))
{
@@ -1401,7 +1417,8 @@ vmx_combine_src_ca (pixman_implementation_t *imp,
{
int i;
vector unsigned int vdest, vsrc, vmask;
- vector unsigned char src_mask, mask_mask;
+ DECLARE_SRC_MASK_VAR;
+ DECLARE_MASK_MASK_VAR;
while (width && ((uintptr_t)dest & 15))
{
@@ -1451,7 +1468,8 @@ vmx_combine_over_ca (pixman_implementation_t *imp,
{
int i;
vector unsigned int vdest, vsrc, vmask;
- vector unsigned char src_mask, mask_mask;
+ DECLARE_SRC_MASK_VAR;
+ DECLARE_MASK_MASK_VAR;
while (width && ((uintptr_t)dest & 15))
{
@@ -1509,7 +1527,8 @@ vmx_combine_over_reverse_ca (pixman_implementation_t *imp,
{
int i;
vector unsigned int vdest, vsrc, vmask;
- vector unsigned char src_mask, mask_mask;
+ DECLARE_SRC_MASK_VAR;
+ DECLARE_MASK_MASK_VAR;
while (width && ((uintptr_t)dest & 15))
{
@@ -1565,7 +1584,8 @@ vmx_combine_in_ca (pixman_implementation_t *imp,
{
int i;
vector unsigned int vdest, vsrc, vmask;
- vector unsigned char src_mask, mask_mask;
+ DECLARE_SRC_MASK_VAR;
+ DECLARE_MASK_MASK_VAR;
while (width && ((uintptr_t)dest & 15))
{
@@ -1619,7 +1639,8 @@ vmx_combine_in_reverse_ca (pixman_implementation_t *imp,
{
int i;
vector unsigned int vdest, vsrc, vmask;
- vector unsigned char mask_mask, src_mask;
+ DECLARE_SRC_MASK_VAR;
+ DECLARE_MASK_MASK_VAR;
while (width && ((uintptr_t)dest & 15))
{
@@ -1674,7 +1695,8 @@ vmx_combine_out_ca (pixman_implementation_t *imp,
{
int i;
vector unsigned int vdest, vsrc, vmask;
- vector unsigned char mask_mask, src_mask;
+ DECLARE_SRC_MASK_VAR;
+ DECLARE_MASK_MASK_VAR;
while (width && ((uintptr_t)dest & 15))
{
@@ -1731,7 +1753,8 @@ vmx_combine_out_reverse_ca (pixman_implementation_t *imp,
{
int i;
vector unsigned int vdest, vsrc, vmask;
- vector unsigned char mask_mask, src_mask;
+ DECLARE_SRC_MASK_VAR;
+ DECLARE_MASK_MASK_VAR;
while (width && ((uintptr_t)dest & 15))
{
@@ -1788,7 +1811,8 @@ vmx_combine_atop_ca (pixman_implementation_t *imp,
{
int i;
vector unsigned int vdest, vsrc, vmask, vsrca;
- vector unsigned char mask_mask, src_mask;
+ DECLARE_SRC_MASK_VAR;
+ DECLARE_MASK_MASK_VAR;
while (width && ((uintptr_t)dest & 15))
{
@@ -1854,7 +1878,8 @@ vmx_combine_atop_reverse_ca (pixman_implementation_t *imp,
{
int i;
vector unsigned int vdest, vsrc, vmask;
- vector unsigned char mask_mask, src_mask;
+ DECLARE_SRC_MASK_VAR;
+ DECLARE_MASK_MASK_VAR;
while (width && ((uintptr_t)dest & 15))
{
@@ -1917,7 +1942,8 @@ vmx_combine_xor_ca (pixman_implementation_t *imp,
{
int i;
vector unsigned int vdest, vsrc, vmask;
- vector unsigned char mask_mask, src_mask;
+ DECLARE_SRC_MASK_VAR;
+ DECLARE_MASK_MASK_VAR;
while (width && ((uintptr_t)dest & 15))
{
@@ -1980,7 +2006,8 @@ vmx_combine_add_ca (pixman_implementation_t *imp,
{
int i;
vector unsigned int vdest, vsrc, vmask;
- vector unsigned char mask_mask, src_mask;
+ DECLARE_SRC_MASK_VAR;
+ DECLARE_MASK_MASK_VAR;
while (width && ((uintptr_t)dest & 15))
{
commit ff66a4a3ce95f2adcbf30b354eac60944596d6a2
Author: Oded Gabbay <oded.gabbay at gmail.com>
Date: Thu Jun 25 15:59:55 2015 +0300
vmx: encapsulate the temporary variables inside the macros
v2: fixed whitespaces and indentation issues
Signed-off-by: Oded Gabbay <oded.gabbay at gmail.com>
Reviewed-by: Adam Jackson <ajax at redhat.com>
Acked-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
diff --git a/pixman/pixman-vmx.c b/pixman/pixman-vmx.c
index e33d9d9..f28a0fd 100644
--- a/pixman/pixman-vmx.c
+++ b/pixman/pixman-vmx.c
@@ -153,13 +153,18 @@ over (vector unsigned int src,
*/
#define LOAD_VECTORS(dest, source) \
+do { \
+ vector unsigned char tmp1, tmp2; \
tmp1 = (typeof(tmp1))vec_ld (0, source); \
tmp2 = (typeof(tmp2))vec_ld (15, source); \
v ## source = (typeof(v ## source)) \
vec_perm (tmp1, tmp2, source ## _mask); \
- v ## dest = (typeof(v ## dest))vec_ld (0, dest);
+ v ## dest = (typeof(v ## dest))vec_ld (0, dest); \
+} while (0);
#define LOAD_VECTORSC(dest, source, mask) \
+do { \
+ vector unsigned char tmp1, tmp2; \
tmp1 = (typeof(tmp1))vec_ld (0, source); \
tmp2 = (typeof(tmp2))vec_ld (15, source); \
v ## source = (typeof(v ## source)) \
@@ -168,7 +173,8 @@ over (vector unsigned int src,
v ## dest = (typeof(v ## dest))vec_ld (0, dest); \
tmp2 = (typeof(tmp2))vec_ld (15, mask); \
v ## mask = (typeof(v ## mask)) \
- vec_perm (tmp1, tmp2, mask ## _mask);
+ vec_perm (tmp1, tmp2, mask ## _mask); \
+} while (0);
#else
@@ -209,7 +215,7 @@ vmx_combine_over_u_no_mask (uint32_t * dest,
{
int i;
vector unsigned int vdest, vsrc;
- vector unsigned char tmp1, tmp2, src_mask;
+ vector unsigned char src_mask;
while (width && ((uintptr_t)dest & 15))
{
@@ -259,7 +265,7 @@ vmx_combine_over_u_mask (uint32_t * dest,
{
int i;
vector unsigned int vdest, vsrc, vmask;
- vector unsigned char tmp1, tmp2, src_mask, mask_mask;
+ vector unsigned char src_mask, mask_mask;
while (width && ((uintptr_t)dest & 15))
{
@@ -330,7 +336,7 @@ vmx_combine_over_reverse_u_no_mask (uint32_t * dest,
{
int i;
vector unsigned int vdest, vsrc;
- vector unsigned char tmp1, tmp2, src_mask;
+ vector unsigned char src_mask;
while (width && ((uintptr_t)dest & 15))
{
@@ -378,7 +384,7 @@ vmx_combine_over_reverse_u_mask (uint32_t * dest,
{
int i;
vector unsigned int vdest, vsrc, vmask;
- vector unsigned char tmp1, tmp2, src_mask, mask_mask;
+ vector unsigned char src_mask, mask_mask;
while (width && ((uintptr_t)dest & 15))
{
@@ -446,7 +452,7 @@ vmx_combine_in_u_no_mask (uint32_t * dest,
{
int i;
vector unsigned int vdest, vsrc;
- vector unsigned char tmp1, tmp2, src_mask;
+ vector unsigned char src_mask;
while (width && ((uintptr_t)dest & 15))
{
@@ -491,7 +497,7 @@ vmx_combine_in_u_mask (uint32_t * dest,
{
int i;
vector unsigned int vdest, vsrc, vmask;
- vector unsigned char tmp1, tmp2, src_mask, mask_mask;
+ vector unsigned char src_mask, mask_mask;
while (width && ((uintptr_t)dest & 15))
{
@@ -556,7 +562,7 @@ vmx_combine_in_reverse_u_no_mask (uint32_t * dest,
{
int i;
vector unsigned int vdest, vsrc;
- vector unsigned char tmp1, tmp2, src_mask;
+ vector unsigned char src_mask;
while (width && ((uintptr_t)dest & 15))
{
@@ -603,7 +609,7 @@ vmx_combine_in_reverse_u_mask (uint32_t * dest,
{
int i;
vector unsigned int vdest, vsrc, vmask;
- vector unsigned char tmp1, tmp2, src_mask, mask_mask;
+ vector unsigned char src_mask, mask_mask;
while (width && ((uintptr_t)dest & 15))
{
@@ -670,7 +676,7 @@ vmx_combine_out_u_no_mask (uint32_t * dest,
{
int i;
vector unsigned int vdest, vsrc;
- vector unsigned char tmp1, tmp2, src_mask;
+ vector unsigned char src_mask;
while (width && ((uintptr_t)dest & 15))
{
@@ -717,7 +723,7 @@ vmx_combine_out_u_mask (uint32_t * dest,
{
int i;
vector unsigned int vdest, vsrc, vmask;
- vector unsigned char tmp1, tmp2, src_mask, mask_mask;
+ vector unsigned char src_mask, mask_mask;
while (width && ((uintptr_t)dest & 15))
{
@@ -782,7 +788,7 @@ vmx_combine_out_reverse_u_no_mask (uint32_t * dest,
{
int i;
vector unsigned int vdest, vsrc;
- vector unsigned char tmp1, tmp2, src_mask;
+ vector unsigned char src_mask;
while (width && ((uintptr_t)dest & 15))
{
@@ -830,7 +836,7 @@ vmx_combine_out_reverse_u_mask (uint32_t * dest,
{
int i;
vector unsigned int vdest, vsrc, vmask;
- vector unsigned char tmp1, tmp2, src_mask, mask_mask;
+ vector unsigned char src_mask, mask_mask;
while (width && ((uintptr_t)dest & 15))
{
@@ -897,7 +903,7 @@ vmx_combine_atop_u_no_mask (uint32_t * dest,
{
int i;
vector unsigned int vdest, vsrc;
- vector unsigned char tmp1, tmp2, src_mask;
+ vector unsigned char src_mask;
while (width && ((uintptr_t)dest & 15))
{
@@ -949,7 +955,7 @@ vmx_combine_atop_u_mask (uint32_t * dest,
{
int i;
vector unsigned int vdest, vsrc, vmask;
- vector unsigned char tmp1, tmp2, src_mask, mask_mask;
+ vector unsigned char src_mask, mask_mask;
while (width && ((uintptr_t)dest & 15))
{
@@ -1025,7 +1031,7 @@ vmx_combine_atop_reverse_u_no_mask (uint32_t * dest,
{
int i;
vector unsigned int vdest, vsrc;
- vector unsigned char tmp1, tmp2, src_mask;
+ vector unsigned char src_mask;
while (width && ((uintptr_t)dest & 15))
{
@@ -1077,7 +1083,7 @@ vmx_combine_atop_reverse_u_mask (uint32_t * dest,
{
int i;
vector unsigned int vdest, vsrc, vmask;
- vector unsigned char tmp1, tmp2, src_mask, mask_mask;
+ vector unsigned char src_mask, mask_mask;
while (width && ((uintptr_t)dest & 15))
{
@@ -1153,7 +1159,7 @@ vmx_combine_xor_u_no_mask (uint32_t * dest,
{
int i;
vector unsigned int vdest, vsrc;
- vector unsigned char tmp1, tmp2, src_mask;
+ vector unsigned char src_mask;
while (width && ((uintptr_t)dest & 15))
{
@@ -1205,7 +1211,7 @@ vmx_combine_xor_u_mask (uint32_t * dest,
{
int i;
vector unsigned int vdest, vsrc, vmask;
- vector unsigned char tmp1, tmp2, src_mask, mask_mask;
+ vector unsigned char src_mask, mask_mask;
while (width && ((uintptr_t)dest & 15))
{
@@ -1281,7 +1287,7 @@ vmx_combine_add_u_no_mask (uint32_t * dest,
{
int i;
vector unsigned int vdest, vsrc;
- vector unsigned char tmp1, tmp2, src_mask;
+ vector unsigned char src_mask;
while (width && ((uintptr_t)dest & 15))
{
@@ -1327,7 +1333,7 @@ vmx_combine_add_u_mask (uint32_t * dest,
{
int i;
vector unsigned int vdest, vsrc, vmask;
- vector unsigned char tmp1, tmp2, src_mask, mask_mask;
+ vector unsigned char src_mask, mask_mask;
while (width && ((uintptr_t)dest & 15))
{
@@ -1395,7 +1401,7 @@ vmx_combine_src_ca (pixman_implementation_t *imp,
{
int i;
vector unsigned int vdest, vsrc, vmask;
- vector unsigned char tmp1, tmp2, mask_mask, src_mask;
+ vector unsigned char src_mask, mask_mask;
while (width && ((uintptr_t)dest & 15))
{
@@ -1445,7 +1451,7 @@ vmx_combine_over_ca (pixman_implementation_t *imp,
{
int i;
vector unsigned int vdest, vsrc, vmask;
- vector unsigned char tmp1, tmp2, mask_mask, src_mask;
+ vector unsigned char src_mask, mask_mask;
while (width && ((uintptr_t)dest & 15))
{
@@ -1503,7 +1509,7 @@ vmx_combine_over_reverse_ca (pixman_implementation_t *imp,
{
int i;
vector unsigned int vdest, vsrc, vmask;
- vector unsigned char tmp1, tmp2, mask_mask, src_mask;
+ vector unsigned char src_mask, mask_mask;
while (width && ((uintptr_t)dest & 15))
{
@@ -1559,7 +1565,7 @@ vmx_combine_in_ca (pixman_implementation_t *imp,
{
int i;
vector unsigned int vdest, vsrc, vmask;
- vector unsigned char tmp1, tmp2, mask_mask, src_mask;
+ vector unsigned char src_mask, mask_mask;
while (width && ((uintptr_t)dest & 15))
{
@@ -1613,7 +1619,7 @@ vmx_combine_in_reverse_ca (pixman_implementation_t *imp,
{
int i;
vector unsigned int vdest, vsrc, vmask;
- vector unsigned char tmp1, tmp2, mask_mask, src_mask;
+ vector unsigned char mask_mask, src_mask;
while (width && ((uintptr_t)dest & 15))
{
@@ -1668,7 +1674,7 @@ vmx_combine_out_ca (pixman_implementation_t *imp,
{
int i;
vector unsigned int vdest, vsrc, vmask;
- vector unsigned char tmp1, tmp2, mask_mask, src_mask;
+ vector unsigned char mask_mask, src_mask;
while (width && ((uintptr_t)dest & 15))
{
@@ -1725,7 +1731,7 @@ vmx_combine_out_reverse_ca (pixman_implementation_t *imp,
{
int i;
vector unsigned int vdest, vsrc, vmask;
- vector unsigned char tmp1, tmp2, mask_mask, src_mask;
+ vector unsigned char mask_mask, src_mask;
while (width && ((uintptr_t)dest & 15))
{
@@ -1782,7 +1788,7 @@ vmx_combine_atop_ca (pixman_implementation_t *imp,
{
int i;
vector unsigned int vdest, vsrc, vmask, vsrca;
- vector unsigned char tmp1, tmp2, mask_mask, src_mask;
+ vector unsigned char mask_mask, src_mask;
while (width && ((uintptr_t)dest & 15))
{
@@ -1848,7 +1854,7 @@ vmx_combine_atop_reverse_ca (pixman_implementation_t *imp,
{
int i;
vector unsigned int vdest, vsrc, vmask;
- vector unsigned char tmp1, tmp2, mask_mask, src_mask;
+ vector unsigned char mask_mask, src_mask;
while (width && ((uintptr_t)dest & 15))
{
@@ -1911,7 +1917,7 @@ vmx_combine_xor_ca (pixman_implementation_t *imp,
{
int i;
vector unsigned int vdest, vsrc, vmask;
- vector unsigned char tmp1, tmp2, mask_mask, src_mask;
+ vector unsigned char mask_mask, src_mask;
while (width && ((uintptr_t)dest & 15))
{
@@ -1974,7 +1980,7 @@ vmx_combine_add_ca (pixman_implementation_t *imp,
{
int i;
vector unsigned int vdest, vsrc, vmask;
- vector unsigned char tmp1, tmp2, mask_mask, src_mask;
+ vector unsigned char mask_mask, src_mask;
while (width && ((uintptr_t)dest & 15))
{
commit f6a26d09257dde9cd41144120543c8b754de515f
Author: Fernando Seiti Furusato <ferseiti at linux.vnet.ibm.com>
Date: Thu Jun 25 15:59:54 2015 +0300
vmx: adjust macros when loading vectors on ppc64le
Replaced usage of vec_lvsl to direct unaligned assignment
operation (=). That is because, according to Power ABI Specification,
the usage of lvsl is deprecated on ppc64le.
Changed COMPUTE_SHIFT_{MASK,MASKS,MASKC} macro usage to no-op for powerpc
little endian since unaligned access is supported on ppc64le.
v2:
- replace _LITTLE_ENDIAN with WORDS_BIGENDIAN for consistency
- fixed whitespaces and indentation issues
Signed-off-by: Fernando Seiti Furusato <ferseiti at linux.vnet.ibm.com>
Reviewed-by: Adam Jackson <ajax at redhat.com>
Signed-off-by: Oded Gabbay <oded.gabbay at gmail.com>
Acked-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
diff --git a/pixman/pixman-vmx.c b/pixman/pixman-vmx.c
index d0a4fc8..e33d9d9 100644
--- a/pixman/pixman-vmx.c
+++ b/pixman/pixman-vmx.c
@@ -136,6 +136,7 @@ over (vector unsigned int src,
over (pix_multiply (src, mask), \
pix_multiply (srca, mask), dest)
+#ifdef WORDS_BIGENDIAN
#define COMPUTE_SHIFT_MASK(source) \
source ## _mask = vec_lvsl (0, source);
@@ -169,6 +170,30 @@ over (vector unsigned int src,
v ## mask = (typeof(v ## mask)) \
vec_perm (tmp1, tmp2, mask ## _mask);
+#else
+
+/* Now the COMPUTE_SHIFT_{MASK, MASKS, MASKC} below are just no-op.
+ * They are defined that way because little endian altivec can do unaligned
+ * reads natively and have no need for constructing the permutation pattern
+ * variables.
+ */
+#define COMPUTE_SHIFT_MASK(source)
+
+#define COMPUTE_SHIFT_MASKS(dest, source)
+
+#define COMPUTE_SHIFT_MASKC(dest, source, mask)
+
+# define LOAD_VECTORS(dest, source) \
+ v ## source = *((typeof(v ## source)*)source); \
+ v ## dest = *((typeof(v ## dest)*)dest);
+
+# define LOAD_VECTORSC(dest, source, mask) \
+ v ## source = *((typeof(v ## source)*)source); \
+ v ## dest = *((typeof(v ## dest)*)dest); \
+ v ## mask = *((typeof(v ## mask)*)mask);
+
+#endif /* WORDS_BIGENDIAN */
+
#define LOAD_VECTORSM(dest, source, mask) \
LOAD_VECTORSC (dest, source, mask) \
v ## source = pix_multiply (v ## source, \
commit b3a61703f41c6b34ba2ec9736030e1df04f53ab4
Author: Oded Gabbay <oded.gabbay at gmail.com>
Date: Thu Jun 25 15:59:53 2015 +0300
vmx: fix splat_alpha for ppc64le
The permutation vector isn't correct for LE, so correct its values
in case we are in LE mode.
v2:
- replace _LITTLE_ENDIAN with WORDS_BIGENDIAN for consistency
- change #ifndef to #ifdef for readability
Signed-off-by: Oded Gabbay <oded.gabbay at gmail.com>
Reviewed-by: Adam Jackson <ajax at redhat.com>
Acked-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
diff --git a/pixman/pixman-vmx.c b/pixman/pixman-vmx.c
index c33631c..d0a4fc8 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)
{
+#ifdef WORDS_BIGENDIAN
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));
+#else
+ 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));
+#endif
}
static force_inline vector unsigned int
More information about the xorg-commit
mailing list