diff --git a/src/coreclr/src/classlibnative/bcltype/arraynative.inl b/src/coreclr/src/classlibnative/bcltype/arraynative.inl index 492d4fb3d8d05d9b9f39dd7bd2b8b50d2e91059e..5928f9d6e0fa6a1cadc2ad2dd255eb247a73c2a5 100644 --- a/src/coreclr/src/classlibnative/bcltype/arraynative.inl +++ b/src/coreclr/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/coreclr/src/pal/inc/pal.h b/src/coreclr/src/pal/inc/pal.h index 38ef778d53a8c5c03fbdfb8484fd8375067caaf6..66d83f1c42197b8550567fdf62c0b81190374c4b 100644 --- a/src/coreclr/src/pal/inc/pal.h +++ b/src/coreclr/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/coreclr/src/pal/inc/rt/xmmintrin.h b/src/coreclr/src/pal/inc/rt/xmmintrin.h index 1a670bd75a06973fe25e7c065286e76b252cadcd..33bc8b4b927cefc8ae3626a8ed54e3ea8cced2fc 100644 --- a/src/coreclr/src/pal/inc/rt/xmmintrin.h +++ b/src/coreclr/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__