From owner-svn-ports-head@freebsd.org Fri Nov 27 01:45:10 2015 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C45CA3A4DC; Fri, 27 Nov 2015 01:45:10 +0000 (UTC) (envelope-from danfe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 37E8E134D; Fri, 27 Nov 2015 01:45:10 +0000 (UTC) (envelope-from danfe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAR1j9tx032841; Fri, 27 Nov 2015 01:45:09 GMT (envelope-from danfe@FreeBSD.org) Received: (from danfe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAR1j9vu032838; Fri, 27 Nov 2015 01:45:09 GMT (envelope-from danfe@FreeBSD.org) Message-Id: <201511270145.tAR1j9vu032838@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: danfe set sender to danfe@FreeBSD.org using -f From: Alexey Dokuchaev Date: Fri, 27 Nov 2015 01:45:09 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r402466 - in head/graphics/seexpr: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2015 01:45:10 -0000 Author: danfe Date: Fri Nov 27 01:45:08 2015 New Revision: 402466 URL: https://svnweb.freebsd.org/changeset/ports/402466 Log: Do not unconditionally use SSE4.1 code: not just it makes it less portable, it might crash on CPUs that do not support those instructions, with SIGILL. Added: head/graphics/seexpr/files/ head/graphics/seexpr/files/patch-CMakeLists.txt (contents, props changed) head/graphics/seexpr/files/patch-src_SeExpr_SeNoise.cpp (contents, props changed) Modified: head/graphics/seexpr/Makefile Modified: head/graphics/seexpr/Makefile ============================================================================== --- head/graphics/seexpr/Makefile Thu Nov 26 22:43:21 2015 (r402465) +++ head/graphics/seexpr/Makefile Fri Nov 27 01:45:08 2015 (r402466) @@ -3,6 +3,7 @@ PORTNAME= seexpr DISTVERSION= 1.0.1.2015.08.29 +PORTREVISION= 1 CATEGORIES= graphics math MAINTAINER= danfe@FreeBSD.org @@ -23,6 +24,10 @@ WRKSRC= ${WRKDIR}/SeExpr-${GH_TAGNAME_E CXXFLAGS+= -I${LOCALBASE}/include +.if ${MACHINE_CPU:Msse41} +CMAKE_ARGS+= -DUSE_SSE41:BOOL=ON +.endif + .include # base flex(1) v2.5.4 is not sufficient @@ -33,7 +38,6 @@ BUILD_DEPENDS+= ${LOCALBASE}/bin/flex:${ post-patch: @${REINPLACE_CMD} -e '//d' ${WRKSRC}/src/SeExpr/SePlatform.h @${REINPLACE_CMD} -e 's, "dl",,' ${WRKSRC}/src/SeExpr/CMakeLists.txt - @${REINPLACE_CMD} -e '/tests/d' ${WRKSRC}/CMakeLists.txt .if ${OSVERSION} < 1000033 @${REINPLACE_CMD} -e '/COMMAND/s,flex,${LOCALBASE}/bin/&,' \ ${WRKSRC}/src/build/macros.cmake Added: head/graphics/seexpr/files/patch-CMakeLists.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/graphics/seexpr/files/patch-CMakeLists.txt Fri Nov 27 01:45:08 2015 (r402466) @@ -0,0 +1,19 @@ +--- CMakeLists.txt.orig 2015-08-28 22:32:38 UTC ++++ CMakeLists.txt +@@ -46,7 +46,10 @@ ELSE(WIN32) + ADD_DEFINITIONS (-Wall -Wextra) + ADD_DEFINITIONS (-pthread) + +- SET( CMAKE_CXX_FLAGS "-fPIC -msse4.1") ++ SET( CMAKE_CXX_FLAGS -fPIC ) ++ IF(USE_SSE41) ++ SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.1" ) ++ ENDIF() + ENDIF(WIN32) + + ## Choose build options +@@ -99,4 +102,3 @@ ADD_SUBDIRECTORY (src/SeExpr) + ADD_SUBDIRECTORY (src/SeExprEditor) + ADD_SUBDIRECTORY (src/doc) + ADD_SUBDIRECTORY (src/demos) +-ADD_SUBDIRECTORY (src/tests) Added: head/graphics/seexpr/files/patch-src_SeExpr_SeNoise.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/graphics/seexpr/files/patch-src_SeExpr_SeNoise.cpp Fri Nov 27 01:45:08 2015 (r402466) @@ -0,0 +1,34 @@ +--- src/SeExpr/SeNoise.cpp.orig 2015-08-28 22:32:38 UTC ++++ src/SeExpr/SeNoise.cpp +@@ -16,7 +16,9 @@ + */ + + #include ++#ifdef __SSE4_1__ + #include ++#endif + + #include "SeExprBuiltins.h" + namespace{ +@@ -25,14 +27,18 @@ namespace{ + #include "SeNoise.h" + namespace SeExpr{ + ++#ifdef __SSE4_1__ + inline double floorSSE(double val) { +- return _mm_cvtsd_f64(_mm_floor_sd(_mm_set_sd(0.0), _mm_set_sd(val))); ++ return _mm_floor_sd(_mm_set_sd(0.0), _mm_set_sd(val))[0]; + } + + inline double roundSSE(double val) { +- return _mm_cvtsd_f64(_mm_round_sd(_mm_set_sd(0.0), _mm_set_sd(val), _MM_FROUND_TO_NEAREST_INT)); ++ return _mm_round_sd(_mm_set_sd(0.0), _mm_set_sd(val), _MM_FROUND_TO_NEAREST_INT)[0]; + } +- ++#else ++#define floorSSE floor ++#define roundSSE round ++#endif + + //! This is the Quintic interpolant from Perlin's Improved Noise Paper + double s_curve(double t) {