openpgl: update to 0.6.0

This commit is contained in:
مهدي شينون (Mehdi Chinoune) 2024-02-12 07:13:52 +01:00
parent 57174ee602
commit eecaafce4c
2 changed files with 22 additions and 70 deletions

View File

@ -1,6 +1,6 @@
--- a/openpgl/openpgl_common.h
+++ b/openpgl/openpgl_common.h
@@ -14,6 +14,10 @@
@@ -17,6 +17,10 @@
#include <cmath>
#include <algorithm>
@ -8,74 +8,22 @@
+#include <mm_malloc.h>
+#endif
+
#if defined(__WIN32__) || defined(__MACOSX__)
#if defined(__WIN32__) || ( defined(__MACOSX__) && !defined(__INTEL_COMPILER) )
inline void sincosf(const float theta, float* sin, float* cos)
--- a/third-party/embreeSrc/common/simd/arm/sse2neon.h
+++ b/third-party/embreeSrc/common/simd/arm/sse2neon.h
@@ -1729,12 +1729,14 @@ FORCE_INLINE __m128 _mm_div_ss(__m128 a, __m128 b)
#define _mm_extract_pi16(a, imm) \
(int32_t) vget_lane_u16(vreinterpret_u16_m64(a), (imm))
--- a/third-party/embreeSrc/common/sys/alloc.cpp
+++ b/third-party/embreeSrc/common/sys/alloc.cpp
@@ -4,6 +4,13 @@
#include "alloc.h"
#include "intrinsics.h"
+#if !defined(_WIN32)
// Free aligned memory that was allocated with _mm_malloc.
// https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_free
FORCE_INLINE void _mm_free(void *addr)
{
free(addr);
}
+#ifdef _WIN32
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+#define _mm_malloc(size, alignment) _aligned_malloc(size, alignment)
+#define _mm_free(ptr) _aligned_free(ptr)
+#endif
// Macro: Get the flush zero bits from the MXCSR control and status register.
// The flush zero may contain any of the following flags: _MM_FLUSH_ZERO_ON or
@@ -1913,6 +1915,7 @@ FORCE_INLINE __m128i _mm_loadu_si64(const void *p)
vcombine_s64(vld1_s64((const int64_t *) p), vdup_n_s64(0)));
}
+#if !defined(_WIN32)
// Allocate aligned blocks of memory.
// https://software.intel.com/en-us/
// cpp-compiler-developer-guide-and-reference-allocating-and-freeing-aligned-memory-blocks
@@ -1927,6 +1930,7 @@ FORCE_INLINE void *_mm_malloc(size_t size, size_t align)
return ptr;
return NULL;
}
+#endif
// Conditionally store 8-bit integer elements from a into memory using mask
// (elements are not stored when the highest bit is not set in the corresponding
--- a/third-party/embreeSrc/common/sys/intrinsics.h
+++ b/third-party/embreeSrc/common/sys/intrinsics.h
@@ -89,9 +89,9 @@
#endif
}
-#if defined(__X86_64__)
+#if defined(__X86_64__) || defined (__aarch64__)
__forceinline size_t bsf(size_t v) {
-#if defined(__AVX2__)
+#if defined(__AVX2__) && !defined(__aarch64__)
return _tzcnt_u64(v);
#else
unsigned long r = 0; _BitScanForward64(&r,v); return r;
@@ -113,7 +113,7 @@
return i;
}
-#if defined(__X86_64__)
+#if defined(__X86_64__) || defined (__aarch64__)
__forceinline size_t bscf(size_t& v)
{
size_t i = bsf(v);
@@ -138,9 +138,9 @@
#endif
}
-#if defined(__X86_64__)
+#if defined(__X86_64__) || defined (__aarch64__)
__forceinline size_t bsr(size_t v) {
-#if defined(__AVX2__)
+#if defined(__AVX2__) && !defined(__aarch64__)
return 63 -_lzcnt_u64(v);
#else
unsigned long r = 0; _BitScanReverse64(&r, v); return r;
////////////////////////////////////////////////////////////////////////////////
/// All Platforms

View File

@ -3,7 +3,7 @@
_realname=openpgl
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=0.5.0
pkgver=0.6.0
pkgrel=1
pkgdesc="Intel(R) Open Path Guiding Library (mingw-w64)"
arch=('any')
@ -23,10 +23,10 @@ source=("https://github.com/OpenPathGuidingLibrary/openpgl/archive/v${pkgver}/${
001-add-compile-flags.patch
002-Fix-finding-TBB.patch
003-Fix-building-on-mingw-w64-aarch64.patch)
sha256sums=('1ec806d434d45e43e098f82ee9be0cb74928343898c57490b34ff80584e9805a'
sha256sums=('4192a4096ee3e3d31878cd013f8de23418c8037c576537551f946c4811931c5e'
'27f9b0767f1356224783b87f888e4a91d6e64774f733cab68d813d227fb675c6'
'6703e4dd3f06dfd2d9f28a9d7cb727c9476d231f662fd676883d42a61873aa0f'
'59bba47e18d75a3d7e19f2e0eeca84f1b829b459b70aba0928ad28914bf8729e')
'cbc8a4d388392601aea6e2a4e50a3afa5f0c8b785ac37a05c6379453c18f4797')
prepare() {
cd "${srcdir}"/${_realname}-${pkgver}
@ -45,6 +45,10 @@ build() {
_extra_config+=("-DCMAKE_BUILD_TYPE=Debug")
fi
if [[ ${CARCH} == aarch64 ]]; then
_extra_config+=("-DOPENPGL_ISA_NEON2X=OFF")
fi
CXXFLAGS+=" -D_USE_MATH_DEFINES -w" \
MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
"${MINGW_PREFIX}"/bin/cmake.exe \