6
6
import json
7
7
import logging
8
8
import os
9
+ import platform
9
10
import random
10
11
import re
11
12
import shutil
@@ -139,6 +140,18 @@ def decorated(self, *args, **kwargs):
139
140
return decorated
140
141
141
142
143
+ def requires_x64_cpu (func ):
144
+ assert callable (func )
145
+
146
+ @wraps (func )
147
+ def decorated (self , * args , ** kwargs ):
148
+ if platform .machine ().lower () not in ['x86_64' , 'amd64' ]:
149
+ return self .skipTest (f'This test requires a native x64 CPU. Current CPU is { platform .machine ()} .' )
150
+ return func (self , * args , ** kwargs )
151
+
152
+ return decorated
153
+
154
+
142
155
def with_dylink_reversed (func ):
143
156
assert callable (func )
144
157
@@ -6537,6 +6550,7 @@ def test_neon_wasm_simd(self):
6537
6550
@wasm_simd
6538
6551
@crossplatform
6539
6552
@requires_native_clang
6553
+ @requires_x64_cpu
6540
6554
@no_safe_heap ('has unaligned 64-bit operations in wasm' )
6541
6555
@no_ubsan ('test contains UB' )
6542
6556
@parameterized ({
@@ -6556,6 +6570,7 @@ def test_sse1(self, args):
6556
6570
# Tests invoking the SIMD API via x86 SSE2 emmintrin.h header (_mm_x() functions)
6557
6571
@wasm_simd
6558
6572
@requires_native_clang
6573
+ @requires_x64_cpu
6559
6574
@no_safe_heap ('has unaligned 64-bit operations in wasm' )
6560
6575
@is_slow_test
6561
6576
@no_ubsan ('https://github.com/emscripten-core/emscripten/issues/19688' )
@@ -6578,6 +6593,7 @@ def test_sse2(self, args):
6578
6593
# Tests invoking the SIMD API via x86 SSE3 pmmintrin.h header (_mm_x() functions)
6579
6594
@wasm_simd
6580
6595
@requires_native_clang
6596
+ @requires_x64_cpu
6581
6597
def test_sse3 (self ):
6582
6598
src = test_file ('sse/test_sse3.cpp' )
6583
6599
self .run_process ([shared .CLANG_CXX , src , '-msse3' , '-Wno-argument-outside-range' , '-o' , 'test_sse3' , '-D_CRT_SECURE_NO_WARNINGS=1' ] + clang_native .get_clang_native_args (), stdout = PIPE )
@@ -6590,6 +6606,7 @@ def test_sse3(self):
6590
6606
# Tests invoking the SIMD API via x86 SSSE3 tmmintrin.h header (_mm_x() functions)
6591
6607
@wasm_simd
6592
6608
@requires_native_clang
6609
+ @requires_x64_cpu
6593
6610
def test_ssse3 (self ):
6594
6611
src = test_file ('sse/test_ssse3.cpp' )
6595
6612
self .run_process ([shared .CLANG_CXX , src , '-mssse3' , '-Wno-argument-outside-range' , '-o' , 'test_ssse3' , '-D_CRT_SECURE_NO_WARNINGS=1' ] + clang_native .get_clang_native_args (), stdout = PIPE )
@@ -6603,6 +6620,7 @@ def test_ssse3(self):
6603
6620
@no_ubsan ('https://github.com/emscripten-core/emscripten/issues/19749' )
6604
6621
@wasm_simd
6605
6622
@requires_native_clang
6623
+ @requires_x64_cpu
6606
6624
@is_slow_test
6607
6625
def test_sse4_1 (self ):
6608
6626
if self .is_wasm64 ():
@@ -6622,6 +6640,7 @@ def test_sse4_1(self):
6622
6640
# Tests invoking the SIMD API via x86 SSE4.2 nmmintrin.h header (_mm_x() functions)
6623
6641
@wasm_simd
6624
6642
@requires_native_clang
6643
+ @requires_x64_cpu
6625
6644
@parameterized ({
6626
6645
'' : (False ,),
6627
6646
'2' : (True ,),
@@ -6639,6 +6658,7 @@ def test_sse4(self, use_4_2):
6639
6658
# Tests invoking the SIMD API via x86 AVX avxintrin.h header (_mm_x() functions)
6640
6659
@wasm_simd
6641
6660
@requires_native_clang
6661
+ @requires_x64_cpu
6642
6662
@is_slow_test
6643
6663
@no_asan ('local count too large' )
6644
6664
@no_ubsan ('local count too large' )
@@ -6658,6 +6678,7 @@ def test_avx(self, args):
6658
6678
# Tests invoking the SIMD API via x86 AVX2 avx2intrin.h header (_mm_x()/_mm256_x() functions)
6659
6679
@wasm_simd
6660
6680
@requires_native_clang
6681
+ @requires_x64_cpu
6661
6682
@is_slow_test
6662
6683
@no_asan ('local count too large' )
6663
6684
@no_ubsan ('local count too large' )
@@ -6684,7 +6705,6 @@ def test_sse_diagnostics(self):
6684
6705
stderr = PIPE )
6685
6706
self .assertContained ('Instruction emulated via slow path.' , p .stderr )
6686
6707
6687
- @requires_native_clang
6688
6708
@wasm_relaxed_simd
6689
6709
def test_relaxed_simd_implies_simd128 (self ):
6690
6710
src = test_file ('sse/test_sse1.cpp' )
0 commit comments