Commit 04e0b50
authored
Use WASM f32x4 relaxed min/max for relaxed simd build (#24324)
### Description
Use wasm_f32x4_relaxed_max and wasm_f32x4_relaxed_min in WASM relaxed
SIMD build.
### Motivation and Context
This PR replaces wasm_f32x4_min/max with the relaxed SIMD counterparts
wasm_f32x4_relaxed_min/max in WASM relaxed SIMD build.
According to [relaxed SIMD
proposal](https://github.com/WebAssembly/relaxed-simd/blob/main/proposals/relaxed-simd/Overview.md#relaxed-min-and-max),
the wasm_f32x4_relaxed_min/max allow implementation-defined behavior on
NaN propagation and -0.0 vs +0.0. This enables WASM runtimes to use
minps/maxps on x64 platforms and improves the performance.
e.g. for wasm_f32x4_max -> wasm_f32x4_relaxed_max
wasm_f32x4_max: [implementation in
V8](https://source.chromium.org/chromium/chromium/src/+/main:v8/src/codegen/shared-ia32-x64/macro-assembler-shared-ia32-x64.cc;l=231)
wasm_f32x4_relaxed_max: maxps
This change would affect kernel functions rely on MlasMaximumFloat32x4
and MlasMinimumFloat32x4, including various activations and reduced
min/max kernels. In mlas micro bench "COMPUTESOFTMAXINPLACE...", this
change provides a performance improvement of up to 60% on x64 devices.1 parent 18f91e5 commit 04e0b50
1 file changed
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1455 | 1455 | | |
1456 | 1456 | | |
1457 | 1457 | | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
1458 | 1461 | | |
1459 | 1462 | | |
1460 | 1463 | | |
| |||
2265 | 2268 | | |
2266 | 2269 | | |
2267 | 2270 | | |
| 2271 | + | |
| 2272 | + | |
2268 | 2273 | | |
2269 | 2274 | | |
2270 | 2275 | | |
| |||
2285 | 2290 | | |
2286 | 2291 | | |
2287 | 2292 | | |
| 2293 | + | |
| 2294 | + | |
2288 | 2295 | | |
2289 | 2296 | | |
2290 | 2297 | | |
| |||
0 commit comments