Wed Oct 19 17:14:32 2022 UTC ()
x11/pixman: fix a couple more altivec-related bugs for powerpc.

The patch fixes a couple of bugs related to int32 / vector
initialization, pointed out by the compiler.  Now builds without
warnings.


(he)
diff -r1.83 -r1.84 pkgsrc/x11/pixman/Makefile
diff -r1.70 -r1.71 pkgsrc/x11/pixman/distinfo
diff -r1.2 -r1.3 pkgsrc/x11/pixman/patches/patch-pixman_pixman-vmx.c

cvs diff -r1.83 -r1.84 pkgsrc/x11/pixman/Makefile (expand / switch to unified diff)

--- pkgsrc/x11/pixman/Makefile 2022/10/18 11:01:01 1.83
+++ pkgsrc/x11/pixman/Makefile 2022/10/19 17:14:32 1.84
@@ -1,17 +1,17 @@ @@ -1,17 +1,17 @@
1# $NetBSD: Makefile,v 1.83 2022/10/18 11:01:01 wiz Exp $ 1# $NetBSD: Makefile,v 1.84 2022/10/19 17:14:32 he Exp $
2 2
3DISTNAME= pixman-0.42.0 3DISTNAME= pixman-0.42.0
4PKGREVISION= 1 4PKGREVISION= 2
5CATEGORIES= x11 5CATEGORIES= x11
6MASTER_SITES= ${MASTER_SITE_XORG:=lib/} 6MASTER_SITES= ${MASTER_SITE_XORG:=lib/}
7EXTRACT_SUFX= .tar.xz 7EXTRACT_SUFX= .tar.xz
8 8
9MAINTAINER= pkgsrc-users@NetBSD.org 9MAINTAINER= pkgsrc-users@NetBSD.org
10HOMEPAGE= https://xorg.freedesktop.org/ 10HOMEPAGE= https://xorg.freedesktop.org/
11COMMENT= Library of low-level pixel manipulation routines 11COMMENT= Library of low-level pixel manipulation routines
12LICENSE= mit 12LICENSE= mit
13 13
14CHECK_PORTABILITY_SKIP+= Makefile.am # already patched in Makefile.in 14CHECK_PORTABILITY_SKIP+= Makefile.am # already patched in Makefile.in
15 15
16GNU_CONFIGURE= yes 16GNU_CONFIGURE= yes
17.if ${MACHINE_ARCH} == i386 17.if ${MACHINE_ARCH} == i386

cvs diff -r1.70 -r1.71 pkgsrc/x11/pixman/distinfo (expand / switch to unified diff)

--- pkgsrc/x11/pixman/distinfo 2022/10/18 12:53:09 1.70
+++ pkgsrc/x11/pixman/distinfo 2022/10/19 17:14:32 1.71
@@ -1,8 +1,8 @@ @@ -1,8 +1,8 @@
1$NetBSD: distinfo,v 1.70 2022/10/18 12:53:09 wiz Exp $ 1$NetBSD: distinfo,v 1.71 2022/10/19 17:14:32 he Exp $
2 2
3BLAKE2s (pixman-0.42.0.tar.xz) = 9846ec6a902afa54328b18a9a58cbdf7ad066aa69cbbfddb145b1475c6ad8899 3BLAKE2s (pixman-0.42.0.tar.xz) = 9846ec6a902afa54328b18a9a58cbdf7ad066aa69cbbfddb145b1475c6ad8899
4SHA512 (pixman-0.42.0.tar.xz) = 43d43d1aef9b8a6167098ab68ce2cfd8c0429c4825d40a4fb468b5b51dc1a2035f8bd1b70413e4ecd77deb469b5d558f42171b423e348d5ddd8604c466ffc7d9 4SHA512 (pixman-0.42.0.tar.xz) = 43d43d1aef9b8a6167098ab68ce2cfd8c0429c4825d40a4fb468b5b51dc1a2035f8bd1b70413e4ecd77deb469b5d558f42171b423e348d5ddd8604c466ffc7d9
5Size (pixman-0.42.0.tar.xz) = 652780 bytes 5Size (pixman-0.42.0.tar.xz) = 652780 bytes
6SHA1 (patch-Makefile.in) = 244969af69e43472d43d8cd1556abacf9ec679e0 6SHA1 (patch-Makefile.in) = 244969af69e43472d43d8cd1556abacf9ec679e0
7SHA1 (patch-configure) = 909bf50acfd69700b26bd55a47f93fd77b49226c 7SHA1 (patch-configure) = 909bf50acfd69700b26bd55a47f93fd77b49226c
8SHA1 (patch-pixman_pixman-vmx.c) = 993dde53047d20102d17d10420940cf2210a2049 8SHA1 (patch-pixman_pixman-vmx.c) = 1139e520dbc7ea4066ab5f0b4d98345c87a37267

