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

Issue 1676123002: Subzero: Use a proper RegNumT type instead of int32_t/SizeT. (Closed)

Created:
4 years, 10 months ago by Jim Stichnoth
Modified:
4 years, 10 months ago
Reviewers:
Eric Holk, Karl, sehr, John
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

Subzero: Use a proper RegNumT type instead of int32_t/SizeT. Originally, register numbers were represented explicitly as int32_t, particularly so that -1 (or negative values in general) could be used as a NoRegister sentinel value. This created two problems: 1. It would be better to use a unique name for the type, to distinguish from other explicit int32_t uses such as stack offsets. 2. Apart from NoRegister, register number values ultimately come from unsigned sources like enum values and bitvector positions. This results in a number of clumsy casts to remove compiler warnings. This creates a simple RegNumT class to manage this. It also deletes ordered comparison operators to help catch errors where particular register number orderings are assumed (as opposed to orderings of the encoded register values). In addition, it creates a RegNumBitVector wrapper class that makes it much cleaner to do range-based for loops over bit vectors that represent RegNumT sets. BUG= none R=eholk@chromium.org, jpp@chromium.org Committed: https://gerrit.chromium.org/gerrit/gitweb?p=native_client/pnacl-subzero.git;a=commit;h=8aa396610b7baf728631a43ea16ad3d13e38397a

Patch Set 1 #

Patch Set 2 : Minor cleanup #

Patch Set 3 : Fix int32_t ==> int for the result of BitVector find_first() and find_next() #

Total comments: 45

Patch Set 4 : Allow only enum-type arguments in the public RegNumT ctor #

Patch Set 5 : Refactor limit checks into the RegNumT class #

Patch Set 6 : Add the RegNumBitVector adapter class #

Patch Set 7 : Use auto instead of explicit RegNumT where appropriate #

Patch Set 8 : Revert some method name changes #

Total comments: 15

Patch Set 9 : Add "const" to changes where appropriate #

Patch Set 10 : Code review changes #

Patch Set 11 : Make it possible to do "auto NewReg = RegNumT::NoRegister;" #

Unified diffs Side-by-side diffs Delta from patch set Stats (+569 lines, -485 lines) Patch
M src/IceAssemblerARM32.h View 7 1 chunk +2 lines, -2 lines 0 comments Download
M src/IceAssemblerARM32.cpp View 1 2 3 4 5 6 7 8 9 4 chunks +5 lines, -6 lines 0 comments Download
M src/IceCfgNode.cpp View 1 2 3 4 5 6 7 8 4 chunks +6 lines, -6 lines 0 comments Download
M src/IceInstARM32.h View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -3 lines 0 comments Download
M src/IceInstARM32.cpp View 1 2 3 4 5 6 7 8 9 5 chunks +9 lines, -7 lines 0 comments Download
M src/IceInstX8632.cpp View 1 2 3 4 5 6 7 8 4 chunks +5 lines, -5 lines 0 comments Download
M src/IceInstX8664.cpp View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -4 lines 0 comments Download
M src/IceInstX86Base.h View 1 2 3 4 5 6 2 chunks +6 lines, -6 lines 0 comments Download
M src/IceInstX86BaseImpl.h View 1 2 3 4 5 6 7 8 9 10 8 chunks +13 lines, -13 lines 0 comments Download
M src/IceOperand.h View 1 2 3 4 5 6 7 8 9 10 6 chunks +131 lines, -20 lines 0 comments Download
M src/IceOperand.cpp View 1 2 3 4 5 6 7 8 9 10 4 chunks +7 lines, -5 lines 0 comments Download
M src/IceRegAlloc.h View 1 chunk +1 line, -1 line 0 comments Download
M src/IceRegAlloc.cpp View 1 2 3 4 5 6 7 8 9 24 chunks +41 lines, -58 lines 0 comments Download
M src/IceRegistersARM32.h View 1 2 3 4 5 6 7 8 9 5 chunks +30 lines, -37 lines 0 comments Download
M src/IceRegistersMIPS32.h View 1 chunk +4 lines, -3 lines 0 comments Download
M src/IceRegistersX8632.h View 1 chunk +4 lines, -4 lines 0 comments Download
M src/IceTargetLowering.h View 1 2 3 4 5 6 7 8 9 3 chunks +8 lines, -8 lines 0 comments Download
M src/IceTargetLowering.cpp View 1 2 3 4 5 6 7 8 9 3 chunks +9 lines, -7 lines 0 comments Download
M src/IceTargetLoweringARM32.h View 1 2 3 4 5 6 7 8 9 6 chunks +27 lines, -25 lines 0 comments Download
M src/IceTargetLoweringARM32.cpp View 1 2 3 4 5 6 7 8 9 38 chunks +62 lines, -64 lines 0 comments Download
M src/IceTargetLoweringMIPS32.h View 7 5 chunks +15 lines, -13 lines 0 comments Download
M src/IceTargetLoweringMIPS32.cpp View 1 2 3 4 5 6 7 8 11 chunks +20 lines, -19 lines 0 comments Download
M src/IceTargetLoweringX8632Traits.h View 1 2 3 4 5 6 7 8 9 16 chunks +32 lines, -38 lines 0 comments Download
M src/IceTargetLoweringX8664.cpp View 1 2 3 4 5 6 7 8 9 10 2 chunks +3 lines, -3 lines 0 comments Download
M src/IceTargetLoweringX8664Traits.h View 1 2 3 4 5 6 7 8 9 17 chunks +34 lines, -40 lines 0 comments Download
M src/IceTargetLoweringX86Base.h View 1 2 3 4 5 6 7 8 9 9 chunks +26 lines, -26 lines 0 comments Download
M src/IceTargetLoweringX86BaseImpl.h View 1 2 3 4 5 6 7 8 9 10 37 chunks +63 lines, -62 lines 0 comments Download

