From 880d6bcbf0f013054557f3d4bc97e3ea359361a9 Mon Sep 17 00:00:00 2001 From: Konstantinos Margaritis Date: Mon, 19 Feb 2024 19:42:14 +0800 Subject: [PATCH] fix arm build --- src/util/arch/arm/simd_utils.h | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/util/arch/arm/simd_utils.h b/src/util/arch/arm/simd_utils.h index 858866d7..b097e66a 100644 --- a/src/util/arch/arm/simd_utils.h +++ b/src/util/arch/arm/simd_utils.h @@ -182,7 +182,7 @@ static really_inline m128 set1_2x64(u64a c) { } static really_inline m128 insert32_m128(m128 in, u32 val, const int imm) { - return vsetq_lane_u32((uint32x4_t)in, val, imm); + return (m128) vsetq_lane_u32(val, (uint32x4_t)in, imm); } static really_inline u32 movd(const m128 in) { @@ -199,12 +199,6 @@ m128 load_m128_from_u64a(const u64a *p) { return (m128) vsetq_lane_u64(*p, (uint64x2_t) zeroes128(), 0); } -/* another form of movq */ -static really_inline -m128 load_m128_from_u64a(const u64a *p) { - return (m128) vsetq_lane_u64(*p, (uint64x2_t) zeroes128(), 0); -} - static really_inline u32 extract32from128(const m128 in, unsigned imm) { #if defined(HAVE__BUILTIN_CONSTANT_P) if (__builtin_constant_p(imm)) { @@ -449,4 +443,14 @@ m128 set2x64(u64a hi, u64a lo) { return (m128) vld1q_u64((uint64_t *) data); } +static really_inline +m128 widenlo128(m128 x) { + return (m128) vmovl_u32(vget_low_u32((uint32x4_t)x)); +} + +static really_inline +m128 widenhi128(m128 x) { + return (m128) vmovl_u32(vget_high_u32((uint32x4_t)x)); +} + #endif // ARCH_ARM_SIMD_UTILS_H