|
|
Created:
4 years ago by bbudge Modified:
4 years ago Reviewers:
gdeepti, aseemgarg, Rodolph Perfetta (ARM), Rodolph Perfetta, titzer CC:
v8-reviews_googlegroups.com, v8-mips-ports_googlegroups.com, v8-ppc-ports_googlegroups.com Target Ref:
refs/pending/heads/master Project:
v8 Visibility:
Public. |
Description[Turbofan] Add native ARM support for basic SIMD 32x4 operations.
- Adds Float32x4 ExtractLane, ReplaceLane, Splat, Add, Sub,
and conversions to Int32x4 and Uint32x4.
- Adds Int32x4 ExtractLane, ReplaceLane, Splat, Add, Sub and
conversions to Float32x4 (int and unsigned int).
- Adds Int32x4 CompareEqual, CompareNotEqual.
- Adds S32x4 Select.
- Adds tests for all new SIMD operations.
LOG=N
BUG=v8:4124
Review-Url: https://codereview.chromium.org/2584863002
Cr-Commit-Position: refs/heads/master@{#41828}
Committed: https://chromium.googlesource.com/v8/v8/+/0625a686b5971b36b0116ec5c8cebf4428689cb4
Patch Set 1 #Patch Set 2 : Fix non-ARM builds. #Patch Set 3 : Rebase. #Patch Set 4 : Disable unsupported x64 SIMD tests. #Patch Set 5 : Update tests to convert float to int correctly, fix bug in ARM simulator. #
Total comments: 11
Patch Set 6 : Deepti's comments. #
Total comments: 2
Patch Set 7 : Ben's review comments. #Patch Set 8 : Fix x64 Simd tests. #Patch Set 9 : Restore SIMD macros. #Patch Set 10 : Fix Arm compile. #
Created: 4 years ago
Messages
Total messages: 59 (48 generated)
Description was changed from ========== [Turbofan] Add native support for basic SIMD 32x4 operations. - Adds Float32x4 ExtractLane, ReplaceLane, Splat, Add, Sub, and conversions to Int32x4 and Uint32x4. - Adds Int32x4 ExtractLane, ReplaceLane, Splat, Add, Sub and conversions to Float32x4 (int and unsigned int). - Adds Int32x4 CompareEqual. - Adds S32x4 Select. - Adds tests for all new SIMD operations. LOG=N BUG=v8:4124 ========== to ========== [Turbofan] Add native ARM support for basic SIMD 32x4 operations. - Adds Float32x4 ExtractLane, ReplaceLane, Splat, Add, Sub, and conversions to Int32x4 and Uint32x4. - Adds Int32x4 ExtractLane, ReplaceLane, Splat, Add, Sub and conversions to Float32x4 (int and unsigned int). - Adds Int32x4 CompareEqual. - Adds S32x4 Select. - Adds tests for all new SIMD operations. LOG=N BUG=v8:4124 ==========
Description was changed from ========== [Turbofan] Add native ARM support for basic SIMD 32x4 operations. - Adds Float32x4 ExtractLane, ReplaceLane, Splat, Add, Sub, and conversions to Int32x4 and Uint32x4. - Adds Int32x4 ExtractLane, ReplaceLane, Splat, Add, Sub and conversions to Float32x4 (int and unsigned int). - Adds Int32x4 CompareEqual. - Adds S32x4 Select. - Adds tests for all new SIMD operations. LOG=N BUG=v8:4124 ========== to ========== [Turbofan] Add native ARM support for basic SIMD 32x4 operations. - Adds Float32x4 ExtractLane, ReplaceLane, Splat, Add, Sub, and conversions to Int32x4 and Uint32x4. - Adds Int32x4 ExtractLane, ReplaceLane, Splat, Add, Sub and conversions to Float32x4 (int and unsigned int). - Adds Int32x4 CompareNE. - Adds S32x4 Select. - Adds tests for all new SIMD operations. LOG=N BUG=v8:4124 ==========
Description was changed from ========== [Turbofan] Add native ARM support for basic SIMD 32x4 operations. - Adds Float32x4 ExtractLane, ReplaceLane, Splat, Add, Sub, and conversions to Int32x4 and Uint32x4. - Adds Int32x4 ExtractLane, ReplaceLane, Splat, Add, Sub and conversions to Float32x4 (int and unsigned int). - Adds Int32x4 CompareNE. - Adds S32x4 Select. - Adds tests for all new SIMD operations. LOG=N BUG=v8:4124 ========== to ========== [Turbofan] Add native ARM support for basic SIMD 32x4 operations. - Adds Float32x4 ExtractLane, ReplaceLane, Splat, Add, Sub, and conversions to Int32x4 and Uint32x4. - Adds Int32x4 ExtractLane, ReplaceLane, Splat, Add, Sub and conversions to Float32x4 (int and unsigned int). - Adds Int32x4 CompareEqual, CompareNotEqual. - Adds S32x4 Select. - Adds tests for all new SIMD operations. LOG=N BUG=v8:4124 ==========
The CQ bit was checked by bbudge@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: v8_android_arm_compile_rel on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_android_arm_compile_rel/...) v8_linux64_asan_rel_ng on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux64_asan_rel_ng/buil...) v8_linux64_avx2_rel_ng on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux64_avx2_rel_ng/buil...) v8_linux64_gyp_rel_ng on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux64_gyp_rel_ng/build...) v8_linux64_rel_ng on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux64_rel_ng/builds/17982) v8_linux_arm64_rel_ng on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux_arm64_rel_ng/build...) v8_linux_arm_rel_ng on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux_arm_rel_ng/builds/...) v8_linux_gcc_compile_rel on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux_gcc_compile_rel/bu...) v8_linux_mips64el_compile_rel on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux_mips64el_compile_r...) v8_linux_mipsel_compile_rel on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux_mipsel_compile_rel...) v8_linux_nodcheck_rel_ng on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux_nodcheck_rel_ng/bu...) v8_linux_rel_ng on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux_rel_ng/builds/17949) v8_presubmit on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_presubmit/builds/30832)
The CQ bit was checked by bbudge@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: v8_linux64_gyp_rel_ng on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux64_gyp_rel_ng/build...) v8_linux64_gyp_rel_ng_triggered on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux64_gyp_rel_ng_trigg...)
The CQ bit was checked by bbudge@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
bbudge@chromium.org changed reviewers: + aseemgarg@chromium.org, gdeepti@chromium.org, mtrofin@chromium.org
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: v8_linux_arm_rel_ng on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux_arm_rel_ng/builds/...) v8_linux_arm_rel_ng_triggered on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux_arm_rel_ng_trigger...)
The CQ bit was checked by bbudge@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
bbudge@chromium.org changed reviewers: + rodolph.perfetta@arm.com
+Rodolph for change to arm/simulator.cc and arm/arm-assembler-inl.h
https://codereview.chromium.org/2584863002/diff/80001/src/arm/simulator-arm.cc File src/arm/simulator-arm.cc (left): https://codereview.chromium.org/2584863002/diff/80001/src/arm/simulator-arm.c... src/arm/simulator-arm.cc:3367: memcpy(data, &dn_value, 8); Not sure why, but this doesn't work correctly sometimes. https://codereview.chromium.org/2584863002/diff/80001/src/arm/simulator-arm.c... src/arm/simulator-arm.cc:4132: q_data[i] = static_cast<uint32_t>( I missed these, but I think the behavior is undefined in some cases. Also below.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/2584863002/diff/80001/src/compiler/arm/code-g... File src/compiler/arm/code-generator-arm.cc (right): https://codereview.chromium.org/2584863002/diff/80001/src/compiler/arm/code-g... src/compiler/arm/code-generator-arm.cc:1519: i.InputFloatRegister(2), kScratchReg, i.InputInt8(1)); How does the kScratchReg work as the NeonDataType here? https://codereview.chromium.org/2584863002/diff/80001/src/wasm/wasm-macro-gen.h File src/wasm/wasm-macro-gen.h (right): https://codereview.chromium.org/2584863002/diff/80001/src/wasm/wasm-macro-gen... src/wasm/wasm-macro-gen.h:643: #define WASM_SIMD_UI32x4_FROM_FLOAT32x4(x) \ Nit: The convention for unsigned values in this file is U32 instead of UI32. https://codereview.chromium.org/2584863002/diff/80001/test/cctest/wasm/test-r... File test/cctest/wasm/test-run-wasm-simd.cc (right): https://codereview.chromium.org/2584863002/diff/80001/test/cctest/wasm/test-r... test/cctest/wasm/test-run-wasm-simd.cc:120: CHECK_EQ(1, r.Call(1, 2)); Is there a reason we do not use floating point values here? I guess this is a general question for WASM_SIMD_CHECK_F32_LANE using WASM_I32_NE and WASM_I32_REINTERPRET_F32 instead of WASM_F32_NE.
The CQ bit was checked by bbudge@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/2584863002/diff/80001/src/compiler/arm/code-g... File src/compiler/arm/code-generator-arm.cc (right): https://codereview.chromium.org/2584863002/diff/80001/src/compiler/arm/code-g... src/compiler/arm/code-generator-arm.cc:1519: i.InputFloatRegister(2), kScratchReg, i.InputInt8(1)); On 2016/12/16 23:35:24, gdeepti wrote: > How does the kScratchReg work as the NeonDataType here? This invokes a different ReplaceLane overload, which doesn't require a data type (we know it's a 32 bit float.) Also, the generated code is different. https://codereview.chromium.org/2584863002/diff/80001/src/wasm/wasm-macro-gen.h File src/wasm/wasm-macro-gen.h (right): https://codereview.chromium.org/2584863002/diff/80001/src/wasm/wasm-macro-gen... src/wasm/wasm-macro-gen.h:643: #define WASM_SIMD_UI32x4_FROM_FLOAT32x4(x) \ On 2016/12/16 23:35:24, gdeepti wrote: > Nit: The convention for unsigned values in this file is U32 instead of UI32. Thanks, I noticed a bunch of similar cases here. Done. https://codereview.chromium.org/2584863002/diff/80001/test/cctest/wasm/test-r... File test/cctest/wasm/test-run-wasm-simd.cc (right): https://codereview.chromium.org/2584863002/diff/80001/test/cctest/wasm/test-r... test/cctest/wasm/test-run-wasm-simd.cc:120: CHECK_EQ(1, r.Call(1, 2)); On 2016/12/16 23:35:24, gdeepti wrote: > Is there a reason we do not use floating point values here? > > I guess this is a general question for WASM_SIMD_CHECK_F32_LANE using > WASM_I32_NE and WASM_I32_REINTERPRET_F32 instead of WASM_F32_NE. Changed to be more obviously floating point. Comparing floating point values is a pain, so I'm avoiding Nan values in these tests. I'll add a TODO to figure out how to generate WASM code to compare FP values.
rodolph.perfetta@gmail.com changed reviewers: + rodolph.perfetta@gmail.com
simulator-arm and assember-arm-inl.h look good to me. https://codereview.chromium.org/2584863002/diff/80001/src/arm/simulator-arm.cc File src/arm/simulator-arm.cc (right): https://codereview.chromium.org/2584863002/diff/80001/src/arm/simulator-arm.c... src/arm/simulator-arm.cc:4133: q_data[i] = bit_cast<uint32_t>( static_cast int32_t -> uint32_t is well defined. bitcast will work too obviously. https://codereview.chromium.org/2584863002/diff/80001/src/arm/simulator-arm.c... src/arm/simulator-arm.cc:4138: q_data[i] = bit_cast<uint32_t>( ditto.
bbudge@chromium.org changed reviewers: + titzer@chromium.org - mtrofin@chromium.org
-Mircea + Ben
lgtm with some suggestions to improve the tests https://codereview.chromium.org/2584863002/diff/100001/test/cctest/wasm/test-... File test/cctest/wasm/test-run-wasm-simd.cc (right): https://codereview.chromium.org/2584863002/diff/100001/test/cctest/wasm/test-... test/cctest/wasm/test-run-wasm-simd.cc:180: #define WASM_SIMD_F32x4_BINOP_TEST(Name, OP, op) \ I would prefer to have a helper function rather than each test expanding this macro out. E.g. you can parameterize the function with the WasmOpcode and pass in a pointer to the scalar operation (i.e. add/sub). There is a wasm macro for WASM_BINOP that you can use when the WasmOpcode is a runtime value.
The CQ bit was checked by bbudge@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: v8_mac_rel_ng on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_mac_rel_ng/builds/14508) v8_win_rel_ng on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_win_rel_ng/builds/19809)
The CQ bit was checked by bbudge@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: v8_linux_arm64_rel_ng on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux_arm64_rel_ng/build...) v8_linux_mips64el_compile_rel on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux_mips64el_compile_r...) v8_linux_mipsel_compile_rel on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux_mipsel_compile_rel...) v8_linux_nodcheck_rel_ng on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux_nodcheck_rel_ng/bu...) v8_linux_rel_ng on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux_rel_ng/builds/18072) v8_win_rel_ng on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_win_rel_ng/builds/19810)
The CQ bit was checked by bbudge@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: v8_android_arm_compile_rel on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_android_arm_compile_rel/...)
The CQ bit was checked by bbudge@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by bbudge@chromium.org
The CQ bit was unchecked by bbudge@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from titzer@chromium.org Link to the patchset: https://codereview.chromium.org/2584863002/#ps180001 (title: "Fix Arm compile.")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch. Bot data: {"patchset_id": 180001, "attempt_start_ts": 1482186078985670, "parent_rev": "cc7e0b0eff7b26f784b834247fc89e9fe3b13213", "commit_rev": "0625a686b5971b36b0116ec5c8cebf4428689cb4"}
Message was sent while issue was closed.
Description was changed from ========== [Turbofan] Add native ARM support for basic SIMD 32x4 operations. - Adds Float32x4 ExtractLane, ReplaceLane, Splat, Add, Sub, and conversions to Int32x4 and Uint32x4. - Adds Int32x4 ExtractLane, ReplaceLane, Splat, Add, Sub and conversions to Float32x4 (int and unsigned int). - Adds Int32x4 CompareEqual, CompareNotEqual. - Adds S32x4 Select. - Adds tests for all new SIMD operations. LOG=N BUG=v8:4124 ========== to ========== [Turbofan] Add native ARM support for basic SIMD 32x4 operations. - Adds Float32x4 ExtractLane, ReplaceLane, Splat, Add, Sub, and conversions to Int32x4 and Uint32x4. - Adds Int32x4 ExtractLane, ReplaceLane, Splat, Add, Sub and conversions to Float32x4 (int and unsigned int). - Adds Int32x4 CompareEqual, CompareNotEqual. - Adds S32x4 Select. - Adds tests for all new SIMD operations. LOG=N BUG=v8:4124 Review-Url: https://codereview.chromium.org/2584863002 Cr-Commit-Position: refs/heads/master@{#41828} Committed: https://chromium.googlesource.com/v8/v8/+/0625a686b5971b36b0116ec5c8cebf44286... ==========
Message was sent while issue was closed.
Committed patchset #10 (id:180001) as https://chromium.googlesource.com/v8/v8/+/0625a686b5971b36b0116ec5c8cebf44286...
Message was sent while issue was closed.
https://codereview.chromium.org/2584863002/diff/80001/src/arm/simulator-arm.cc File src/arm/simulator-arm.cc (right): https://codereview.chromium.org/2584863002/diff/80001/src/arm/simulator-arm.c... src/arm/simulator-arm.cc:4133: q_data[i] = bit_cast<uint32_t>( On 2016/12/19 13:43:00, Rodolph Perfetta wrote: > static_cast int32_t -> uint32_t is well defined. bitcast will work too > obviously. I googled a little and when values are outside the target type range, behavior is "implementation defined" so I decided to be safe here and switch to bit_cast. http://stackoverflow.com/questions/13150449/efficient-unsigned-to-signed-cast.... https://codereview.chromium.org/2584863002/diff/100001/test/cctest/wasm/test-... File test/cctest/wasm/test-run-wasm-simd.cc (right): https://codereview.chromium.org/2584863002/diff/100001/test/cctest/wasm/test-... test/cctest/wasm/test-run-wasm-simd.cc:180: #define WASM_SIMD_F32x4_BINOP_TEST(Name, OP, op) \ On 2016/12/19 15:26:59, titzer wrote: > I would prefer to have a helper function rather than each test expanding this > macro out. E.g. you can parameterize the function with the WasmOpcode and pass > in a pointer to the scalar operation (i.e. add/sub). There is a wasm macro for > WASM_BINOP that you can use when the WasmOpcode is a runtime value. I replaced the macro expansions here and below with helper fns. I also added a WASM_SIMD_BINOP macro since we have to emit a SIMD prefix before the op in this case. |