From 753138cd5913f760b5d28432d4e4718d33c90f3a Mon Sep 17 00:00:00 2001 From: zhaorenhai Date: Sat, 30 Jan 2021 16:14:44 +0800 Subject: [PATCH] MCOL-4524 Resolve build error on aarch64 caused by x86 asm instructions On aarch64, just use memcpy, don't use asm instructions to optimize it. Because if gcc uses NEON extensions moving 16 bytes with memcpy, it might be wise to just use memcpy instead --- datatypes/mcs_int128.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/datatypes/mcs_int128.h b/datatypes/mcs_int128.h index 2b0f24010..0d15d73c9 100644 --- a/datatypes/mcs_int128.h +++ b/datatypes/mcs_int128.h @@ -27,7 +27,20 @@ #include "mcs_float128.h" // Inline asm has three argument lists: output, input and clobber list -#if defined(__GNUC__) && (__GNUC___ > 7) +#ifdef __aarch64__ + #define MACRO_VALUE_PTR_128(dst, \ + dst_restrictions, \ + src, \ + src_restrictions, \ + clobb) \ + ::memcpy((dst), &(src), sizeof(int128_t)); + #define MACRO_PTR_PTR_128(dst, \ + dst_restrictions, \ + src, \ + src_restrictions, \ + clobb) \ + ::memcpy((dst), (src), sizeof(int128_t)); +#elif defined(__GNUC__) && (__GNUC___ > 7) #define MACRO_VALUE_PTR_128(dst, \ dst_restrictions, \ src, \