Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(159)

Issue 2584863002: [Turbofan] Add native ARM support for basic SIMD 32x4 operations. (Closed)

Created:
4 years ago by bbudge
Modified:
4 years ago
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. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+609 lines, -45 lines) Patch
M src/arm/assembler-arm-inl.h View 1 chunk +1 line, -1 line 0 comments Download
M src/arm/simulator-arm.cc View 1 2 3 4 5 6 1 chunk +5 lines, -4 lines 0 comments Download
M src/compiler/arm/code-generator-arm.cc View 1 2 3 4 5 6 1 chunk +85 lines, -0 lines 0 comments Download
M src/compiler/arm/instruction-codes-arm.h View 1 chunk +18 lines, -1 line 0 comments Download
M src/compiler/arm/instruction-scheduler-arm.cc View 1 chunk +17 lines, -0 lines 0 comments Download
M src/compiler/arm/instruction-selector-arm.cc View 1 2 3 4 5 6 1 chunk +107 lines, -0 lines 0 comments Download
M src/compiler/instruction-selector.cc View 1 3 chunks +65 lines, -2 lines 0 comments Download
M src/compiler/wasm-compiler.cc View 1 2 3 4 5 6 1 chunk +29 lines, -5 lines 0 comments Download
M src/wasm/wasm-macro-gen.h View 1 2 3 4 5 6 7 8 2 chunks +20 lines, -6 lines 0 comments Download
M src/wasm/wasm-opcodes.h View 1 chunk +1 line, -1 line 0 comments Download
M test/cctest/BUILD.gn View 1 chunk +1 line, -1 line 0 comments Download
M test/cctest/wasm/test-run-wasm-simd.cc View 1 2 3 4 5 6 7 8 9 4 chunks +260 lines, -24 lines 0 comments Download

Messages

Total messages: 59 (48 generated)
bbudge
4 years ago (2016-12-16 17:21:28 UTC) #15
bbudge
+Rodolph for change to arm/simulator.cc and arm/arm-assembler-inl.h
4 years ago (2016-12-16 22:16:30 UTC) #21
bbudge
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.cc#oldcode3367 src/arm/simulator-arm.cc:3367: memcpy(data, &dn_value, 8); Not sure why, but this doesn't ...
4 years ago (2016-12-16 22:24:29 UTC) #22
gdeepti
https://codereview.chromium.org/2584863002/diff/80001/src/compiler/arm/code-generator-arm.cc File src/compiler/arm/code-generator-arm.cc (right): https://codereview.chromium.org/2584863002/diff/80001/src/compiler/arm/code-generator-arm.cc#newcode1519 src/compiler/arm/code-generator-arm.cc:1519: i.InputFloatRegister(2), kScratchReg, i.InputInt8(1)); How does the kScratchReg work as ...
4 years ago (2016-12-16 23:35:24 UTC) #25
bbudge
https://codereview.chromium.org/2584863002/diff/80001/src/compiler/arm/code-generator-arm.cc File src/compiler/arm/code-generator-arm.cc (right): https://codereview.chromium.org/2584863002/diff/80001/src/compiler/arm/code-generator-arm.cc#newcode1519 src/compiler/arm/code-generator-arm.cc:1519: i.InputFloatRegister(2), kScratchReg, i.InputInt8(1)); On 2016/12/16 23:35:24, gdeepti wrote: > ...
4 years ago (2016-12-17 01:51:05 UTC) #30
Rodolph Perfetta
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.cc#newcode4133 src/arm/simulator-arm.cc:4133: q_data[i] = ...
4 years ago (2016-12-19 13:43:00 UTC) #32
bbudge
-Mircea + Ben
4 years ago (2016-12-19 15:12:11 UTC) #34
titzer
lgtm with some suggestions to improve the tests https://codereview.chromium.org/2584863002/diff/100001/test/cctest/wasm/test-run-wasm-simd.cc File test/cctest/wasm/test-run-wasm-simd.cc (right): https://codereview.chromium.org/2584863002/diff/100001/test/cctest/wasm/test-run-wasm-simd.cc#newcode180 test/cctest/wasm/test-run-wasm-simd.cc:180: #define ...
4 years ago (2016-12-19 15:26:59 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2584863002/180001
4 years ago (2016-12-19 22:21:30 UTC) #55
commit-bot: I haz the power
Committed patchset #10 (id:180001) as https://chromium.googlesource.com/v8/v8/+/0625a686b5971b36b0116ec5c8cebf4428689cb4
4 years ago (2016-12-19 22:23:11 UTC) #58
bbudge
4 years ago (2016-12-20 00:57:13 UTC) #59
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.

Powered by Google App Engine
This is Rietveld 408576698