Messages

Total messages: 17 (6 generated)
Jim Stichnoth
4 years, 10 months ago (2016-02-08 00:28:58 UTC) #3
Eric Holk
https://codereview.chromium.org/1676123002/diff/40001/src/IceAssemblerARM32.cpp File src/IceAssemblerARM32.cpp (right): https://codereview.chromium.org/1676123002/diff/40001/src/IceAssemblerARM32.cpp#newcode201 src/IceAssemblerARM32.cpp:201: } Optional, but would it make sense to turn ...
4 years, 10 months ago (2016-02-08 19:37:10 UTC) #6
Jim Stichnoth
Made some changes based on John's suggestions, and tried to address Eric's comments. I have ...
4 years, 10 months ago (2016-02-09 19:33:40 UTC) #7
Karl
Nearly Good To Me (I didn't see anything wrong, but there are a lot of ...
4 years, 10 months ago (2016-02-09 21:52:15 UTC) #8
Jim Stichnoth
PTAL. The latest patchsets make a few improvements: 1. Allow the target to supply an ...
4 years, 10 months ago (2016-02-10 01:09:21 UTC) #10
Eric Holk
lgtm https://codereview.chromium.org/1676123002/diff/40001/src/IceAssemblerARM32.cpp File src/IceAssemblerARM32.cpp (right): https://codereview.chromium.org/1676123002/diff/40001/src/IceAssemblerARM32.cpp#newcode201 src/IceAssemblerARM32.cpp:201: } On 2016/02/09 19:33:39, stichnot wrote: > On ...
4 years, 10 months ago (2016-02-10 01:11:31 UTC) #11
Jim Stichnoth
https://codereview.chromium.org/1676123002/diff/140001/src/IceCfgNode.cpp File src/IceCfgNode.cpp (right): https://codereview.chromium.org/1676123002/diff/140001/src/IceCfgNode.cpp#newcode342 src/IceCfgNode.cpp:342: auto RegNum2 = Var2->getRegNum(); On 2016/02/10 01:11:31, Eric Holk ...
4 years, 10 months ago (2016-02-10 15:31:57 UTC) #12
John
lgtm commented on the wrong patch, but the comments still hold. https://codereview.chromium.org/1676123002/diff/140001/src/IceAssemblerARM32.cpp File src/IceAssemblerARM32.cpp (right): ...
4 years, 10 months ago (2016-02-10 16:01:51 UTC) #13
Jim Stichnoth
https://codereview.chromium.org/1676123002/diff/140001/src/IceAssemblerARM32.cpp File src/IceAssemblerARM32.cpp (right): https://codereview.chromium.org/1676123002/diff/140001/src/IceAssemblerARM32.cpp#newcode588 src/IceAssemblerARM32.cpp:588: RegARM32::getRegName(RegNumT::fixme(Reg)) + On 2016/02/10 16:01:51, John wrote: > this ...
4 years, 10 months ago (2016-02-10 17:47:20 UTC) #14
Jim Stichnoth
https://codereview.chromium.org/1676123002/diff/140001/src/IceOperand.h File src/IceOperand.h (right): https://codereview.chromium.org/1676123002/diff/140001/src/IceOperand.h#newcode441 src/IceOperand.h:441: // Define NoRegister as an enum value so that ...
4 years, 10 months ago (2016-02-10 18:47:30 UTC) #15
Jim Stichnoth
4 years, 10 months ago (2016-02-10 19:20:55 UTC) #17
Message was sent while issue was closed.
Committed patchset #11 (id:200001) manually as
8aa396610b7baf728631a43ea16ad3d13e38397a (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698