From: Sinan Kaya Date: Sun, 24 Mar 2019 23:45:43 +0000 (+0000) Subject: Unify clang with GNUC X-Git-Tag: accepted/tizen/unified/20190813.215958~54^2~36^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=446393da44258d60aaa9c660602fb826c79fe6b3;p=platform%2Fupstream%2Fcoreclr.git Unify clang with GNUC Enable SSE for GCC --- diff --git a/src/classlibnative/bcltype/arraynative.inl b/src/classlibnative/bcltype/arraynative.inl index 492d4fb..5928f9d 100644 --- a/src/classlibnative/bcltype/arraynative.inl +++ b/src/classlibnative/bcltype/arraynative.inl @@ -58,7 +58,7 @@ FORCEINLINE void InlinedForwardGCSafeCopyHelper(void *dest, const void *src, siz ++dptr; } -#if defined(_AMD64_) && (defined(_MSC_VER) || defined(__clang__)) +#if defined(_AMD64_) && (defined(_MSC_VER) || defined(__GNUC__)) if ((len & (2 * sizeof(SIZE_T))) != 0) { __m128 v = _mm_loadu_ps((float *)sptr); @@ -104,7 +104,7 @@ FORCEINLINE void InlinedForwardGCSafeCopyHelper(void *dest, const void *src, siz { return; } -#else // !(defined(_AMD64_) && (defined(_MSC_VER) || defined(__clang__))) +#else // !(defined(_AMD64_) && (defined(_MSC_VER) || defined(__GNUC__))) if ((len & (2 * sizeof(SIZE_T))) != 0) { // Read two values and write two values to hint the use of wide loads and stores @@ -144,7 +144,7 @@ FORCEINLINE void InlinedForwardGCSafeCopyHelper(void *dest, const void *src, siz sptr += 4; dptr += 4; } -#endif // defined(_AMD64_) && (defined(_MSC_VER) || defined(__clang__)) +#endif // defined(_AMD64_) && (defined(_MSC_VER) || defined(__GNUC__)) } } @@ -193,7 +193,7 @@ FORCEINLINE void InlinedBackwardGCSafeCopyHelper(void *dest, const void *src, si } } -#if defined(_AMD64_) && (defined(_MSC_VER) || defined(__clang__)) +#if defined(_AMD64_) && (defined(_MSC_VER) || defined(__GNUC__)) if ((len & (2 * sizeof(SIZE_T))) != 0) { sptr -= 2; @@ -242,7 +242,7 @@ FORCEINLINE void InlinedBackwardGCSafeCopyHelper(void *dest, const void *src, si { return; } -#else // !(defined(_AMD64_) && (defined(_MSC_VER) || defined(__clang__))) +#else // !(defined(_AMD64_) && (defined(_MSC_VER) || defined(__GNUC__))) if ((len & (2 * sizeof(SIZE_T))) != 0) { sptr -= 2; @@ -281,7 +281,7 @@ FORCEINLINE void InlinedBackwardGCSafeCopyHelper(void *dest, const void *src, si len -= 4 * sizeof(SIZE_T); } while (len != 0); return; -#endif // defined(_AMD64_) && (defined(_MSC_VER) || defined(__clang__)) +#endif // defined(_AMD64_) && (defined(_MSC_VER) || defined(__GNUC__)) } } diff --git a/src/pal/inc/pal.h b/src/pal/inc/pal.h index 38ef778..66d83f1 100644 --- a/src/pal/inc/pal.h +++ b/src/pal/inc/pal.h @@ -192,11 +192,19 @@ typedef PVOID NATIVE_LIBRARY_HANDLE; #ifndef NOOPT_ATTRIBUTE #if defined(__llvm__) #define NOOPT_ATTRIBUTE optnone -#else +#elif defined(__GNUC__) #define NOOPT_ATTRIBUTE optimize("O0") #endif #endif +#ifndef NODEBUG_ATTRIBUTE +#if defined(__llvm__) +#define NODEBUG_ATTRIBUTE __nodebug__ +#elif defined(__GNUC__) +#define NODEBUG_ATTRIBUTE __artificial__ +#endif +#endif + #ifndef PAL_STDCPP_COMPAT #if __GNUC__ diff --git a/src/pal/inc/rt/xmmintrin.h b/src/pal/inc/rt/xmmintrin.h index 1a670bd..33bc8b4 100644 --- a/src/pal/inc/rt/xmmintrin.h +++ b/src/pal/inc/rt/xmmintrin.h @@ -27,12 +27,12 @@ *===-----------------------------------------------------------------------=== */ -#ifdef __clang__ +#ifdef __GNUC__ typedef float __m128 __attribute__((__vector_size__(16))); /* Define the default attributes for the functions in this file. */ -#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__)) +#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, NODEBUG_ATTRIBUTE)) /// \brief Loads a 128-bit floating-point vector of [4 x float] from an aligned /// memory location. @@ -113,4 +113,4 @@ _mm_store_ps(float *__p, __m128 __a) *(__m128*)__p = __a; } -#endif // __clang__ +#endif // __GNUC__