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

Issue 1731013: unaligned memory access support for ARMv7

Created:
10 years, 8 months ago by subratokde
Modified:
10 years, 7 months ago
Reviewers:
Erik Corry
CC:
v8-dev
Visibility:
Public.

Description

enabled the support for unaligned memory access for ARMv7. Previous ARM ISA implementations didn't support unaligned access, however ARMv7 ISA implementations made it mandatory to support so. In ARMv7 when SCTLR (system control register) has A=0, unaligned access is allowed for LDR, STR, LDRH, STRH instructions. SCTLT.A = 0 is also the default setting for ARMv7. Also, Linux and all modern Operating systems on ARMv7 always sets SCTLR.A = 0 to support unaligned access, so does many applications on ARMv7 assumes it and uses unaligned access. Hence, it is most efficient to turn on through the Macros defines in global.h, rather than using any kind of runtime detection, as done in this Issue for review. Support has been added to enable unaligned access also in the ARM specific implementation of the regular expression engine.

Patch Set 1 #

Total comments: 2

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Total comments: 3

Patch Set 6 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+80 lines, -8 lines) Patch
M src/arm/constants-arm.h View 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M src/arm/regexp-macro-assembler-arm.cc View 1 2 3 4 5 1 chunk +21 lines, -4 lines 0 comments Download
M src/arm/simulator-arm.cc View 3 4 5 7 chunks +43 lines, -4 lines 0 comments Download
M src/globals.h View 1 2 3 4 5 2 chunks +12 lines, -0 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
Erik Corry
This is definitely a good idea. It is unfortunate that we are duplicating the ARMv7-detection ...
10 years, 8 months ago (2010-04-28 09:07:58 UTC) #1
subratokde
On 2010/04/28 09:07:58, Erik Corry wrote: Thanks for the comments. I am making changes accordingly ...
10 years, 7 months ago (2010-04-30 00:49:57 UTC) #2
subratokde
On 2010/04/30 00:49:57, subratokde wrote: Uploaded the recommended changes.
10 years, 7 months ago (2010-04-30 18:24:59 UTC) #3
Erik Corry
In the light of Rodolpho's comments I think the best way forward for this change ...
10 years, 7 months ago (2010-05-03 12:07:00 UTC) #4
subratokde
modified to use a build time flag CAN_USE_UNALIGNED_ACCESSES. If -DCAN_USE_UNALIGNED_ACCESSES=1 then unaligned access is activated ...
10 years, 7 months ago (2010-05-04 06:22:44 UTC) #5
Erik Corry
LGTM with minor comments, below. Does this change ensure that the code in objects.cc (string ...
10 years, 7 months ago (2010-05-04 07:25:00 UTC) #6
subratokde
10 years, 7 months ago (2010-05-04 21:16:08 UTC) #7
Uploaded patch set 6 with the above recommended changes.

>> Does this change ensure that the code in objects.cc (string copy I think)
also takes advantage of unaligned accesses?

Yes. 

The CAN_USE_UNALIGNED_ACCESSES macro is also used to set
V8_HOST_CAN_READ_UNALIGNED in globals.h, which in turn enables unaligned
read/writes usage for:
(i) CopyChars & CompareChars in utils.h
(ii) CompareRawStringContents in objects.cc

The CopyChars() in (i) are in-turn used to implement String::WriteToFlat() in
objects.cc

Powered by Google App Engine
This is Rietveld 408576698