Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Sep 2018 20:06:41 +0000 (UTC)
From:      Johannes M Dieterich <jmd@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r479158 - in head/math: . libpgmath libpgmath/files
Message-ID:  <201809062006.w86K6fb3089782@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jmd
Date: Thu Sep  6 20:06:40 2018
New Revision: 479158
URL: https://svnweb.freebsd.org/changeset/ports/479158

Log:
  new port: math/libpgmath
  
  This adds the compiler-callable math intrinsics library libpgmath. It is the
  math library of the flang compiler with support for vector operations.
  
  Patches were in large part adapted from the OpenBSD port.
  
  Reviewed by:	zeising (mentor), mat
  Approved by:	zeising (mentor)
  Obtained from:	Brian Callahan (bcallah@openbsd.org) with adaptations
  Differential Revision:	https://reviews.freebsd.org/D17034

Added:
  head/math/libpgmath/
  head/math/libpgmath/Makefile   (contents, props changed)
  head/math/libpgmath/distinfo   (contents, props changed)
  head/math/libpgmath/files/
  head/math/libpgmath/files/patch-lib_CMakeLists.txt   (contents, props changed)
  head/math/libpgmath/files/patch-lib_common_CMakeLists.txt   (contents, props changed)
  head/math/libpgmath/files/patch-lib_common_acos_fma3_CMakeLists.txt   (contents, props changed)
  head/math/libpgmath/files/patch-lib_common_asin_fma3_CMakeLists.txt   (contents, props changed)
  head/math/libpgmath/files/patch-lib_common_cos_CMakeLists.txt   (contents, props changed)
  head/math/libpgmath/files/patch-lib_common_dispatch.c   (contents, props changed)
  head/math/libpgmath/files/patch-lib_common_exp_fma3_CMakeLists.txt   (contents, props changed)
  head/math/libpgmath/files/patch-lib_common_log_fma3_CMakeLists.txt   (contents, props changed)
  head/math/libpgmath/files/patch-lib_common_pow_fma3_CMakeLists.txt   (contents, props changed)
  head/math/libpgmath/files/patch-lib_common_powi_CMakeLists.txt   (contents, props changed)
  head/math/libpgmath/files/patch-lib_common_sin_CMakeLists.txt   (contents, props changed)
  head/math/libpgmath/files/patch-lib_common_sincos_CMakeLists.txt   (contents, props changed)
  head/math/libpgmath/files/patch-lib_x86__64_CMakeLists.txt   (contents, props changed)
  head/math/libpgmath/files/patch-lib_x86__64_fast_CMakeLists.txt   (contents, props changed)
  head/math/libpgmath/files/patch-lib_x86__64_libm__amd.h   (contents, props changed)
  head/math/libpgmath/pkg-descr   (contents, props changed)
Modified:
  head/math/Makefile

Modified: head/math/Makefile
==============================================================================
--- head/math/Makefile	Thu Sep  6 20:00:44 2018	(r479157)
+++ head/math/Makefile	Thu Sep  6 20:06:40 2018	(r479158)
@@ -312,6 +312,7 @@
     SUBDIR += libmissing
     SUBDIR += libocas
     SUBDIR += liborigin
+    SUBDIR += libpgmath
     SUBDIR += libpoly
     SUBDIR += libqalculate
     SUBDIR += libranlip

Added: head/math/libpgmath/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/math/libpgmath/Makefile	Thu Sep  6 20:06:40 2018	(r479158)
@@ -0,0 +1,38 @@
+# Created by: Johannes M Dieterich <jmd@FreeBSD.org>
+# $FreeBSD$
+
+PORTNAME=	libpgmath
+DISTVERSION=	g20180904
+CATEGORIES=	math
+
+MAINTAINER=	jmd@FreeBSD.org
+COMMENT=	Compiler-callable math intrinsics library
+
+LICENSE=	APACHE20
+LICENSE_FILE=	${WRKSRC}/LICENSE.txt
+
+ONLY_FOR_ARCHS=	amd64
+IGNORE_FreeBSD_10=	not supported on older than 12.0, no cpuid bit support
+IGNORE_FreeBSD_11=	not supported on older than 12.0, no cpuid bit support
+
+BUILD_DEPENDS=	llvm60>=0:devel/llvm60
+RUN_DEPENDS=	llvm60>=0:devel/llvm60
+
+USES=		cmake:outsource compiler:c++11-lib
+USE_LDCONFIG=	yes
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	flang-compiler
+GH_PROJECT=	flang
+GH_TAGNAME=	53e368b
+
+CMAKE_ARGS+=	-DLLVM_CONFIG=${LOCALBASE}/bin/llvm-config60 \
+		-DCMAKE_CXX_COMPILER=${LOCALBASE}/llvm60/bin/clang++ \
+		-DCMAKE_C_COMPILER=${LOCALBASE}/llvm60/bin/clang
+
+WRKSRC_SUBDIR=	runtime/libpgmath
+
+PLIST_FILES=	lib/libpgmath.a \
+		lib/libpgmath.so
+
+.include <bsd.port.mk>

