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

Issue 1129263005: Convert Constant->emit() definitions to allow multiple targets to define them. (Closed)

Created:
5 years, 7 months ago by jvoung (off chromium)
Modified:
5 years, 7 months ago
Reviewers:
Karl, 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

Convert Constant->emit() definitions to allow multiple targets to define them. Wasn't sure how to allow TargetX8632 and TargetARM32 to both define "ConstantInteger32::emit(GlobalContext *)", and define them differently if both targets happen to be ifdef'ed into the code. Rearranged things so that it's now "TargetFoo::emit(ConstantInteger32 *)", so that each TargetFoo can have a separate definition. Some targets may allow emitting some types of constants while other targets do not (64-bit int for x86-64?). Also they emit constants with a different style. E.g., the prefix for x86 is "$" while the prefix for ARM is "#" and there isn't a prefix for mips(?). Renamed emitWithoutDollar to emitWithoutPrefix. Did this sort of multi-method dispatch via a visitor pattern, which is a bit verbose though. We may be able to remove the emitWithoutDollar/Prefix for ConstantPrimitive by just inlining that into the few places that need it (only needed for ConstantInteger32). This undoes the unreachable methods added by: https://codereview.chromium.org/1017373002/diff/60001/src/IceTargetLoweringX8632.cpp The only place extra was for emitting calls to constants. There was already an inlined instance for OperandX8632Mem. BUG= https://code.google.com/p/nativeclient/issues/detail?id=4076 R=stichnot@chromium.org Committed: https://gerrit.chromium.org/gerrit/gitweb?p=native_client/pnacl-subzero.git;a=commit;h=76bb0bec94b99765be86525fa1ae2c607e66d9b6

Patch Set 1 #

Patch Set 2 : undo the emitWithoutDollar for every ConstantPrimitive #

Patch Set 3 : clang-format #

Patch Set 4 : replace with unimplemented as a reminder #

Total comments: 3

Patch Set 5 : typo #

Patch Set 6 : report fatal #

Unified diffs Side-by-side diffs Delta from patch set Stats (+115 lines, -80 lines) Patch
M src/IceInstX8632.cpp View 1 2 2 chunks +7 lines, -3 lines 0 comments Download
M src/IceOperand.h View 1 2 3 4 4 chunks +6 lines, -12 lines 0 comments Download
M src/IceOperand.cpp View 1 2 2 chunks +22 lines, -19 lines 0 comments Download
M src/IceTargetLowering.h View 1 2 chunks +11 lines, -0 lines 0 comments Download
M src/IceTargetLowering.cpp View 1 chunk +24 lines, -0 lines 0 comments Download
M src/IceTargetLoweringARM32.h View 1 1 chunk +8 lines, -0 lines 0 comments Download
M src/IceTargetLoweringARM32.cpp View 1 2 3 4 5 1 chunk +19 lines, -6 lines 0 comments Download
M src/IceTargetLoweringX8632.h View 1 2 chunks +8 lines, -5 lines 0 comments Download
M src/IceTargetLoweringX8632.cpp View 1 2 3 4 5 1 chunk +10 lines, -35 lines 0 comments Download

Messages

Total messages: 6 (1 generated)
jvoung (off chromium)
5 years, 7 months ago (2015-05-13 23:48:52 UTC) #2
Jim Stichnoth
LGTM, thanks! https://codereview.chromium.org/1129263005/diff/60001/src/IceTargetLoweringX8632.cpp File src/IceTargetLoweringX8632.cpp (right): https://codereview.chromium.org/1129263005/diff/60001/src/IceTargetLoweringX8632.cpp#newcode4661 src/IceTargetLoweringX8632.cpp:4661: llvm_unreachable("Not expecting to emit 64-bit integers"); report_fatal_error?
5 years, 7 months ago (2015-05-14 00:36:06 UTC) #3
jvoung (off chromium)
https://codereview.chromium.org/1129263005/diff/60001/src/IceTargetLoweringX8632.cpp File src/IceTargetLoweringX8632.cpp (right): https://codereview.chromium.org/1129263005/diff/60001/src/IceTargetLoweringX8632.cpp#newcode4661 src/IceTargetLoweringX8632.cpp:4661: llvm_unreachable("Not expecting to emit 64-bit integers"); On 2015/05/14 00:36:06, ...
5 years, 7 months ago (2015-05-14 16:14:48 UTC) #4
Jim Stichnoth
https://codereview.chromium.org/1129263005/diff/60001/src/IceTargetLoweringX8632.cpp File src/IceTargetLoweringX8632.cpp (right): https://codereview.chromium.org/1129263005/diff/60001/src/IceTargetLoweringX8632.cpp#newcode4661 src/IceTargetLoweringX8632.cpp:4661: llvm_unreachable("Not expecting to emit 64-bit integers"); On 2015/05/14 16:14:48, ...
5 years, 7 months ago (2015-05-14 16:22:05 UTC) #5
jvoung (off chromium)
5 years, 7 months ago (2015-05-14 16:26:27 UTC) #6
Message was sent while issue was closed.
Committed patchset #6 (id:100001) manually as
76bb0bec94b99765be86525fa1ae2c607e66d9b6 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698