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

Issue 23560010: Thumb2 Backend: 16-bit instruction encoding helper methods

Created:
7 years, 3 months ago by rkrithiv
Modified:
6 years, 4 months ago
Reviewers:
ulan, danno
Base URL:
HEAD^
Visibility:
Public.

Description

Thumb2 Backend: 16-bit instruction encoding helper methods This patch defines helper methods for the encoding of 16-bit Thumb2 instructions. This is the 1st patch for the Thumb2 Backend. Next patch: https://codereview.chromium.org/24182004/ BUG=none TEST=none

Patch Set 1 #

Total comments: 13

Patch Set 2 : #

Patch Set 3 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+370 lines, -1 line) Patch
M src/arm/assembler-arm.h View 3 chunks +51 lines, -0 lines 0 comments Download
M src/arm/assembler-arm-inl.h View 1 chunk +9 lines, -0 lines 0 comments Download
A src/arm/assembler-thumb16.cc View 1 1 chunk +204 lines, -0 lines 0 comments Download
M src/arm/constants-arm.h View 3 chunks +95 lines, -1 line 0 comments Download
M src/assembler.h View 1 chunk +6 lines, -0 lines 0 comments Download
M src/v8memory.h View 1 chunk +4 lines, -0 lines 0 comments Download
M tools/gyp/v8.gyp View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
rmcilroy_google
Hi Rejeev, Thanks for sending these changes! I'm excited to see what impact using Thumb2 ...
7 years, 3 months ago (2013-09-17 17:28:15 UTC) #1
rkrithiv
https://codereview.chromium.org/23560010/diff/1/src/arm/assembler-arm-inl.h File src/arm/assembler-arm-inl.h (right): https://codereview.chromium.org/23560010/diff/1/src/arm/assembler-arm-inl.h#newcode389 src/arm/assembler-arm-inl.h:389: void Assembler::emit16(Instr16 x, bool check_buffer) { This is used ...
7 years, 2 months ago (2013-09-27 21:40:49 UTC) #2
rmcilroy
7 years, 2 months ago (2013-10-01 10:26:04 UTC) #3
https://codereview.chromium.org/23560010/diff/1/src/arm/assembler-arm-inl.h
File src/arm/assembler-arm-inl.h (right):

https://codereview.chromium.org/23560010/diff/1/src/arm/assembler-arm-inl.h#n...
src/arm/assembler-arm-inl.h:389: void Assembler::emit16(Instr16 x, bool
check_buffer) {
On 2013/09/27 21:40:49, rkrithiv wrote:
> This is used in later patches.
> 
> On 2013/09/17 17:28:16, rmcilroy_google wrote:
> > Why do you need the check_buffer parameter?  There don't seem to be any uses
> of
> > it in this CL.
> 

Please just do always do the CheckBuffer() here and re-introduce the boolean
argument in the CL when it is needed.

https://codereview.chromium.org/23560010/diff/1/src/arm/assembler-thumb16.cc
File src/arm/assembler-thumb16.cc (right):

https://codereview.chromium.org/23560010/diff/1/src/arm/assembler-thumb16.cc#...
src/arm/assembler-thumb16.cc:36: namespace internal {
> > One way to do this might
> > be to change MacroAssembler to inherit from an abstract Assembler (rather
than
> > the concrete Arm ISA assembler as now), and delegate the actual
functionality
> to
> > either a AssemblerArm or AssemblerThumb2 depending on the mode it is in. Any
> > thoughts on this from other folks?
> >
> Could you elaborate on this idea? One thing to remember is that some Assembler
> encoding methods (for VFP/SIMD instructions) are common betweeen ARM and
Thumb2
> modes. We could have a common Assembler class (which would inherit from
> AssemblerBase) define the common encoding methods, then have the AssemblerARM
> and AssemblerThumb2 classes inherit from the common Assembler class and define
> the other encoding methods. And finally we could have a templatized
> MacroAssembler class that inherits from either the AssemblerARM or
> AssemblerThumb2 based on the mode. There are multiple ways in which we could
> separate the two Assemblers, please let me know what design you think would
work
> best for this.

My thoughts were along the same lines as yours.  Something like a
AssemblerCommon (with the common VFP/SIMD instructions, and abstract / pure
virtual methods for the common instructions). AssemblerArm and AssemblerThumb2
would extend this common class, and add their implementations of these
instructions. I wasn't thinking of templatizing MacroAssembler, I was simply
thinking the the MacroAssembler class would no longer extend any Assembler
class, but would simply create either an AssemblerArm or AssemblerThumb2 object,
and delegate all instruction generation methods to this object.  I'd like some
of the other reviewers to comment on this though, since there is a potential
performance cost to the extra level of indirection, and it would also involve
creating a bunch of methods in macroassembler.cc for the non-macro assembler
methods which simply delegate the call through to the actual underlying
assembler.

Daniel, Ulan, Benedikt, do you guys have any opinion on this?

Powered by Google App Engine
This is Rietveld 408576698