mirror of
https://github.com/AntelopeIO/bn256.git
synced 2026-07-21 13:53:29 +00:00
Merge pull request #24 from AntelopeIO/bmi2define
use compiler provided define to detect if BMI2 is compile-time enabled
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user