Added: head/math/libpgmath/distinfo
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/math/libpgmath/distinfo	Thu Sep  6 20:06:40 2018	(r479158)
@@ -0,0 +1,3 @@
+TIMESTAMP = 1536097093
+SHA256 (flang-compiler-flang-g20180904-53e368b_GH0.tar.gz) = e9cf2589c6cbad3ec953f4622ee60f7746c6921518d6905aef0526705d83c888
+SIZE (flang-compiler-flang-g20180904-53e368b_GH0.tar.gz) = 4603486

Added: head/math/libpgmath/files/patch-lib_CMakeLists.txt
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/math/libpgmath/files/patch-lib_CMakeLists.txt	Thu Sep  6 20:06:40 2018	(r479158)
@@ -0,0 +1,48 @@
+--- lib/CMakeLists.txt.orig	2018-09-03 06:03:48 UTC
++++ lib/CMakeLists.txt
+@@ -16,19 +16,23 @@
+ 
+ # This value will be the same as CMAKE_SYSTEM_PROCESSOR
+ set(PROCESSOR ${CMAKE_SYSTEM_PROCESSOR})
+-if(${LIBPGMATH_WITH_GENERIC} OR (NOT ${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64|aarch64"))
++if(${LIBPGMATH_WITH_GENERIC} OR (NOT ${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64|amd64|aarch64"))
+   set(PROCESSOR "generic")
+ endif()
+ 
++if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" AND ${PROCESSOR} MATCHES "amd64")
++  set(PROCESSOR "x86_64")
++endif()
++
+ set_property(GLOBAL APPEND PROPERTY "TARGET_OBJECTS")
+ 
+-if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64|AMD64" AND NOT ${LIBPGMATH_WITH_GENERIC})
+-  if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
++if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64|AMD64|amd64" AND NOT ${LIBPGMATH_WITH_GENERIC})
++  if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD")
+ 
+     set(DEFINITIONS_L1
+       HOST_LINUX LINUX LINUX86 LINUX8664 MAXCPUS=256 MAXCPUSL=8 MAXCPUSR=8
+       TARGET_LINUX TARGET_LINUX_X86 TARGET_LINUX_X8664 TARGET_X86 TARGET_X8664
+-      __gnu_linux__ PG_PIC)
++      __gnu_linux__ linux PG_PIC)
+     set(FLAGS_L1 "-m64 -O3 ")
+ 
+     set(DEFINITIONS_L2
+@@ -210,7 +214,7 @@ else()
+ endif()
+ 
+ include_directories(common)
+-if(${PROCESSOR} MATCHES "x86_64|AMD64" AND NOT ${LIBPGMATH_WITH_GENERIC})
++if(${PROCESSOR} MATCHES "x86_64|AMD64|amd64" AND NOT ${LIBPGMATH_WITH_GENERIC})
+   include_directories(x86_64)
+ # elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "ppc64le")
+ #   include_directories(ppc64le)
+@@ -223,7 +227,7 @@ endif()
+ 
+ # Add directories to build
+ add_subdirectory(common)
+-if(${PROCESSOR} MATCHES "x86_64|AMD64" AND NOT ${LIBPGMATH_WITH_GENERIC})
++if(${PROCESSOR} MATCHES "x86_64|AMD64|amd64" AND NOT ${LIBPGMATH_WITH_GENERIC})
+   add_subdirectory(x86_64)
+ # elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "ppc64le")
+ #   add_subdirectory(ppc64le)

Added: head/math/libpgmath/files/patch-lib_common_CMakeLists.txt
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/math/libpgmath/files/patch-lib_common_CMakeLists.txt	Thu Sep  6 20:06:40 2018	(r479158)
@@ -0,0 +1,92 @@
+--- lib/common/CMakeLists.txt.orig	2018-09-03 06:03:48 UTC
++++ lib/common/CMakeLists.txt
+@@ -17,7 +17,7 @@
+ include_directories(${CMAKE_CURRENT_SOURCE_DIR})
+ 
+ if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows")
+-  if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64|ppc64le|aarch64" AND NOT ${LIBPGMATH_WITH_GENERIC})
++  if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64|amd64|ppc64le|aarch64" AND NOT ${LIBPGMATH_WITH_GENERIC})
+     add_subdirectory("acos")
+     add_subdirectory("asin")
+     add_subdirectory("exp")
+@@ -33,8 +33,8 @@ get_property(FLAGS GLOBAL PROPERTY "FLAGS_L1")
+ get_property(DEFINITIONS GLOBAL PROPERTY "DEFINITIONS_L1")
+ 
+ set(SRCS)
+-if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64" AND NOT ${LIBPGMATH_WITH_GENERIC})
+-  if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
++if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64|amd64" AND NOT ${LIBPGMATH_WITH_GENERIC})
++  if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD")
+     add_subdirectory("cos")
+     add_subdirectory("cosf")
+     add_subdirectory("sincosf")
+@@ -278,13 +278,13 @@ libmath_add_object_library("${SRCS}" "${FLAGS}" "${DEF
+ set(DEFINITIONS_CMPLX ${DEFINITIONS} MTH_CMPLX_C99_ABI)
+ libmath_add_object_library("${MTH_CMPLX_SRCS}" "${FLAGS}" "${DEFINITIONS_CMPLX}" "common_mth_cmplx")
+ 
+-if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64" AND NOT ${LIBPGMATH_WITH_GENERIC})
++if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64|amd64" AND NOT ${LIBPGMATH_WITH_GENERIC})
+   # Generate mth_128mask.c
+   set(TARGET_NAME "mth_128mask")
+   add_custom_command(OUTPUT ${TARGET_NAME}.c PRE_BUILD
+     COMMAND awk -v MAX_VREG_SIZE=128 -v TARGET=X8664 -f ${LIBPGMATH_TOOLS_DIR}/mth_mask.awk > ${TARGET_NAME}.c)
+   add_custom_target(${TARGET_NAME} ALL DEPENDS "${TARGET_NAME}.c")
+-  if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
++  if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD")
+     set_property(SOURCE ${TARGET_NAME}.c APPEND_STRING PROPERTY COMPILE_FLAGS "-march=core2")
+   elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+     set_property(SOURCE ${TARGET_NAME}.c APPEND_STRING PROPERTY COMPILE_FLAGS "-msse2")
+@@ -297,7 +297,7 @@ if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64" AND NOT 
+   add_custom_command(OUTPUT ${TARGET_NAME}.c PRE_BUILD
+     COMMAND awk -v MAX_VREG_SIZE=128 -v TARGET=X8664 -f ${LIBPGMATH_TOOLS_DIR}/mth_generic_frp.awk > ${TARGET_NAME}.c)
+   add_custom_target(${TARGET_NAME} ALL DEPENDS "${TARGET_NAME}.c")
+-  if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
++  if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD")
+     set_property(SOURCE ${TARGET_NAME}.c APPEND_STRING PROPERTY COMPILE_FLAGS "-march=core2")
+   elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+     set_property(SOURCE ${TARGET_NAME}.c APPEND_STRING PROPERTY COMPILE_FLAGS "-msse2")
+@@ -310,7 +310,7 @@ if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64" AND NOT 
+   add_custom_command(OUTPUT ${TARGET_NAME}.c PRE_BUILD
+     COMMAND awk -v MAX_VREG_SIZE=256 -v TARGET=X8664 -f ${LIBPGMATH_TOOLS_DIR}/mth_mask.awk > ${TARGET_NAME}.c)
+   add_custom_target(${TARGET_NAME} ALL DEPENDS "${TARGET_NAME}.c")
+-  if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
++  if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD")
+     set_property(SOURCE ${TARGET_NAME}.c APPEND_STRING PROPERTY COMPILE_FLAGS "-march=sandybridge")
+   elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+     set_property(SOURCE ${TARGET_NAME}.c APPEND_STRING PROPERTY COMPILE_FLAGS "-mavx")
+@@ -323,7 +323,7 @@ if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64" AND NOT 
+   add_custom_command(OUTPUT ${TARGET_NAME}.c PRE_BUILD
+     COMMAND awk -v MAX_VREG_SIZE=256 -v TARGET=X8664 -f ${LIBPGMATH_TOOLS_DIR}/mth_generic_frp.awk > ${TARGET_NAME}.c)
+   add_custom_target(${TARGET_NAME} ALL DEPENDS "${TARGET_NAME}.c")
+-  if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
++  if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD")
+     set_property(SOURCE ${TARGET_NAME}.c APPEND_STRING PROPERTY COMPILE_FLAGS "-march=sandybridge")
+   elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+     set_property(SOURCE ${TARGET_NAME}.c APPEND_STRING PROPERTY COMPILE_FLAGS "-mavx")
+@@ -337,7 +337,7 @@ if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64" AND NOT 
+     COMMAND awk -v MAX_VREG_SIZE=512 -v TARGET=X8664 -f ${LIBPGMATH_TOOLS_DIR}/mth_mask.awk > ${TARGET_NAME}.c)
+   add_custom_target(${TARGET_NAME} ALL DEPENDS "${TARGET_NAME}.c")
+   set_property(SOURCE ${TARGET_NAME}.c APPEND_STRING PROPERTY COMPILE_FLAGS "")
+-  if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
++  if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD")
+     set_property(SOURCE ${TARGET_NAME}.c APPEND_STRING PROPERTY COMPILE_FLAGS "-mtune=knl -march=knl")
+   elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+     set_property(SOURCE ${TARGET_NAME}.c APPEND_STRING PROPERTY COMPILE_FLAGS "-mavx512f -mfma")
+@@ -350,7 +350,7 @@ if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64" AND NOT 
+   add_custom_command(OUTPUT ${TARGET_NAME}.c PRE_BUILD
+     COMMAND awk -v MAX_VREG_SIZE=512 -v TARGET=X8664 -f ${LIBPGMATH_TOOLS_DIR}/mth_generic_frp.awk > ${TARGET_NAME}.c)
+   add_custom_target(${TARGET_NAME} ALL DEPENDS "${TARGET_NAME}.c")
+-  if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
++  if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD")
+     set_property(SOURCE ${TARGET_NAME}.c APPEND_STRING PROPERTY COMPILE_FLAGS "-mtune=knl -march=knl")
+   elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+     set_property(SOURCE ${TARGET_NAME}.c APPEND_STRING PROPERTY COMPILE_FLAGS "-mavx512f -mfma")
+@@ -363,7 +363,7 @@ if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64" AND NOT 
+   add_custom_command(OUTPUT ${TARGET_NAME}.c PRE_BUILD
+     COMMAND awk -v MAX_VREG_SIZE=512 -v TARGET=X8664 -f ${LIBPGMATH_TOOLS_DIR}/mth_z2yy.awk > ${TARGET_NAME}.c)
+   add_custom_target(${TARGET_NAME} ALL DEPENDS "${TARGET_NAME}.c")
+-  if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
++  if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD")
+     set_property(SOURCE ${TARGET_NAME}.c APPEND_STRING PROPERTY COMPILE_FLAGS "-mtune=knl -march=knl")
+   elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+     set_property(SOURCE ${TARGET_NAME}.c APPEND_STRING PROPERTY COMPILE_FLAGS "-mavx512f -mfma")

Added: head/math/libpgmath/files/patch-lib_common_acos_fma3_CMakeLists.txt
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/math/libpgmath/files/patch-lib_common_acos_fma3_CMakeLists.txt	Thu Sep  6 20:06:40 2018	(r479158)
@@ -0,0 +1,13 @@
+--- lib/common/acos/fma3/CMakeLists.txt.orig	2018-09-03 06:03:48 UTC
++++ lib/common/acos/fma3/CMakeLists.txt
+@@ -21,8 +21,8 @@ get_property(FLAGS GLOBAL PROPERTY "FLAGS_L2")
+ set(SRCS)
+ 
+ # Set source files, compiler flags and definitions
+-if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64")
+-  if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|Darwin")
++if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64|amd64")
++  if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD|Darwin")
+     set(SRCS
+       sdacos.cpp
+       ssacos.cpp

Added: head/math/libpgmath/files/patch-lib_common_asin_fma3_CMakeLists.txt
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/math/libpgmath/files/patch-lib_common_asin_fma3_CMakeLists.txt	Thu Sep  6 20:06:40 2018	(r479158)
@@ -0,0 +1,13 @@
+--- lib/common/asin/fma3/CMakeLists.txt.orig	2018-09-03 06:03:48 UTC
++++ lib/common/asin/fma3/CMakeLists.txt
+@@ -21,8 +21,8 @@ get_property(FLAGS GLOBAL PROPERTY "FLAGS_L2")
+ set(SRCS)
+ 
+ # Set source files, compiler flags and definitions
+-if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64")
+-  if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|Darwin")
++if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64|amd64")
++  if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD|Darwin")
+     set(SRCS
+       sdasin.cpp
+       ssasin.cpp

Added: head/math/libpgmath/files/patch-lib_common_cos_CMakeLists.txt
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/math/libpgmath/files/patch-lib_common_cos_CMakeLists.txt	Thu Sep  6 20:06:40 2018	(r479158)
@@ -0,0 +1,13 @@
+--- lib/common/cos/CMakeLists.txt.orig	2018-09-03 06:03:48 UTC
++++ lib/common/cos/CMakeLists.txt
+@@ -21,8 +21,8 @@ get_property(FLAGS GLOBAL PROPERTY "FLAGS_L1")
+ set(SRCS)
+ 
+ # Set source files, compiler flags and definitions
+-if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64")
+-  if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
++if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64|amd64")
++  if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD")
+     set(COREAVX2_SRCS fd_cos_1_avx2.cpp fd_cos_2_avx2.cpp fd_cos_4_avx2.cpp)
+     set_property(SOURCE ${COREAVX2_SRCS} APPEND_STRING PROPERTY COMPILE_FLAGS "-Wno-attributes -mtune=core-avx2 -march=core-avx2 ")
+     set_property(SOURCE ${COREAVX2_SRCS} APPEND_STRING PROPERTY COMPILE_DEFINITIONS "PGI ")

Added: head/math/libpgmath/files/patch-lib_common_dispatch.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/math/libpgmath/files/patch-lib_common_dispatch.c	Thu Sep  6 20:06:40 2018	(r479158)
@@ -0,0 +1,14 @@
+--- lib/common/dispatch.c.orig	2018-09-04 21:58:51 UTC
++++ lib/common/dispatch.c
+@@ -62,11 +62,7 @@
+ #include <time.h>
+ #include <unistd.h>
+ #include <inttypes.h>
+-#ifdef TARGET_LINUX_X8664
+-#include <malloc.h>
+-#else
+ #include <sched.h>
+-#endif
+ #include "mth_tbldefs.h"
+ #if defined(TARGET_LINUX_X8664) || defined(TARGET_OSX_X8664)
+ #include "cpuid8664.h"

Added: head/math/libpgmath/files/patch-lib_common_exp_fma3_CMakeLists.txt
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/math/libpgmath/files/patch-lib_common_exp_fma3_CMakeLists.txt	Thu Sep  6 20:06:40 2018	(r479158)
@@ -0,0 +1,13 @@
+--- lib/common/exp/fma3/CMakeLists.txt.orig	2018-09-03 06:03:48 UTC
++++ lib/common/exp/fma3/CMakeLists.txt
+@@ -21,8 +21,8 @@ get_property(FLAGS GLOBAL PROPERTY "FLAGS_L2")
+ set(SRCS)
+ 
+ # Set source files, compiler flags and definitions
+-if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64")
+-  if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|Darwin")
++if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64|amd64")
++  if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD|Darwin")
+     set(SRCS
+       sdexp.cpp
+       ssexp.cpp

Added: head/math/libpgmath/files/patch-lib_common_log_fma3_CMakeLists.txt
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/math/libpgmath/files/patch-lib_common_log_fma3_CMakeLists.txt	Thu Sep  6 20:06:40 2018	(r479158)
@@ -0,0 +1,13 @@
+--- lib/common/log/fma3/CMakeLists.txt.orig	2018-09-03 06:03:48 UTC
++++ lib/common/log/fma3/CMakeLists.txt
+@@ -21,8 +21,8 @@ get_property(FLAGS GLOBAL PROPERTY "FLAGS_L2")
+ set(SRCS)
+ 
+ # Set source files, compiler flags and definitions
+-if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64")
+-  if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|Darwin")
++if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64|amd64")
++  if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD|Darwin")
+     set(SRCS
+       fdlog1.cpp
+       fdlog2.cpp

Added: head/math/libpgmath/files/patch-lib_common_pow_fma3_CMakeLists.txt
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/math/libpgmath/files/patch-lib_common_pow_fma3_CMakeLists.txt	Thu Sep  6 20:06:40 2018	(r479158)
@@ -0,0 +1,13 @@
+--- lib/common/pow/fma3/CMakeLists.txt.orig	2018-09-03 06:03:48 UTC
++++ lib/common/pow/fma3/CMakeLists.txt
+@@ -21,8 +21,8 @@ get_property(FLAGS GLOBAL PROPERTY "FLAGS_L2")
+ set(SRCS)
+ 
+ # Set source files, compiler flags and definitions
+-if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64")
+-  if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|Darwin")
++if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64|amd64")
++  if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD|Darwin")
+     set(SRCS
+       sdpow.cpp
+       sspow.cpp

Added: head/math/libpgmath/files/patch-lib_common_powi_CMakeLists.txt
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/math/libpgmath/files/patch-lib_common_powi_CMakeLists.txt	Thu Sep  6 20:06:40 2018	(r479158)
@@ -0,0 +1,13 @@
+--- lib/common/powi/CMakeLists.txt.orig	2018-09-03 06:03:48 UTC
++++ lib/common/powi/CMakeLists.txt
+@@ -19,8 +19,8 @@ get_property(DEFINITIONS GLOBAL PROPERTY "DEFINITIONS_
+ get_property(FLAGS GLOBAL PROPERTY "FLAGS_L1")
+ 
+ # Set source files, compiler flags and definitions
+-if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64")
+-  if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
++if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64|amd64")
++  if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD")
+     # Set source files
+     set(CORE2_SRCS fxpowi.c pxpowi.c)
+     set_property(SOURCE ${CORE2_SRCS} APPEND_STRING PROPERTY COMPILE_FLAGS "-march=core2 ")

Added: head/math/libpgmath/files/patch-lib_common_sin_CMakeLists.txt
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/math/libpgmath/files/patch-lib_common_sin_CMakeLists.txt	Thu Sep  6 20:06:40 2018	(r479158)
@@ -0,0 +1,13 @@
+--- lib/common/sin/CMakeLists.txt.orig	2018-09-03 06:03:48 UTC
++++ lib/common/sin/CMakeLists.txt
+@@ -21,8 +21,8 @@ get_property(FLAGS GLOBAL PROPERTY "FLAGS_L1")
+ set(SRCS)
+ 
+ # Set source files, compiler flags and definitions
+-if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64")
+-  if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
++if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64|amd64")
++  if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD")
+     set(COREAVX2_SRCS fd_sin_1_avx2.cpp fd_sin_2_avx2.cpp fd_sin_4_avx2.cpp)
+     set_property(SOURCE ${COREAVX2_SRCS} APPEND_STRING PROPERTY COMPILE_FLAGS "-Wno-attributes -mtune=core-avx2 -march=core-avx2 ")
+     set_property(SOURCE ${COREAVX2_SRCS} APPEND_STRING PROPERTY COMPILE_DEFINITIONS "PGI ")

Added: head/math/libpgmath/files/patch-lib_common_sincos_CMakeLists.txt
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/math/libpgmath/files/patch-lib_common_sincos_CMakeLists.txt	Thu Sep  6 20:06:40 2018	(r479158)
@@ -0,0 +1,13 @@
+--- lib/common/sincos/CMakeLists.txt.orig	2018-09-03 06:03:48 UTC
++++ lib/common/sincos/CMakeLists.txt
+@@ -26,8 +26,8 @@ else()
+ endif()
+ 
+ # Set source files, compiler flags and definitions
+-if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64")
+-  if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
++if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64|amd64")
++  if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD")
+     libmath_add_object_library("${SRCS}" "${FLAGS}" "${DEFINITIONS}" "gssincos4")
+     set_property(TARGET gssincos4 APPEND PROPERTY COMPILE_DEFINITIONS SINCOS=__mth_sincos PRECSIZE=4 VLEN=4)
+     libmath_add_object_library("${SRCS}" "${FLAGS}" "${DEFINITIONS}" "gdsincos2")

Added: head/math/libpgmath/files/patch-lib_x86__64_CMakeLists.txt
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/math/libpgmath/files/patch-lib_x86__64_CMakeLists.txt	Thu Sep  6 20:06:40 2018	(r479158)
@@ -0,0 +1,11 @@
+--- lib/x86_64/CMakeLists.txt.orig	2018-09-03 06:03:48 UTC
++++ lib/x86_64/CMakeLists.txt
+@@ -88,7 +88,7 @@ list(APPEND DEFINITIONS _GNU_SOURCE _ISOC99_SOURCE)
+ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+   list(APPEND DEFINITIONS _GNU_SOURCE)
+ endif()
+-set(FLAGS "${FLAGS}-Wall -W -Wstrict-prototypes -Wwrite-strings -Werror ")
++set(FLAGS "${FLAGS}-Wall -W -Wstrict-prototypes -Wwrite-strings ")
+ libmath_add_object_library("${SRCS}" "${FLAGS}" "${DEFINITIONS}" "isoc99")
+ 
+ # isoc99_log2

Added: head/math/libpgmath/files/patch-lib_x86__64_fast_CMakeLists.txt
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/math/libpgmath/files/patch-lib_x86__64_fast_CMakeLists.txt	Thu Sep  6 20:06:40 2018	(r479158)
@@ -0,0 +1,11 @@
+--- lib/x86_64/fast/CMakeLists.txt.orig	2018-09-03 06:03:48 UTC
++++ lib/x86_64/fast/CMakeLists.txt
+@@ -39,7 +39,7 @@ add_custom_command(OUTPUT tmp.${TARGET_NAME}.h PRE_BUI
+ add_custom_target(${TARGET_NAME} ALL
+   DEPENDS tmp.${TARGET_NAME}.h)
+ 
+-if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
++if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD")
+   list(APPEND DEFINITIONS LINUX_ELF)
+ endif()
+ include_directories(${CMAKE_CURRENT_BINARY_DIR})

Added: head/math/libpgmath/files/patch-lib_x86__64_libm__amd.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/math/libpgmath/files/patch-lib_x86__64_libm__amd.h	Thu Sep  6 20:06:40 2018	(r479158)
@@ -0,0 +1,23 @@
+--- lib/x86_64/libm_amd.h.orig	2018-09-03 06:03:48 UTC
++++ lib/x86_64/libm_amd.h
+@@ -68,7 +68,7 @@ regulations applicable in licensee's jurisdiction.
+ 
+ #include <math.h>
+ 
+-#if !defined(TARGET_WIN)
++#if !defined(TARGET_LINUX)
+ typedef long __INT8_T;
+ typedef unsigned long __UINT8_T;
+ 
+@@ -79,6 +79,11 @@ typedef unsigned long long __UINT8_T;
+ 
+ /* Open Tools #defines ldexpf */
+ #undef ldexpf
++
++#define DOMAIN		1
++#define SING		2
++#define OVERFLOW	3
++#define UNDERFLOW	4
+ 
+ #endif
+ 

Added: head/math/libpgmath/pkg-descr
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/math/libpgmath/pkg-descr	Thu Sep  6 20:06:40 2018	(r479158)
@@ -0,0 +1,6 @@
+Compiler-callable math intrinsics library
+
+This is the companion math library for the flang compiler. It features some
+optimized libm-style functions and has vectorization support.
+
+WWW: https://github.com/flang-compiler/flang



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201809062006.w86K6fb3089782>