From e1b179a7d3848fe45a2bfc99dc1447c819129967 Mon Sep 17 00:00:00 2001 From: Artyom Tarasenko Date: Wed, 14 Feb 2018 08:06:43 -0500 Subject: [PATCH] qemu-common: add VEC_OR macro Intel C Compiler version 15.0.3.187 Build 20150407 doesn't support '|' function for non floating-point simd operands. Define VEC_OR macro which uses _mm_or_si128 supported both in icc and gcc on x86 platform. Backports commit 34664507c7f038842f20a2c787915680b1fabba2 from qemu --- qemu/include/qemu-common.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qemu/include/qemu-common.h b/qemu/include/qemu-common.h index 135a48f3..940ee79e 100644 --- a/qemu/include/qemu-common.h +++ b/qemu/include/qemu-common.h @@ -216,6 +216,7 @@ static inline uint64_t muldiv64(uint64_t a, uint32_t b, uint32_t c) #define VECTYPE __vector unsigned char #define SPLAT(p) vec_splat(vec_ld(0, p), 0) #define ALL_EQ(v1, v2) vec_all_eq(v1, v2) +#define VEC_OR(v1, v2) ((v1) | (v2)) /* altivec.h may redefine the bool macro as vector type. * Reset it to POSIX semantics. */ #define bool _Bool @@ -224,10 +225,12 @@ static inline uint64_t muldiv64(uint64_t a, uint32_t b, uint32_t c) #define VECTYPE __m128i #define SPLAT(p) _mm_set1_epi8(*(p)) #define ALL_EQ(v1, v2) (_mm_movemask_epi8(_mm_cmpeq_epi8(v1, v2)) == 0xFFFF) +#define VEC_OR(v1, v2) (_mm_or_si128(v1, v2)) #else #define VECTYPE unsigned long #define SPLAT(p) (*(p) * (~0UL / 255)) #define ALL_EQ(v1, v2) ((v1) == (v2)) +#define VEC_OR(v1, v2) ((v1) | (v2)) #endif // support for calling functions before main code is executed.