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

Issue 2669203005: [arm64][turbofan] Fix add+shr for big shift values. (Closed)

Created:
3 years, 10 months ago by ahaas
Modified:
3 years, 10 months ago
Reviewers:
Benedikt Meurer, v8-arm-ports, martyn.capewell
CC:
v8-reviews_googlegroups.com
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[arm64][turbofan] Fix add+shr for big shift values. Arm64 compiles "x +_64 (y >> shift)" into a single instruction if "shift" is a constant. The code generator expects that "shift" is a 32 bit constant. however, TurboFan can also pass in a 64 bit constant, which caused a crash in the code generator. With this CL we cast the constant of TurboFan to an int in the instruction selector and thereby satisfy the assumption of the code generator. This should be correct since the code generator anyways cast the "shift" to an int5 or int6 eventually. R=v8-arm-ports@googlegroups.com BUG=v8:5923 Review-Url: https://codereview.chromium.org/2669203005 Cr-Commit-Position: refs/heads/master@{#43036} Committed: https://chromium.googlesource.com/v8/v8/+/ed6e28d2ad00326244abc6988783a5e04b873ef4

Patch Set 1 #

Total comments: 2

Patch Set 2 : Use only the last 6 bit of the shift. #

Patch Set 3 : Fixed an issue with the test. #

Patch Set 4 : Adjusted a unittest #

Patch Set 5 : Only consider the last 6 bits of the shift immediate #

Unified diffs Side-by-side diffs Delta from patch set Stats (+38 lines, -11 lines) Patch
M src/compiler/arm64/instruction-selector-arm64.cc View 1 1 chunk +6 lines, -2 lines 0 comments Download
M test/cctest/compiler/test-run-machops.cc View 1 2 1 chunk +23 lines, -0 lines 0 comments Download
M test/unittests/compiler/arm64/instruction-selector-arm64-unittest.cc View 1 2 3 4 9 chunks +9 lines, -9 lines 0 comments Download

Messages

Total messages: 37 (26 generated)
ahaas
3 years, 10 months ago (2017-02-03 10:49:34 UTC) #1
martyn.capewell
https://codereview.chromium.org/2669203005/diff/1/src/compiler/arm64/instruction-selector-arm64.cc File src/compiler/arm64/instruction-selector-arm64.cc (right): https://codereview.chromium.org/2669203005/diff/1/src/compiler/arm64/instruction-selector-arm64.cc#newcode440 src/compiler/arm64/instruction-selector-arm64.cc:440: g.UseImmediate(static_cast<int>(m_shift.right().Value())); I think this cast is implementation defined; the ...
3 years, 10 months ago (2017-02-03 11:44:37 UTC) #7
ahaas
https://codereview.chromium.org/2669203005/diff/1/src/compiler/arm64/instruction-selector-arm64.cc File src/compiler/arm64/instruction-selector-arm64.cc (right): https://codereview.chromium.org/2669203005/diff/1/src/compiler/arm64/instruction-selector-arm64.cc#newcode440 src/compiler/arm64/instruction-selector-arm64.cc:440: g.UseImmediate(static_cast<int>(m_shift.right().Value())); On 2017/02/03 at 11:44:37, martyn.capewell wrote: > I ...
3 years, 10 months ago (2017-02-03 12:46:11 UTC) #10
martyn.capewell
lgtm
3 years, 10 months ago (2017-02-03 15:15:50 UTC) #15
ahaas
On 2017/02/03 at 15:15:50, martyn.capewell wrote: > lgtm I had to adjust unittests. They expected ...
3 years, 10 months ago (2017-02-07 14:59:05 UTC) #22
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/2669203005/80001
3 years, 10 months ago (2017-02-07 15:29:41 UTC) #27
commit-bot: I haz the power
Try jobs failed on following builders: v8_presubmit on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_presubmit/builds/34179)
3 years, 10 months ago (2017-02-07 15:33:45 UTC) #29
Benedikt Meurer
LGTM (rubberstamped)
3 years, 10 months ago (2017-02-08 11:28:52 UTC) #31
Benedikt Meurer
LGTM (rubberstamped)
3 years, 10 months ago (2017-02-08 11:28:52 UTC) #32
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/2669203005/80001
3 years, 10 months ago (2017-02-08 11:29:59 UTC) #34
commit-bot: I haz the power
3 years, 10 months ago (2017-02-08 11:52:23 UTC) #37
Message was sent while issue was closed.
Committed patchset #5 (id:80001) as
https://chromium.googlesource.com/v8/v8/+/ed6e28d2ad00326244abc6988783a5e04b8...

Powered by Google App Engine
This is Rietveld 408576698