Use native checks instead of XMRIG_ARMv8.

This commit is contained in:
XMRig 2018-06-03 00:09:59 +07:00
parent d900a6d9dd
commit 26ee5028e1
2 changed files with 8 additions and 3 deletions

View file

@ -47,8 +47,11 @@ void Cpu::initCommon()
{ {
memcpy(m_brand, "Unknown", 7); memcpy(m_brand, "Unknown", 7);
# if defined(XMRIG_ARMv8) # if defined (__arm64__) || defined (__aarch64__)
m_flags |= X86_64; m_flags |= X86_64;
# endif
# if __ARM_FEATURE_CRYPTO
m_flags |= AES; m_flags |= AES;
# endif # endif
} }

View file

@ -73,7 +73,7 @@ static inline __attribute__((always_inline)) __m128i _mm_set_epi64x(const uint64
} }
#ifdef XMRIG_ARMv8 #if __ARM_FEATURE_CRYPTO
static inline __attribute__((always_inline)) __m128i _mm_aesenc_si128(__m128i v, __m128i rkey) static inline __attribute__((always_inline)) __m128i _mm_aesenc_si128(__m128i v, __m128i rkey)
{ {
alignas(16) const __m128i zero = { 0 }; alignas(16) const __m128i zero = { 0 };
@ -82,6 +82,8 @@ static inline __attribute__((always_inline)) __m128i _mm_aesenc_si128(__m128i v,
#else #else
static inline __attribute__((always_inline)) __m128i _mm_aesenc_si128(__m128i v, __m128i rkey) static inline __attribute__((always_inline)) __m128i _mm_aesenc_si128(__m128i v, __m128i rkey)
{ {
alignas(16) const __m128i zero = { 0 };
return zero;
} }
#endif #endif
@ -96,7 +98,7 @@ static inline __attribute__((always_inline)) uint64_t _mm_cvtsi128_si64(__m128i
#define EXTRACT64(X) _mm_cvtsi128_si64(X) #define EXTRACT64(X) _mm_cvtsi128_si64(X)
#if defined(XMRIG_ARMv8) #if defined (__arm64__) || defined (__aarch64__)
static inline uint64_t __umul128(uint64_t a, uint64_t b, uint64_t* hi) static inline uint64_t __umul128(uint64_t a, uint64_t b, uint64_t* hi)
{ {
unsigned __int128 r = (unsigned __int128) a * (unsigned __int128) b; unsigned __int128 r = (unsigned __int128) a * (unsigned __int128) b;