View | Details | Raw Unified | Return to bug 257720
Collapse All | Expand All

(-)b/devel/ispc/Makefile (+24 lines)
Lines 3-8 Link Here
3
PORTNAME=	ispc
3
PORTNAME=	ispc
4
DISTVERSIONPREFIX=	v
4
DISTVERSIONPREFIX=	v
5
DISTVERSION=	1.16.1
5
DISTVERSION=	1.16.1
6
PORTREVISION=	1
6
CATEGORIES=	devel
7
CATEGORIES=	devel
7
8
8
MAINTAINER=	yuri@FreeBSD.org
9
MAINTAINER=	yuri@FreeBSD.org
Lines 35-40 BINARY_ALIAS= flex=${LOCALBASE}/bin/flex python=${PYTHON_CMD} m4=${LOCALBASE}/bi Link Here
35
PLIST_FILES=	bin/ispc \
36
PLIST_FILES=	bin/ispc \
36
		bin/check_isa
37
		bin/check_isa
37
38
39
OPTIONS_DEFINE_amd64=	GENX
40
OPTIONS_DEFAULT_amd64=	GENX
41
42
GENX_DESC=		Intel GPU 8/16-wide SIMD support
43
GENX_BUILD_DEPENDS=	${LOCALBASE}/llvm${LLVM_VERSION}/lib/libLLVMGenXIntrinsics.a:devel/vc-intrinsics@llvm${LLVM_VERSION}
44
GENX_LIB_DEPENDS=	libze_loader.so:devel/level-zero \
45
			libLLVMSPIRVLib.so.${LLVM_VERSION}:devel/spirv-llvm-translator@llvm${LLVM_VERSION}
46
GENX_CMAKE_BOOL=	GENX_ENABLED
47
GENX_CMAKE_BOOL_OFF=	ISPCRT_BUILD_TESTS
48
GENX_CMAKE_ON=		-DGENX_DEPS_DIR:PATH="${LOCALBASE}/llvm${LLVM_VERSION}"
49
GENX_PLIST_FILES=	include/ispcrt/ispcrt.h \
50
			include/ispcrt/ispcrt.hpp \
51
			include/ispcrt/ispcrt.isph \
52
			lib/cmake/ispcrt-${PORTVERSION}/Findlevel_zero.cmake \
53
			lib/cmake/ispcrt-${PORTVERSION}/ispc.cmake \
54
			lib/cmake/ispcrt-${PORTVERSION}/ispcrtConfig.cmake \
55
			lib/cmake/ispcrt-${PORTVERSION}/ispcrt_Exports-%%CMAKE_BUILD_TYPE%%.cmake \
56
			lib/cmake/ispcrt-${PORTVERSION}/ispcrt_Exports.cmake \
57
			lib/libispcrt.so \
58
			lib/libispcrt.so.1 \
59
			lib/libispcrt.so.${PORTVERSION} \
60
			lib/libispcrt_static.a
61
38
do-test: # some tests fail: https://github.com/ispc/ispc/issues/1868
62
do-test: # some tests fail: https://github.com/ispc/ispc/issues/1868
39
	@cd ${WRKSRC} && ISPC_HOME=${BUILD_WRKSRC}/bin ./run_tests.py
63
	@cd ${WRKSRC} && ISPC_HOME=${BUILD_WRKSRC}/bin ./run_tests.py
40
64
(-)b/devel/ispc/files/patch-cmake_GenerateBuiltins.cmake (+11 lines)
Added Link Here
1
--- cmake/GenerateBuiltins.cmake.orig	2021-07-15 23:04:31 UTC
2
+++ cmake/GenerateBuiltins.cmake
3
@@ -289,6 +289,8 @@ function(builtin_genx_to_cpp bit resultFileName)
4
         set(os_name "windows")
5
     elseif (APPLE)
6
         set(SKIP ON)
7
+    elseif (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
8
+        set(os_name "freebsd")
9
     else ()
10
         set(os_name "linux")
11
     endif()
(-)b/devel/ispc/files/patch-src_ispc.cpp (+25 lines)
Added Link Here
1
--- src/ispc.cpp.orig	2021-07-15 23:04:31 UTC
2
+++ src/ispc.cpp
3
@@ -1464,10 +1464,22 @@ std::string Target::GetTripleString() const {
4
             triple.setArchName("armv7");
5
         } else if (m_arch == Arch::aarch64) {
6
             triple.setArchName("aarch64");
7
+        } else if (m_arch == Arch::genx32) {
8
+            triple.setArchName("spir");
9
+        } else if (m_arch == Arch::genx64) {
10
+            triple.setArchName("spir64");
11
         } else {
12
             Error(SourcePos(), "Unknown arch.");
13
             exit(1);
14
         }
15
+#ifdef ISPC_GENX_ENABLED
16
+        if (m_arch == Arch::genx32 || m_arch == Arch::genx64) {
17
+            //"spir64-unknown-unknown"
18
+            triple.setVendor(llvm::Triple::VendorType::UnknownVendor);
19
+            triple.setOS(llvm::Triple::OSType::UnknownOS);
20
+            return triple.str();
21
+        }
22
+#endif
23
         triple.setVendor(llvm::Triple::VendorType::UnknownVendor);
24
         triple.setOS(llvm::Triple::OSType::FreeBSD);
25
         break;
(-)b/devel/ispc/files/patch-src_module.cpp (+20 lines)
Added Link Here
1
--- src/module.cpp.orig	2021-07-15 23:04:31 UTC
2
+++ src/module.cpp
3
@@ -102,7 +102,7 @@
4
 #define OCLOC_LIBRARY_NAME "ocloc64.dll"
5
 #elif defined(_WIN32)
6
 #define OCLOC_LIBRARY_NAME "ocloc32.dll"
7
-#elif defined(__linux__)
8
+#elif defined(__linux__) || defined(__FreeBSD__)
9
 #define OCLOC_LIBRARY_NAME "libocloc.so"
10
 #else
11
 #error "Unexpected platform"
12
@@ -1149,7 +1149,7 @@ bool Module::translateToSPIRV(llvm::Module *module, st
13
         llvm::cl::desc("Allow DWARF operations not listed in the OpenCL.DebugInfo.100 "
14
                        "specification (experimental, may produce incompatible SPIR-V "
15
                        "module)"));
16
-#if ISPC_LLVM_VERSION < ISPC_LLVM_12_0
17
+#if ISPC_LLVM_VERSION >= ISPC_LLVM_13_0
18
     Opts.setSPIRVAllowUnknownIntrinsics({"llvm.genx"});
19
 #else
20
     llvm::cl::opt<bool> SPIRVAllowUnknownIntrinsics(

Return to bug 257720