Commit dec6528
[mypyc] librt base64: support pyodide via the NEON intrinsics (#20316)
Fixes the following error when building lib-rt with pyodide
> ` /home/runner/work/librt/librt/.pyodide_build/pywasmcross_symlinks/cc
-fno-strict-overflow -Wsign-compare -Wunreachable-code -DNDEBUG -g -O3
-Wall -O2 -g0 -fPIC -DPY_CALL_TRAMPOLINE -I. -Ibase64
-I/tmp/build-env-ftmn_jvi/include
-I/home/runner/.cache/cibuildwheel/pyodide-build-0.30.7/0.27.7/xbuildenv/pyodide-root/cpython/installs/python-3.12.7/include/python3.12
-c base64/arch/avx/codec.c -o
build/temp.emscripten_3_1_58_wasm32-cpython-312/base64/arch/avx/codec.o
-O3 -mavx`
> ` emcc: error: passing any of -msse, -msse2, -msse3, -mssse3,
-msse4.1, -msse4.2, -msse4, -mavx, -mfpu=neon flags also requires
passing -msimd128 (or -mrelaxed-simd)!`
Instead of using emscripten's compatibility headers for X86 intrinsics,
this PR has pyodide/emscripten use the NEON intrinsics as they better
match the underlying SIMD capabilities in WASM. And it skips the "CPU
detection" which would not work (nor make sense) in a WASM setting.
Ideally a pure WASM implementation would be added to base64 and
backported here as well.
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>1 parent c1fb129 commit dec6528
File tree
4 files changed
+60
-41
lines changed- mypyc
- lib-rt
- base64
- arch/neon64
4 files changed
+60
-41
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| 34 | + | |
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
| 38 | + | |
| 39 | + | |
41 | 40 | | |
42 | | - | |
43 | 41 | | |
44 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
45 | 55 | | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
59 | 69 | | |
60 | 70 | | |
61 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
| 49 | + | |
| 50 | + | |
53 | 51 | | |
54 | | - | |
55 | 52 | | |
56 | 53 | | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
71 | 80 | | |
72 | 81 | | |
73 | 82 | | |
| |||
0 commit comments