vcpkg/ports/geogram/use-arm64-intrinsics.patch
Nursultan Zarlyk eeb845640a
[geogram] Add arm64-windows support (#26875)
* Add arm64-windows

* Add version

* Remove geogram from ci.baseline

Co-authored-by: Nursultan Zarlyk <nzarlyk@microsoft.com>
2022-09-30 17:03:30 -07:00

17 lines
621 B
Diff

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) {