From fd2eabd0716477e29008da6772c499b855f6d48c Mon Sep 17 00:00:00 2001 From: Konstantinos Margaritis Date: Tue, 7 Dec 2021 08:43:52 +0000 Subject: [PATCH] fix clang-release-arm compilation --- src/util/arch/arm/simd_utils.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/util/arch/arm/simd_utils.h b/src/util/arch/arm/simd_utils.h index d1ab583f..764d26fd 100644 --- a/src/util/arch/arm/simd_utils.h +++ b/src/util/arch/arm/simd_utils.h @@ -419,9 +419,10 @@ m128 load_m128_from_u64a(const u64a *p) { } static really_inline u32 extract32from128(const m128 in, unsigned imm) { -#if defined(HS_OPTIMIZE) - return vgetq_lane_u32((uint32x4_t) in, imm); -#else +#if defined(HAVE__BUILTIN_CONSTANT_P) + if (__builtin_constant_p(b)) { + return vgetq_lane_u32((uint32x4_t) in, imm); +#endif switch (imm) { case 0: return vgetq_lane_u32((uint32x4_t) in, 0); @@ -439,13 +440,13 @@ static really_inline u32 extract32from128(const m128 in, unsigned imm) { return 0; break; } -#endif } static really_inline u64a extract64from128(const m128 in, unsigned imm) { -#if defined(HS_OPTIMIZE) - return vgetq_lane_u64((uint64x2_t) in, imm); -#else +#if defined(HAVE__BUILTIN_CONSTANT_P) + if (__builtin_constant_p(b)) { + return vgetq_lane_u64((uint64x2_t) in, imm); +#endif switch (imm) { case 0: return vgetq_lane_u64((uint64x2_t) in, 0); @@ -457,7 +458,6 @@ static really_inline u64a extract64from128(const m128 in, unsigned imm) { return 0; break; } -#endif } static really_inline m128 low64from128(const m128 in) {