[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT/INTEL-INTRINSICS PATCH 2/3] _mm_alignr_epi8 to use compiler builtin



From: Sharan Santhanam <sharan.santhanam@xxxxxxxxx>

_mm_alignr_epi8 uses the __builtin_ia32_palignr128 function for its
implementation. The builtin function has a different signature on
gcc vs llvm. We provide compiler guards to use the appropriate builtin
function.

Signed-off-by: Felipe Huici <felipe.huici@xxxxxxxxx>
Signed-off-by: Sharan Santhanam <sharan.santhanam@xxxxxxxxx>
---
 include/tmmintrin.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/include/tmmintrin.h b/include/tmmintrin.h
index 7a94096..7c9ece6 100644
--- a/include/tmmintrin.h
+++ b/include/tmmintrin.h
@@ -163,9 +163,15 @@ _mm_abs_epi32(__m128i __a)
 ///    An immediate operand specifying how many bytes to right-shift the 
result.
 /// \returns A 128-bit integer vector containing the concatenated right-shifted
 ///    value.
+#ifdef __GNUC__
+#define _mm_alignr_epi8(a, b, n) \
+  (__m128i)__builtin_ia32_palignr128((__v2di)(__m128i)(a), \
+                                     (__v2di)(__m128i)(b), (n))
+#else
 #define _mm_alignr_epi8(a, b, n) \
   (__m128i)__builtin_ia32_palignr128((__v16qi)(__m128i)(a), \
                                      (__v16qi)(__m128i)(b), (n))
+#endif
 
 /// Concatenates the two 64-bit integer vector operands, and right-shifts
 ///    the result by the number of bytes specified in the immediate operand.
-- 
2.11.0


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.