Skip to content

Commit 7ab9fe5

Browse files
authored
Merge pull request #205 from Desdaemon/master
emscripten: Fix pixman SIMD patch
2 parents e94cc54 + f67fb4b commit 7ab9fe5

1 file changed

Lines changed: 13 additions & 25 deletions

File tree

emscripten/pixman-wasm.patch

Lines changed: 13 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,34 @@
11
--- a/pixman/pixman/pixman-x86.c
22
+++ b/pixman/pixman/pixman-x86.c
3-
@@ -74,10 +74,12 @@ detect_cpu_features (void)
3+
@@ -74,12 +74,18 @@
44

55
#else
66

77
-#if defined (__GNUC__)
88
+#if defined (__GNUC__) && !defined(__EMSCRIPTEN__)
99
#include <cpuid.h>
10+
#elif defined(_MSC_VER)
11+
#include <intrin.h>
1012
#endif
1113

12-
+#if !defined(__EMSCRIPTEN__)
13-
+
14+
+#if defined(__EMSCRIPTEN__)
15+
+static cpu_features_t
16+
+detect_cpu_features (void) {
17+
+ return X86_SSE | X86_SSE2 | X86_SSSE3;
18+
+}
19+
+#else // !defined(__EMSCRIPTEN__)
1420
static void
1521
pixman_cpuid (uint32_t feature,
1622
uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d)
17-
@@ -98,10 +100,17 @@ pixman_cpuid (uint32_t feature,
18-
#error Unknown compiler
19-
#endif
20-
}
21-
+
22-
+#endif // !__EMSCRIPTEN__
23-
24-
static cpu_features_t
25-
detect_cpu_features (void)
26-
{
27-
+#if defined(__EMSCRIPTEN__)
28-
+
29-
+ return X86_MMX | X86_MMX_EXTENSIONS | X86_SSE | X86_SSE2;
30-
+
31-
+#else
32-
uint32_t a, b, c, d;
33-
cpu_features_t features = 0;
34-
35-
@@ -147,6 +156,8 @@ detect_cpu_features (void)
36-
}
23+
@@ -150,6 +156,7 @@
3724

3825
return features;
39-
+
40-
+#endif // !__EMSCRIPTEN__
4126
}
27+
+#endif
4228

4329
#endif
30+
31+
4432
--- a/pixman/pixman/pixman-ssse3.c
4533
+++ b/pixman/pixman/pixman-ssse3.c
4634
@@ -28,7 +28,9 @@

0 commit comments

Comments
 (0)