-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlibde265.patch
More file actions
50 lines (44 loc) · 1.06 KB
/
libde265.patch
File metadata and controls
50 lines (44 loc) · 1.06 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
diff --git a/libde265/x86/sse.cc b/libde265/x86/sse.cc
index 2ee0f8f..66d27e9 100644
--- a/libde265/x86/sse.cc
+++ b/libde265/x86/sse.cc
@@ -30,7 +30,7 @@
#include "config.h"
#endif
-#ifdef __GNUC__
+#if defined(__GNUC__) && !defined(__EMSCRIPTEN__)
#include <cpuid.h>
#endif
@@ -46,11 +46,21 @@ void init_acceleration_functions_sse(struct acceleration_functions* accel)
ecx = regs[2];
edx = regs[3];
-#else
+#elif !defined(__EMSCRIPTEN__)
uint32_t eax,ebx;
__get_cpuid(1, &eax,&ebx,&ecx,&edx);
#endif
-
+
+#ifdef __EMSCRIPTEN__
+ int have_SSE = 0;
+ int have_SSE4_1 = 0;
+#ifdef __SSE__
+ have_SSE = 1;
+#endif
+#ifdef __SSE4_1__
+ have_SSE4_1 = 1;
+#endif
+#else
// printf("CPUID EAX=1 -> ECX=%x EDX=%x\n", regs[2], regs[3]);
//int have_MMX = !!(edx & (1<<23));
@@ -61,6 +71,7 @@ void init_acceleration_functions_sse(struct acceleration_functions* accel)
if (have_SSE) {
}
+#endif
#if HAVE_SSE4_1
if (have_SSE4_1) {
@@ -101,4 +112,3 @@ void init_acceleration_functions_sse(struct acceleration_functions* accel)
}
#endif
}
-