1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
diff --git a/src/common/mathutil.h b/src/common/mathutil.h
index bdf8c2a..d2aa5dd 100644
--- a/src/common/mathutil.h
+++ b/src/common/mathutil.h
@@ -21,6 +21,10 @@
#include "common/debug.h"
#include "common/platform.h"
+#if defined(__GNUC__)
+#include <x86intrin.h>
+#endif
+
namespace angle
{
using base::CheckedNumeric;
@@ -1260,6 +1264,12 @@ inline constexpr unsigned int UnsignedCeilDivide(unsigned int value, unsigned in
# define ANGLE_ROTL64(x, y) _rotl64(x, y)
# define ANGLE_ROTR16(x, y) _rotr16(x, y)
+#elif defined(__GNUC__)
+
+# define ANGLE_ROTL(x, y) __rold(x, y)
+# define ANGLE_ROTL64(x, y) __rolq(x, y)
+# define ANGLE_ROTR16(x, y) __rolw(x, y)
+
#elif defined(__clang__) && __has_builtin(__builtin_rotateleft32) && \
__has_builtin(__builtin_rotateleft64) && __has_builtin(__builtin_rotateright16)
|