@@ -333,10 +333,17 @@ char *strrchr(const char *s, int c) {
333
333
334
334
// http://0x80.pl/notesen/2018-10-18-simd-byte-lookup.html
335
335
336
- #define _WASM_SIMD128_BITMAP256_T \
337
- struct { \
338
- uint8_t l __attribute__((__vector_size__(16), __aligned__(16))); \
339
- uint8_t h __attribute__((__vector_size__(16), __aligned__(16))); \
336
+ #ifndef __wasm_relaxed_simd__
337
+
338
+ #define wasm_i8x16_relaxed_laneselect wasm_v128_bitselect
339
+ #define wasm_i8x16_relaxed_swizzle wasm_i8x16_swizzle
340
+
341
+ #endif // __wasm_relaxed_simd__
342
+
343
+ #define _WASM_SIMD128_BITMAP256_T \
344
+ struct { \
345
+ __u8x16 l; \
346
+ __u8x16 h; \
340
347
}
341
348
342
349
#define _WASM_SIMD128_SETBIT (bitmap , i ) \
@@ -367,10 +374,11 @@ char *strrchr(const char *s, int c) {
367
374
v128_t _bitmask_lookup = wasm_u8x16_const(1, 2, 4, 8, 16, 32, 64, 128, \
368
375
1, 2, 4, 8, 16, 32, 64, 128); \
369
376
\
370
- v128_t _bitmask = wasm_i8x16_swizzle(_bitmask_lookup, _hi_nibbles); \
371
- v128_t _bitsets = wasm_v128_bitselect( \
372
- wasm_i8x16_swizzle(bitmap.l, _lo_nibbles), \
373
- wasm_i8x16_swizzle(bitmap.h, _lo_nibbles), \
377
+ v128_t _bitmask = \
378
+ wasm_i8x16_relaxed_swizzle(_bitmask_lookup, _hi_nibbles); \
379
+ v128_t _bitsets = wasm_i8x16_relaxed_laneselect( \
380
+ wasm_i8x16_relaxed_swizzle(bitmap.l, _lo_nibbles), \
381
+ wasm_i8x16_relaxed_swizzle(bitmap.h, _lo_nibbles), \
374
382
wasm_i8x16_lt(_hi_nibbles, wasm_u8x16_const_splat(8))); \
375
383
\
376
384
wasm_i8x16_eq(_bitsets & _bitmask, _bitmask); \
@@ -458,6 +466,9 @@ size_t strcspn(const char *s, const char *c) {
458
466
return s - a ;
459
467
}
460
468
469
+ #undef wasm_i8x16_relaxed_laneselect
470
+ #undef wasm_i8x16_relaxed_swizzle
471
+
461
472
#undef _WASM_SIMD128_SETBIT
462
473
#undef _WASM_SIMD128_CHKBIT
463
474
#undef _WASM_SIMD128_CHKBITS
0 commit comments