vcpkg/ports/geogram/use-arm64-intrinsics.patch

17 lines
621 B
Diff
Raw Normal View History

diff --git a/src/lib/geogram/delaunay/periodic_delaunay_3d.cpp b/src/lib/geogram/delaunay/periodic_delaunay_3d.cpp
index 352ea76..34e73e2 100644
--- a/src/lib/geogram/delaunay/periodic_delaunay_3d.cpp
+++ b/src/lib/geogram/delaunay/periodic_delaunay_3d.cpp
@@ -122,7 +122,11 @@ namespace {
#if defined(GEO_COMPILER_GCC_FAMILY)
return GEO::index_t(Numeric::uint32(__builtin_popcount(x)));
#elif defined(GEO_COMPILER_MSVC)
+ #if defined(_M_ARM64)
+ return GEO::index_t(_CountOneBits(x));
+ #else
return GEO::index_t(__popcnt(x));
+ #endif
#else
int result = 0;
for(int b=0; b<32; ++b) {