Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
d31da08d
Commit
d31da08d
authored
Oct 17, 2019
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #15708 from alalek:js_simd_support_1.38.48
parents
17e9fde7
b1a8de09
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
10 deletions
+22
-10
intrin_wasm.hpp
modules/core/include/opencv2/core/hal/intrin_wasm.hpp
+22
-10
No files found.
modules/core/include/opencv2/core/hal/intrin_wasm.hpp
View file @
d31da08d
...
...
@@ -21,6 +21,18 @@ namespace cv
CV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN
#if (__EMSCRIPTEN_major__ * 1000000 + __EMSCRIPTEN_minor__ * 1000 + __EMSCRIPTEN_tiny__) < (1038046)
// handle renames: https://github.com/emscripten-core/emscripten/pull/9440 (https://github.com/emscripten-core/emscripten/commit/755d5b46cb84d0aa120c10981b11d05646c29673)
#define wasm_i32x4_trunc_saturate_f32x4 wasm_trunc_saturate_i32x4_f32x4
#define wasm_u32x4_trunc_saturate_f32x4 wasm_trunc_saturate_u32x4_f32x4
#define wasm_i64x2_trunc_saturate_f64x2 wasm_trunc_saturate_i64x2_f64x2
#define wasm_u64x2_trunc_saturate_f64x2 wasm_trunc_saturate_u64x2_f64x2
#define wasm_f32x4_convert_i32x4 wasm_convert_f32x4_i32x4
#define wasm_f32x4_convert_u32x4 wasm_convert_f32x4_u32x4
#define wasm_f64x2_convert_i64x2 wasm_convert_f64x2_i64x2
#define wasm_f64x2_convert_u64x2 wasm_convert_f64x2_u64x2
#endif // COMPATIBILITY: <1.38.46
///////// Types ///////////
struct
v_uint8x16
...
...
@@ -3400,25 +3412,25 @@ inline _Tpvec v_extract(const _Tpvec& a, const _Tpvec& b)
inline
v_int32x4
v_round
(
const
v_float32x4
&
a
)
{
v128_t
h
=
wasm_f32x4_splat
(
0.5
);
return
v_int32x4
(
wasm_
trunc_saturate_i32x4
_f32x4
(
wasm_f32x4_add
(
a
.
val
,
h
)));
return
v_int32x4
(
wasm_
i32x4_trunc_saturate
_f32x4
(
wasm_f32x4_add
(
a
.
val
,
h
)));
}
inline
v_int32x4
v_floor
(
const
v_float32x4
&
a
)
{
v128_t
a1
=
wasm_
trunc_saturate_i32x4
_f32x4
(
a
.
val
);
v128_t
mask
=
wasm_f32x4_lt
(
a
.
val
,
wasm_
convert_f32x4
_i32x4
(
a1
));
v128_t
a1
=
wasm_
i32x4_trunc_saturate
_f32x4
(
a
.
val
);
v128_t
mask
=
wasm_f32x4_lt
(
a
.
val
,
wasm_
f32x4_convert
_i32x4
(
a1
));
return
v_int32x4
(
wasm_i32x4_add
(
a1
,
mask
));
}
inline
v_int32x4
v_ceil
(
const
v_float32x4
&
a
)
{
v128_t
a1
=
wasm_
trunc_saturate_i32x4
_f32x4
(
a
.
val
);
v128_t
mask
=
wasm_f32x4_gt
(
a
.
val
,
wasm_
convert_f32x4
_i32x4
(
a1
));
v128_t
a1
=
wasm_
i32x4_trunc_saturate
_f32x4
(
a
.
val
);
v128_t
mask
=
wasm_f32x4_gt
(
a
.
val
,
wasm_
f32x4_convert
_i32x4
(
a1
));
return
v_int32x4
(
wasm_i32x4_sub
(
a1
,
mask
));
}
inline
v_int32x4
v_trunc
(
const
v_float32x4
&
a
)
{
return
v_int32x4
(
wasm_
trunc_saturate_i32x4
_f32x4
(
a
.
val
));
}
{
return
v_int32x4
(
wasm_
i32x4_trunc_saturate
_f32x4
(
a
.
val
));
}
#define OPENCV_HAL_IMPL_WASM_MATH_FUNC(func, cfunc, _Tpvec, _Tpnvec, _Tp, _Tpn) \
inline _Tpnvec func(const _Tpvec& a) \
...
...
@@ -3924,7 +3936,7 @@ OPENCV_HAL_IMPL_WASM_LOADSTORE_INTERLEAVE(v_float64x2, double, f64, v_uint64x2,
inline
v_float32x4
v_cvt_f32
(
const
v_int32x4
&
a
)
{
return
v_float32x4
(
wasm_
convert_f32x4
_i32x4
(
a
.
val
));
return
v_float32x4
(
wasm_
f32x4_convert
_i32x4
(
a
.
val
));
}
inline
v_float32x4
v_cvt_f32
(
const
v_float64x2
&
a
)
...
...
@@ -3943,7 +3955,7 @@ inline v_float64x2 v_cvt_f64(const v_int32x4& a)
{
#ifdef __wasm_unimplemented_simd128__
v128_t
p
=
v128_cvti32x4_i64x2
(
a
.
val
);
return
v_float64x2
(
wasm_
convert_f64x2
_i64x2
(
p
));
return
v_float64x2
(
wasm_
f64x2_convert
_i64x2
(
p
));
#else
fallback
::
v_int32x4
a_
(
a
);
return
fallback
::
v_cvt_f64
(
a_
);
...
...
@@ -3954,7 +3966,7 @@ inline v_float64x2 v_cvt_f64_high(const v_int32x4& a)
{
#ifdef __wasm_unimplemented_simd128__
v128_t
p
=
v128_cvti32x4_i64x2_high
(
a
.
val
);
return
v_float64x2
(
wasm_
convert_f64x2
_i64x2
(
p
));
return
v_float64x2
(
wasm_
f64x2_convert
_i64x2
(
p
));
#else
fallback
::
v_int32x4
a_
(
a
);
return
fallback
::
v_cvt_f64_high
(
a_
);
...
...
@@ -3976,7 +3988,7 @@ inline v_float64x2 v_cvt_f64_high(const v_float32x4& a)
inline
v_float64x2
v_cvt_f64
(
const
v_int64x2
&
a
)
{
#ifdef __wasm_unimplemented_simd128__
return
v_float64x2
(
wasm_
convert_f64x2
_i64x2
(
a
.
val
));
return
v_float64x2
(
wasm_
f64x2_convert
_i64x2
(
a
.
val
));
#else
fallback
::
v_int64x2
a_
(
a
);
return
fallback
::
v_cvt_f64
(
a_
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment