Enable prefetch and bswap buitins for clang.
This commit is contained in:
@@ -404,12 +404,12 @@ static inline T ROR(const T x, const uint8 n)
|
|||||||
*/
|
*/
|
||||||
static inline uint32 BSWAP32(uint32 x)
|
static inline uint32 BSWAP32(uint32 x)
|
||||||
{
|
{
|
||||||
#if !defined(__ICC) && defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && __GNUC_MINOR__ >= 3))
|
#if !defined(__ICC) && (defined(__GNUC__) || defined(__clang__))
|
||||||
/* GCC >= 4.3 provides a builtin, resulting in faster code */
|
/* GCC >= 4.3 provides a builtin, resulting in faster code */
|
||||||
return (uint32)__builtin_bswap32((int32)x);
|
return (uint32)__builtin_bswap32((int32)x);
|
||||||
#else
|
#else
|
||||||
return ((x >> 24) & 0xFF) | ((x >> 8) & 0xFF00) | ((x << 8) & 0xFF0000) | ((x << 24) & 0xFF000000);
|
return ((x >> 24) & 0xFF) | ((x >> 8) & 0xFF00) | ((x << 8) & 0xFF0000) | ((x << 24) & 0xFF000000);
|
||||||
#endif /* defined(__GNUC__) */
|
#endif /* __GNUC__ || __clang__ */
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -523,7 +523,7 @@ static inline void free(const void *ptr)
|
|||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
#define INCLUDE_FOR_PREFETCH_NTA <xmmintrin.h>
|
#define INCLUDE_FOR_PREFETCH_NTA <xmmintrin.h>
|
||||||
#define PREFETCH_NTA(address) _mm_prefetch((const char *) (address), _MM_HINT_NTA);
|
#define PREFETCH_NTA(address) _mm_prefetch((const char *) (address), _MM_HINT_NTA);
|
||||||
#elif defined(__GNUC__)
|
#elif defined(__GNUC__) || defined(__clang__)
|
||||||
#define INCLUDE_FOR_PREFETCH_NTA "stdafx.h"
|
#define INCLUDE_FOR_PREFETCH_NTA "stdafx.h"
|
||||||
#define PREFETCH_NTA(address) __builtin_prefetch((const void *) (address), 0, 0);
|
#define PREFETCH_NTA(address) __builtin_prefetch((const void *) (address), 0, 0);
|
||||||
#else
|
#else
|
||||||
|
Reference in New Issue
Block a user