Enable prefetch and bswap buitins for clang.

pull/8/head
Jonathan G Rennison 8 years ago
parent 34040b694c
commit a8e0862500

@ -404,12 +404,12 @@ static inline T ROR(const T x, const uint8 n)
*/
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 */
return (uint32)__builtin_bswap32((int32)x);
#else
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)
#define INCLUDE_FOR_PREFETCH_NTA <xmmintrin.h>
#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 PREFETCH_NTA(address) __builtin_prefetch((const void *) (address), 0, 0);
#else

Loading…
Cancel
Save