Merge pull request #24 from AntelopeIO/bmi2define

use compiler provided define to detect if BMI2 is compile-time enabled
This commit is contained in:
Matt Witherspoon
2025-03-21 13:13:43 -04:00
committed by GitHub
2 changed files with 1 additions and 2 deletions
-1
View File
@@ -29,7 +29,6 @@ endif()
if (BN256_ENABLE_BMI2)
target_compile_options(bn256 PUBLIC -mbmi2)
target_compile_definitions(bn256 PRIVATE BN256_HAS_BMI2)
endif()
if(BN256_INSTALL_COMPONENT)
+1 -1
View File
@@ -49,7 +49,7 @@ constexpr bool addcarry_u64(bool carry, uint64_t a, uint64_t b, uint64_t* c) noe
}
constexpr uint64_t mulx_u64(uint64_t a, uint64_t b, uint64_t* hi) noexcept {
#ifdef BN256_HAS_BMI2
#ifdef __BMI2__
if (!std::is_constant_evaluated()) {
unsigned long long local_hi=0;
auto r = _mulx_u64(a, b,&local_hi);