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

Issue 1546373003: Subzero. X86. Refactors initRegisterSet. (Closed)

Created:
4 years, 12 months ago by John
Modified:
4 years, 11 months ago
Reviewers:
Jim Stichnoth
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. X86. Refactors initRegisterSet. initRegisterSet() for x8632 and x8664 were both huge. This CL refactors those methods to use a pre-initialized table instead of the result of expanding the x-macros. BUG= R=stichnot@chromium.org Committed: https://gerrit.chromium.org/gerrit/gitweb?p=native_client/pnacl-subzero.git;a=commit;h=4a308cedda6bfe381dc9506f3508c4547a06275f

Patch Set 1 #

Patch Set 2 : Removes unneeded initializer. #

Total comments: 2

Patch Set 3 : Addresses comments. #

Patch Set 4 : Fixes x86 regressions #

Unified diffs Side-by-side diffs Delta from patch set Stats (+189 lines, -73 lines) Patch
M src/IceInstX8632.def View 1 2 1 chunk +8 lines, -8 lines 0 comments Download
M src/IceInstX8664.def View 1 2 1 chunk +16 lines, -16 lines 0 comments Download
M src/IceRegList.h View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M src/IceTargetLoweringX8632Traits.h View 1 2 3 8 chunks +81 lines, -24 lines 0 comments Download
M src/IceTargetLoweringX8664Traits.h View 1 2 3 9 chunks +82 lines, -25 lines 0 comments Download

Messages

Total messages: 7 (2 generated)
John
4 years, 12 months ago (2015-12-28 23:37:03 UTC) #2
John
4 years, 12 months ago (2015-12-28 23:38:30 UTC) #3
Jim Stichnoth
lgtm https://codereview.chromium.org/1546373003/diff/20001/src/IceTargetLoweringX8632Traits.h File src/IceTargetLoweringX8632Traits.h (right): https://codereview.chromium.org/1546373003/diff/20001/src/IceTargetLoweringX8632Traits.h#newcode590 src/IceTargetLoweringX8632Traits.h:590: // We need to subtract one to account ...
4 years, 11 months ago (2015-12-30 02:50:24 UTC) #4
John
Committed patchset #4 (id:60001) manually as 4a308cedda6bfe381dc9506f3508c4547a06275f (presubmit successful).
4 years, 11 months ago (2015-12-30 17:55:08 UTC) #6
John
4 years, 11 months ago (2015-12-30 17:55:37 UTC) #7
Message was sent while issue was closed.
These changes were not trivial, but I have an upcoming CL that depends on this
one. Given that you're on vacation, I'll land as is, but I'll address any
comments you have on a future cl.

https://codereview.chromium.org/1546373003/diff/20001/src/IceTargetLoweringX8...
File src/IceTargetLoweringX8632Traits.h (right):

https://codereview.chromium.org/1546373003/diff/20001/src/IceTargetLoweringX8...
src/IceTargetLoweringX8632Traits.h:590: // We need to subtract one to account
for Reg_Invalid.
On 2015/12/30 02:50:24, stichnot wrote:
> Any chance this would be unnecessary, and everything else would work out, if
you
> set Reg_Invalid=-1?

Yes, and no. I don't know anyway of telling the linker to initializer

SizeT Aliases[4] = {xmm0};

as

SizeT Aliases[4] = {xmm0, -1, -1, -1};

And given that the alias list comes from a macro expansion within a macro, and
that said macro is used by other targets (e.g., ARM32) I decided against
changing the macro.

I could have changed the IceInstX86??.def files so that all register alias list
would have a terminator -- yuck.

I could also upgrade our toolchain to build sz using c++14, which defines
std::initializer_list<>'s ctor as constexpr (Too much work for 12/30).

My approach was to define a helper class

class SizeOf {
  template <...> SizeOf(...) {}
  SizeOf()
};

that computes the size of the initializer list. I abuse the uniform initializer
syntax (i.e., invoking ctors using {args}) to avoid even moar macro trickery for
removing the { and } from the alias list.

in the end, this solution is not as bad as it could've been. and given that this
is a temporary stopgap until c++14, I am not too sad about defining this new
helper class.

Powered by Google App Engine
This is Rietveld 408576698