Commit e06c65ec authored by Ng Zhi An's avatar Ng Zhi An Committed by Commit Bot

Add test case for F32x4Extract

The test case SimdF32x4ExtractWithI32x4 was still passing when the codegen for
F32x4Extract was entirely commented out. This change adds a new test
cases that specifically exercises F32x4ExtractLane.

It copies what is done in SimdI32x4SplatFromExtract,
which involves moving the splatted and
extracted values around locals, to ensure we move the values around
registers and not unintentionally reuse registers that we splatted to,
without actually extracting anything.

Note that the existing SimdF32x4ExtractWithI32x4 is kept because it is
used to test scalar lowering passes.


Bug: v8:9420
Change-Id: Ieb883175b0e0139e8452c18f09d50b7dfb05a994
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1684699
Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
Reviewed-by: 's avatarDeepti Gandluri <gdeepti@chromium.org>
Auto-Submit: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62496}
parent 2e0faaf9
...@@ -2169,6 +2169,18 @@ WASM_SIMD_TEST(SimdF32x4ExtractWithI32x4) { ...@@ -2169,6 +2169,18 @@ WASM_SIMD_TEST(SimdF32x4ExtractWithI32x4) {
CHECK_EQ(1, r.Call()); CHECK_EQ(1, r.Call());
} }
WASM_SIMD_TEST(SimdF32x4ExtractLane) {
WasmRunner<float> r(execution_tier, lower_simd);
r.AllocateLocal(kWasmF32);
r.AllocateLocal(kWasmS128);
BUILD(r,
WASM_SET_LOCAL(0, WASM_SIMD_F32x4_EXTRACT_LANE(
0, WASM_SIMD_F32x4_SPLAT(WASM_F32(30.5)))),
WASM_SET_LOCAL(1, WASM_SIMD_F32x4_SPLAT(WASM_GET_LOCAL(0))),
WASM_SIMD_F32x4_EXTRACT_LANE(1, WASM_GET_LOCAL(1)));
CHECK_EQ(30.5, r.Call());
}
WASM_SIMD_TEST(SimdF32x4AddWithI32x4) { WASM_SIMD_TEST(SimdF32x4AddWithI32x4) {
// Choose two floating point values whose sum is normal and exactly // Choose two floating point values whose sum is normal and exactly
// representable as a float. // representable as a float.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment