Enable prefetch and bswap buitins for clang.

This commit is contained in:
Jonathan G Rennison
2016-09-08 20:00:56 +01:00
parent 34040b694c
commit a8e0862500
2 changed files with 3 additions and 3 deletions

View File

@@ -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__ */
}
/**