@@ -1266,16 +1266,17 @@ OPENCV_HAL_IMPL_WASM_BIN_FUNC(v_uint8x16, v_sub_wrap, wasm_i8x16_sub)
1266
1266
OPENCV_HAL_IMPL_WASM_BIN_FUNC (v_int8x16, v_sub_wrap, wasm_i8x16_sub)
1267
1267
OPENCV_HAL_IMPL_WASM_BIN_FUNC (v_uint16x8, v_sub_wrap, wasm_i16x8_sub)
1268
1268
OPENCV_HAL_IMPL_WASM_BIN_FUNC (v_int16x8, v_sub_wrap, wasm_i16x8_sub)
1269
- #if (__EMSCRIPTEN_major__ * 1000000 + __EMSCRIPTEN_minor__ * 1000 + __EMSCRIPTEN_tiny__) >= (2000000 )
1269
+ #if (__EMSCRIPTEN_major__ * 1000000 + __EMSCRIPTEN_minor__ * 1000 + __EMSCRIPTEN_tiny__) >= (1039012 )
1270
1270
// details: https://github.com/opencv/opencv/issues/18097 ( https://github.com/emscripten-core/emscripten/issues/12018 )
1271
+ // 1.39.12: https://github.com/emscripten-core/emscripten/commit/cd801d0f110facfd694212a3c8b2ed2ffcd630e2
1271
1272
inline v_uint8x16 v_mul_wrap (const v_uint8x16& a, const v_uint8x16& b)
1272
1273
{
1273
1274
uchar a_[16 ], b_[16 ];
1274
1275
wasm_v128_store (a_, a.val );
1275
1276
wasm_v128_store (b_, b.val );
1276
1277
for (int i = 0 ; i < 16 ; i++)
1277
1278
a_[i] = (uchar)(a_[i] * b_[i]);
1278
- return wasm_v128_load (a_);
1279
+ return v_uint8x16 ( wasm_v128_load (a_) );
1279
1280
}
1280
1281
inline v_int8x16 v_mul_wrap (const v_int8x16& a, const v_int8x16& b)
1281
1282
{
@@ -1284,7 +1285,7 @@ inline v_int8x16 v_mul_wrap(const v_int8x16& a, const v_int8x16& b)
1284
1285
wasm_v128_store (b_, b.val );
1285
1286
for (int i = 0 ; i < 16 ; i++)
1286
1287
a_[i] = (schar)(a_[i] * b_[i]);
1287
- return wasm_v128_load (a_);
1288
+ return v_int8x16 ( wasm_v128_load (a_) );
1288
1289
}
1289
1290
#else
1290
1291
OPENCV_HAL_IMPL_WASM_BIN_FUNC (v_uint8x16, v_mul_wrap, wasm_i8x16_mul)
@@ -1757,8 +1758,8 @@ inline v_uint64x2 v_popcount(const v_uint64x2& a)
1757
1758
uint64 a_[2 ], b_[2 ] = { 0 };
1758
1759
wasm_v128_store (a_, a.val );
1759
1760
for (int i = 0 ; i < 16 ; i++)
1760
- b_[i / 8 ] += popCountTable[((uint8 *)a_)[i]];
1761
- return wasm_v128_load (b_);
1761
+ b_[i / 8 ] += popCountTable[((uint8_t *)a_)[i]];
1762
+ return v_uint64x2 ( wasm_v128_load (b_) );
1762
1763
}
1763
1764
inline v_uint8x16 v_popcount (const v_int8x16& a)
1764
1765
{ return v_popcount (v_reinterpret_as_u8 (a)); }
@@ -1938,11 +1939,11 @@ inline v_int32x4 func(const v_float64x2& a) \
1938
1939
double a_[2 ]; \
1939
1940
wasm_v128_store (a_, a.val ); \
1940
1941
int c_[4 ]; \
1941
- c_[0 ] = cfunc (a_[i ]); \
1942
- c_[1 ] = cfunc (a_[i ]); \
1942
+ c_[0 ] = cfunc (a_[0 ]); \
1943
+ c_[1 ] = cfunc (a_[1 ]); \
1943
1944
c_[2 ] = 0 ; \
1944
1945
c_[3 ] = 0 ; \
1945
- return wasm_v128_load (c_); \
1946
+ return v_int32x4 ( wasm_v128_load (c_) ); \
1946
1947
}
1947
1948
1948
1949
OPENCV_HAL_IMPL_WASM_MATH_FUNC (v_round, cvRound)
@@ -1960,7 +1961,7 @@ inline v_int32x4 v_round(const v_float64x2& a, const v_float64x2& b)
1960
1961
c_[1 ] = cvRound (a_[1 ]);
1961
1962
c_[2 ] = cvRound (b_[0 ]);
1962
1963
c_[3 ] = cvRound (b_[1 ]);
1963
- return wasm_v128_load (c_);
1964
+ return v_int32x4 ( wasm_v128_load (c_) );
1964
1965
}
1965
1966
1966
1967
#define OPENCV_HAL_IMPL_WASM_TRANSPOSE4x4 (_Tpvec, suffix ) \
@@ -2461,7 +2462,7 @@ inline v_float32x4 v_cvt_f32(const v_float64x2& a)
2461
2462
c_[1 ] = (float )(a_[1 ]);
2462
2463
c_[2 ] = 0 ;
2463
2464
c_[3 ] = 0 ;
2464
- return wasm_v128_load (c_);
2465
+ return v_float32x4 ( wasm_v128_load (c_) );
2465
2466
}
2466
2467
2467
2468
inline v_float32x4 v_cvt_f32 (const v_float64x2& a, const v_float64x2& b)
@@ -2474,7 +2475,7 @@ inline v_float32x4 v_cvt_f32(const v_float64x2& a, const v_float64x2& b)
2474
2475
c_[1 ] = (float )(a_[1 ]);
2475
2476
c_[2 ] = (float )(b_[0 ]);
2476
2477
c_[3 ] = (float )(b_[1 ]);
2477
- return wasm_v128_load (c_);
2478
+ return v_float32x4 ( wasm_v128_load (c_) );
2478
2479
}
2479
2480
2480
2481
inline v_float64x2 v_cvt_f64 (const v_int32x4& a)
@@ -2488,7 +2489,7 @@ inline v_float64x2 v_cvt_f64(const v_int32x4& a)
2488
2489
double c_[2 ];
2489
2490
c_[0 ] = (double )(a_[0 ]);
2490
2491
c_[1 ] = (double )(a_[1 ]);
2491
- return wasm_v128_load (c_);
2492
+ return v_float64x2 ( wasm_v128_load (c_) );
2492
2493
#endif
2493
2494
}
2494
2495
@@ -2503,7 +2504,7 @@ inline v_float64x2 v_cvt_f64_high(const v_int32x4& a)
2503
2504
double c_[2 ];
2504
2505
c_[0 ] = (double )(a_[2 ]);
2505
2506
c_[1 ] = (double )(a_[3 ]);
2506
- return wasm_v128_load (c_);
2507
+ return v_float64x2 ( wasm_v128_load (c_) );
2507
2508
#endif
2508
2509
}
2509
2510
@@ -2514,7 +2515,7 @@ inline v_float64x2 v_cvt_f64(const v_float32x4& a)
2514
2515
double c_[2 ];
2515
2516
c_[0 ] = (double )(a_[0 ]);
2516
2517
c_[1 ] = (double )(a_[1 ]);
2517
- return wasm_v128_load (c_);
2518
+ return v_float64x2 ( wasm_v128_load (c_) );
2518
2519
}
2519
2520
2520
2521
inline v_float64x2 v_cvt_f64_high (const v_float32x4& a)
@@ -2524,7 +2525,7 @@ inline v_float64x2 v_cvt_f64_high(const v_float32x4& a)
2524
2525
double c_[2 ];
2525
2526
c_[0 ] = (double )(a_[2 ]);
2526
2527
c_[1 ] = (double )(a_[3 ]);
2527
- return wasm_v128_load (c_);
2528
+ return v_float64x2 ( wasm_v128_load (c_) );
2528
2529
}
2529
2530
2530
2531
inline v_float64x2 v_cvt_f64 (const v_int64x2& a)
@@ -2537,7 +2538,7 @@ inline v_float64x2 v_cvt_f64(const v_int64x2& a)
2537
2538
double c_[2 ];
2538
2539
c_[0 ] = (double )(a_[0 ]);
2539
2540
c_[1 ] = (double )(a_[1 ]);
2540
- return wasm_v128_load (c_);
2541
+ return v_float64x2 ( wasm_v128_load (c_) );
2541
2542
#endif
2542
2543
}
2543
2544
@@ -2757,7 +2758,7 @@ inline v_float32x4 v_load_expand(const float16_t* ptr)
2757
2758
float a[4 ];
2758
2759
for (int i = 0 ; i < 4 ; i++)
2759
2760
a[i] = ptr[i];
2760
- return wasm_v128_load (a);
2761
+ return v_float32x4 ( wasm_v128_load (a) );
2761
2762
}
2762
2763
2763
2764
inline void v_pack_store (float16_t * ptr, const v_float32x4& v)
0 commit comments