cvs diff -r1.2 -r1.3 pkgsrc/x11/pixman/patches/patch-pixman_pixman-vmx.c (expand / switch to unified diff)

--- pkgsrc/x11/pixman/patches/patch-pixman_pixman-vmx.c 2022/10/18 12:53:10 1.2
+++ pkgsrc/x11/pixman/patches/patch-pixman_pixman-vmx.c 2022/10/19 17:14:32 1.3
@@ -1,22 +1,56 @@ @@ -1,22 +1,56 @@
1$NetBSD: patch-pixman_pixman-vmx.c,v 1.2 2022/10/18 12:53:10 wiz Exp $ 1$NetBSD: patch-pixman_pixman-vmx.c,v 1.3 2022/10/19 17:14:32 he Exp $
2 2
3Add a fix so that this builds on NetBSD/powerpc. Otherwise we get 3Add a fix so that this builds on NetBSD/powerpc. Otherwise we get
4pixman-vmx.c:2936:5: error: subscripted value is neither array nor pointer 4pixman-vmx.c:2936:5: error: subscripted value is neither array nor pointer
 5Also fix something which clearly must be bugs with loading
 6vector registers from single 32-bit ints.
 7
5https://gitlab.freedesktop.org/pixman/pixman/-/merge_requests/64/ 8https://gitlab.freedesktop.org/pixman/pixman/-/merge_requests/64/
6 9
7--- pixman/pixman-vmx.c.orig 2016-01-04 09:13:54.000000000 +0000 10--- pixman/pixman-vmx.c.orig 2016-01-04 09:13:54.000000000 +0000
8+++ pixman/pixman-vmx.c 11+++ pixman/pixman-vmx.c
9@@ -2913,32 +2913,29 @@ scaled_nearest_scanline_vmx_8888_8888_OV 12@@ -2913,32 +2913,29 @@ scaled_nearest_scanline_vmx_8888_8888_OV
 13@@ -292,7 +292,9 @@ create_mask_1x32_128 (const uint32_t *sr
 14 static force_inline vector unsigned int
 15 create_mask_32_128 (uint32_t mask)
 16 {
 17- return create_mask_1x32_128(&mask);
 18+ uint32_t nmask[4]; /* vector sized array */
 19+ nmask[3] = nmask[2] = nmask[1] = nmask[0] = mask;
 20+ return create_mask_1x32_128(nmask);
 21 }
 22
 23 static force_inline vector unsigned int
 24@@ -2435,6 +2437,9 @@ vmx_fill (pixman_implementation_t *imp,
 25 uint8_t *byte_line;
 26
 27 vector unsigned int vfiller;
 28+ uint32_t fillers[4];
 29+
 30+ fillers[3] = fillers[2] = fillers[1] = fillers[0] = filler;
 31
 32 if (bpp == 8)
 33 {
 34@@ -2471,7 +2476,7 @@ vmx_fill (pixman_implementation_t *imp,
 35 return FALSE;
 36 }
 37
 38- vfiller = create_mask_1x32_128(&filler);
 39+ vfiller = create_mask_1x32_128(fillers);
 40
 41 while (height--)
 42 {
 43@@ -2913,32 +2918,29 @@ scaled_nearest_scanline_vmx_8888_8888_OV
10  44
11 while (w >= 4) 45 while (w >= 4)
12 { 46 {
13- vector unsigned int tmp; 47- vector unsigned int tmp;
14- uint32_t tmp1, tmp2, tmp3, tmp4; 48- uint32_t tmp1, tmp2, tmp3, tmp4;
15+ union { 49+ union {
16+ vector unsigned int tmp; 50+ vector unsigned int tmp;
17+ uint32_t tmp1[4]; 51+ uint32_t tmp1[4];
18+ } u; 52+ } u;
19  53
20- tmp1 = *(ps + pixman_fixed_to_int (vx)); 54- tmp1 = *(ps + pixman_fixed_to_int (vx));
21+ u.tmp1[0] = *(ps + pixman_fixed_to_int (vx)); 55+ u.tmp1[0] = *(ps + pixman_fixed_to_int (vx));
22 vx += unit_x; 56 vx += unit_x;