From owner-freebsd-x11@FreeBSD.ORG Fri Jan 20 14:27:43 2012 Return-Path: Delivered-To: x11@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 426BB1065670 for ; Fri, 20 Jan 2012 14:27:43 +0000 (UTC) (envelope-from danfe@regency.nsu.ru) Received: from mx.nsu.ru (r2b9.nsu.ru [212.192.164.39]) by mx1.freebsd.org (Postfix) with ESMTP id D55498FC14 for ; Fri, 20 Jan 2012 14:27:42 +0000 (UTC) Received: from regency.nsu.ru ([193.124.210.26]) by mx.nsu.ru with esmtp (Exim 4.69) (envelope-from ) id 1RoEXs-0005ir-B7 for x11@freebsd.org; Fri, 20 Jan 2012 20:30:20 +0700 Received: from regency.nsu.ru (localhost [127.0.0.1]) by regency.nsu.ru (8.14.2/8.14.2) with ESMTP id q0KDXZeB089032 for ; Fri, 20 Jan 2012 20:33:35 +0700 (NOVT) (envelope-from danfe@regency.nsu.ru) Received: (from danfe@localhost) by regency.nsu.ru (8.14.2/8.14.2/Submit) id q0KDXBat088990 for x11@freebsd.org; Fri, 20 Jan 2012 20:33:11 +0700 (NOVT) (envelope-from danfe) Date: Fri, 20 Jan 2012 20:33:11 +0700 From: Alexey Dokuchaev To: x11@freebsd.org Message-ID: <20120120133310.GA83690@regency.nsu.ru> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="5vNYLRcllDrimb99" Content-Disposition: inline User-Agent: Mutt/1.4.2.1i Cc: Subject: x11/pixman: suggestions and a patch X-BeenThere: freebsd-x11@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: X11 on FreeBSD -- maintaining and support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 14:27:43 -0000 --5vNYLRcllDrimb99 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi there, I was always confused when rebuilding x11/pixman by these lines of Makefile: .if defined(WITHOUT_SIMD) CONFIGURE_ARGS= --disable-vmx --disable-arm-simd .if ${ARCH:Namd64} CONFIGURE_ARGS+= --disable-mmx --disable-sse2 .endif .endif 1) ${ARCH:Namd64} is hardly readable, we usually spell it as ${ARCH} != "amd64" 2) superfluous blank lines make this code hard to read as well 3) also, it seems that features handling is not complete for current version of pixman, per ./configure --help: --disable-openmp do not use OpenMP --disable-mmx disable x86 MMX fast paths --disable-sse2 disable SSE2 fast paths --disable-vmx disable VMX fast paths --disable-arm-simd disable ARM SIMD fast paths --disable-arm-neon disable ARM NEON fast paths --disable-arm-iwmmxt disable ARM IWMMXT fast paths Most importantly, we usually check for CPU capabilities by examining MACHINE_CPU variable. While it currently does not have proper support for ARM (but then again, neither does our ports collection), MMX and SSE2 detection is normally done this way (cf. security/john, www/chromium). As a bonus, check for amd64 (where MMX and SSE2 are always present) is no longer required. Default package on cluster would not change, as it is built for default CPUTYPE (i486), which ensures conservative options. Do you think we should flip the SIMD knob to on by default maybe? 4) you might consider adding --disable-arm-neon and --disable-arm-iwmmxt, and maybe prodide an OPTION for OpenMP support (but I won't touch these things since I lack proper hardware support to test) 5) I am also not sure why post-patch: sed(1) hack for configure script is needed: isn't --disable-gtk not enough? Please consider (approve or commit yourself) attach patch. I've rephrased OPTION line a bit to fit in 80-char terminal while I am here. ./danfe --5vNYLRcllDrimb99 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="pixman.diff" Index: Makefile =================================================================== RCS file: /home/danfe/fbsd/FreeBSD-CVS/ports/x11/pixman/Makefile,v retrieving revision 1.20 diff -u -r1.20 Makefile --- Makefile 28 Nov 2011 23:35:08 -0000 1.20 +++ Makefile 20 Jan 2012 13:23:54 -0000 @@ -17,17 +17,18 @@ USE_PERL5_BUILD=yes USE_GNOME= ltverhack:9 -OPTIONS= SIMD "Enable autodetection of SIMD features (MMX, SSE2, VMX)" off +OPTIONS= SIMD "Enable SIMD features autodetection (MMX, SSE2, VMX)" off .include .if defined(WITHOUT_SIMD) CONFIGURE_ARGS= --disable-vmx --disable-arm-simd - -.if ${ARCH:Namd64} -CONFIGURE_ARGS+= --disable-mmx --disable-sse2 -.endif - +. if ! ${MACHINE_CPU:Mmmx} +CONFIGURE_ARGS+= --disable-mmx +. endif +. if ! ${MACHINE_CPU:Msse2} +CONFIGURE_ARGS+= --disable-sse2 +. endif .endif post-patch: --5vNYLRcllDrimb99--