File tree Expand file tree Collapse file tree 2 files changed +6
-9
lines changed Expand file tree Collapse file tree 2 files changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -783,11 +783,11 @@ The following table highlights the availability and expected performance of diff
783
783
* - Intrinsic name
784
784
- WebAssembly SIMD support
785
785
* - _mm_abs_epi8
786
- - ⚠️ emulated with a SIMD shift+xor+add
786
+ - ✅ wasm_i8x16_abs
787
787
* - _mm_abs_epi16
788
- - ⚠️ emulated with a SIMD shift+xor+add
788
+ - ✅ wasm_i16x8_abs
789
789
* - _mm_abs_epi32
790
- - ⚠️ emulated with a SIMD shift+xor+add
790
+ - ✅ wasm_i32x4_abs
791
791
* - _mm_alignr_epi8
792
792
- ⚠️ emulated with a SIMD or+two shifts
793
793
* - _mm_hadd_epi16
Original file line number Diff line number Diff line change 16
16
static __inline__ __m128i __attribute__((__always_inline__ , __nodebug__ ))
17
17
_mm_abs_epi8 (__m128i __a )
18
18
{
19
- __m128i __mask = (__m128i )wasm_i8x16_shr ((v128_t )__a , 7 );
20
- return _mm_xor_si128 (_mm_add_epi8 (__a , __mask ), __mask );
19
+ return (__m128i )wasm_i8x16_abs ((v128_t )__a );
21
20
}
22
21
23
22
static __inline__ __m128i __attribute__((__always_inline__ , __nodebug__ ))
24
23
_mm_abs_epi16 (__m128i __a )
25
24
{
26
- __m128i __mask = _mm_srai_epi16 (__a , 15 );
27
- return _mm_xor_si128 (_mm_add_epi16 (__a , __mask ), __mask );
25
+ return (__m128i )wasm_i16x8_abs ((v128_t )__a );
28
26
}
29
27
30
28
static __inline__ __m128i __attribute__((__always_inline__ , __nodebug__ ))
31
29
_mm_abs_epi32 (__m128i __a )
32
30
{
33
- __m128i __mask = _mm_srai_epi32 (__a , 31 );
34
- return _mm_xor_si128 (_mm_add_epi32 (__a , __mask ), __mask );
31
+ return (__m128i )wasm_i32x4_abs ((v128_t )__a );
35
32
}
36
33
37
34
#define _mm_alignr_epi8 (__a , __b , __count ) \
You can’t perform that action at this time.
0 commit comments