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

Issue 1616103002: Subzero. X8664. Enables RIP-based addressing mode. (Closed)

Created:
4 years, 11 months ago by John
Modified:
4 years, 11 months ago
CC:
native-client-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Patch Set 1 #

Patch Set 2 : merge #

Patch Set 3 : Reverting x32-nonsfi changes. #

Patch Set 4 : Reverting x32-nonsfi changes. #

Patch Set 5 : Reverting x32-nonsfi changes. #

Patch Set 6 : creates named ctor for creating rip-relative addresses; fix x86 assembler tests. #

Patch Set 7 : make presubmit happy. #

Total comments: 14

Patch Set 8 : Fixes absolute addressing -- DO NOT LAND THIS UNTIL THE LLVM-MC PATCHES ARE IN #

Patch Set 9 : Reverts Makefile.standalone changes. #

Patch Set 10 : #

Patch Set 11 : #

Patch Set 12 : Fixes assembler tests #

Patch Set 13 : make format #

Patch Set 14 : Addresses comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+249 lines, -140 lines) Patch
M src/IceAssemblerX86Base.h View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M src/IceAssemblerX86BaseImpl.h View 1 2 3 4 5 6 16 chunks +51 lines, -24 lines 0 comments Download
M src/IceFixups.h View 3 chunks +6 lines, -1 line 0 comments Download
M src/IceFixups.cpp View 1 chunk +3 lines, -3 lines 0 comments Download
M src/IceInstX8664.cpp View 1 2 3 4 5 6 7 3 chunks +29 lines, -5 lines 0 comments Download
M src/IceTargetLoweringX8664.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 5 chunks +83 lines, -25 lines 0 comments Download
M src/IceTargetLoweringX8664Traits.h View 1 2 3 4 5 6 7 8 9 10 7 chunks +51 lines, -52 lines 0 comments Download
M unittest/AssemblerX8664/GPRArith.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M unittest/AssemblerX8664/Locked.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 chunks +23 lines, -26 lines 0 comments Download
M unittest/AssemblerX8664/LowLevel.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -2 lines 0 comments Download

Messages

Total messages: 7 (3 generated)
John
4 years, 11 months ago (2016-01-22 23:38:29 UTC) #2
Jim Stichnoth
lgtm https://codereview.chromium.org/1616103002/diff/110001/src/IceAssemblerX86BaseImpl.h File src/IceAssemblerX86BaseImpl.h (right): https://codereview.chromium.org/1616103002/diff/110001/src/IceAssemblerX86BaseImpl.h#newcode302 src/IceAssemblerX86BaseImpl.h:302: static constexpr RelocOffsetT OffsetFromNextInstruction = 1; What do ...
4 years, 11 months ago (2016-01-23 01:57:47 UTC) #3
John
Committed patchset #14 (id:250001) manually as d1bd1d330c8eb8116811ad4dc01fe636b80b86cb (presubmit successful).
4 years, 11 months ago (2016-01-26 19:44:08 UTC) #6
John
4 years, 11 months ago (2016-01-26 19:44:25 UTC) #7
Message was sent while issue was closed.
https://codereview.chromium.org/1616103002/diff/110001/src/IceAssemblerX86Bas...
File src/IceAssemblerX86BaseImpl.h (right):

https://codereview.chromium.org/1616103002/diff/110001/src/IceAssemblerX86Bas...
src/IceAssemblerX86BaseImpl.h:302: static constexpr RelocOffsetT
OffsetFromNextInstruction = 1;
On 2016/01/23 01:57:46, stichnot wrote:
> What do you think about using typeWidthInBytes(Ty) in this method?

Discussed offline. keeping as is.

https://codereview.chromium.org/1616103002/diff/110001/src/IceAssemblerX86Bas...
src/IceAssemblerX86BaseImpl.h:3398: auto *const Fixup = imm.fixup();
On 2016/01/23 01:57:46, stichnot wrote:
> Fortunately I didn't have to scan too far from here to figure out what Fixup's
> type is...

My arguments for auto here:

1) the following line

AssemblerFixup *const Fixup = imm.fixup();

contains way too many "fixups" in it. (dummy reason, I know, but it is still
valid. :P)

2)  Fixup is not really used here for anything, except to cache imm.fixup(). The
previous code used imm.fixup() as a function argument, ergo the return type was
not known to being with. auto here is not making anything worse than the call

emitFixup(imm.fixup()); // what's typedecl(imm.fixup())?

3) auto is great for "throw away" temporaries like this. I personally refrain
from using temporaries to cache function return values simply because I don't
want to spell out types.

https://codereview.chromium.org/1616103002/diff/110001/src/IceTargetLoweringX...
File src/IceTargetLoweringX8664.cpp (right):

https://codereview.chromium.org/1616103002/diff/110001/src/IceTargetLoweringX...
src/IceTargetLoweringX8664.cpp:307: if (!Var->hasReg()) {
On 2016/01/23 01:57:47, stichnot wrote:
> Optional: You could skip this condition if you want, since getRegNum() returns
> NoRegister if !hasReg().

I did not know that. I will leave this as is -- explicit check will not leave
the reader wondering "what if !Var->hasReg()"

https://codereview.chromium.org/1616103002/diff/110001/src/IceTargetLoweringX...
src/IceTargetLoweringX8664.cpp:311: int32_t RegNum = Var->getRegNum();
On 2016/01/23 01:57:47, stichnot wrote:
> const

Done.

https://codereview.chromium.org/1616103002/diff/110001/src/IceTargetLoweringX...
src/IceTargetLoweringX8664.cpp:349: // We don't return early because we still
need to zero extend Index.
On 2016/01/23 01:57:47, stichnot wrote:
> Is the "don't return early" comment because of my derp comment in the previous
> CL?  If so, don't consider it necessary here. :)

no, it is not. The previous comment said "but we still need to truncate
Mem.Index (if any) to 32-bit." That obscure comment really meant "we can't
return early because with need to movzx(Index)."

https://codereview.chromium.org/1616103002/diff/110001/src/IceTargetLoweringX...
src/IceTargetLoweringX8664.cpp:371: // Otherwise, the lowering generated an
memory operand with two registers.
On 2016/01/23 01:57:47, stichnot wrote:
> s/an/a/

Done.

https://codereview.chromium.org/1616103002/diff/110001/src/IceTargetLoweringX...
src/IceTargetLoweringX8664.cpp:418: llvm::report_fatal_error("Mem pointer should
be a 32-bit integer.");
On 2016/01/23 01:57:47, stichnot wrote:
> Here and below, would it make more sense to say "GPR" instead of "integer"?

I tend to think about GPRs/Regs in the assembler. In the lowering, I believe it
makes more sense to think about temporaries, integer types (which will
eventually be mapped to 32-bit registers, maybe) and other higher-level
entities. but no strong opinions, so done.

Powered by Google App Engine
This is Rietveld 408576698