Chromium Code Reviews

Issue 613483002: Change some explicit type checks into using helper functions. (Closed)

Created:
6 years, 2 months ago by jvoung (off chromium)
Modified:
6 years, 2 months ago
Reviewers:
kschimpf, Karl, Jim Stichnoth
CC:
native-client-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Visibility:
Public.

Description

Change some explicit type checks into using helper functions. For some arithmetic assembler methods, instead of checking IceType_i8 || IceType_i1, only allow IceType_i8 and assert if an i1 leaked to that stage (should have been vetted earlier by the bitcode reader / ABI checks). Could have looked up the type width and isIntegerArithmeticType, etc. in the property table, but that seemed a bit heavy for just checking one type (or one of two types). Also changed some f32 || f64 checks into just using isScalarFloatingType() which looks things up in a property table. Could alternatively just keep it as an simple f32 || f64 check, and I could change isScalarFloatingType()'s implementation. In some places where we assume something is either i32 or i64 and do a select, change that into using a helper function so that we can do one compare, and then assert. Some of the asserts are really redundant (already within a branch which already checked that), but hopefully that disappears if we compile in release mode. Similar for f32 or f64 (which happened a lot in the assembler). BUG=none R=kschimpf@google.com, stichnot@chromium.org Committed: https://gerrit.chromium.org/gerrit/gitweb?p=native_client/pnacl-subzero.git;a=commit;h=3a56918360284f1329235055d59ff156f576de42

Patch Set 1 #

Patch Set 2 : format #

Total comments: 3

Patch Set 3 : rename #

Total comments: 2
Unified diffs Side-by-side diffs Stats (+107 lines, -83 lines)
M src/IceInstX8632.cpp View 4 chunks +5 lines, -11 lines 0 comments
M src/IceRegistersX8632.h View 1 chunk +1 line, -1 line 0 comments
M src/IceTargetLoweringX8632.cpp View 16 chunks +25 lines, -23 lines 2 comments
M src/IceTypes.h View 1 chunk +28 lines, -0 lines 0 comments
M src/assembler_ia32.h View 1 chunk +1 line, -1 line 0 comments
M src/assembler_ia32.cpp View 47 chunks +47 lines, -47 lines 0 comments

Messages

Total messages: 9 (2 generated)
jvoung (off chromium)
https://codereview.chromium.org/613483002/diff/20001/src/IceTypes.h File src/IceTypes.h (right): https://codereview.chromium.org/613483002/diff/20001/src/IceTypes.h#newcode87 src/IceTypes.h:87: inline bool isInt32Assuming32Or64(Type Ty) { Hmm different name suggestions ...
6 years, 2 months ago (2014-09-27 00:23:39 UTC) #2
Jim Stichnoth
LGTM. Your call on the naming choice... https://codereview.chromium.org/613483002/diff/20001/src/IceTypes.h File src/IceTypes.h (right): https://codereview.chromium.org/613483002/diff/20001/src/IceTypes.h#newcode87 src/IceTypes.h:87: inline bool ...
6 years, 2 months ago (2014-09-27 00:38:22 UTC) #3
jvoung (off chromium)
https://codereview.chromium.org/613483002/diff/20001/src/IceTypes.h File src/IceTypes.h (right): https://codereview.chromium.org/613483002/diff/20001/src/IceTypes.h#newcode87 src/IceTypes.h:87: inline bool isInt32Assuming32Or64(Type Ty) { On 2014/09/27 00:38:22, stichnot ...
6 years, 2 months ago (2014-09-29 16:10:52 UTC) #4
Karl
lgtm https://codereview.chromium.org/613483002/diff/40001/src/IceTargetLoweringX8632.cpp File src/IceTargetLoweringX8632.cpp (right): https://codereview.chromium.org/613483002/diff/40001/src/IceTargetLoweringX8632.cpp#newcode2188 src/IceTargetLoweringX8632.cpp:2188: isFloat32Asserting32Or64(DestType) ? "cvtsi64tof" : "cvtsi64tod", Mnior nit. This ...
6 years, 2 months ago (2014-09-29 16:20:51 UTC) #6
jvoung (off chromium)
https://codereview.chromium.org/613483002/diff/40001/src/IceTargetLoweringX8632.cpp File src/IceTargetLoweringX8632.cpp (right): https://codereview.chromium.org/613483002/diff/40001/src/IceTargetLoweringX8632.cpp#newcode2188 src/IceTargetLoweringX8632.cpp:2188: isFloat32Asserting32Or64(DestType) ? "cvtsi64tof" : "cvtsi64tod", On 2014/09/29 16:20:51, Karl ...
6 years, 2 months ago (2014-09-29 16:57:50 UTC) #7
Karl
lgtm
6 years, 2 months ago (2014-09-29 17:08:01 UTC) #8
jvoung (off chromium)
6 years, 2 months ago (2014-09-29 17:16:06 UTC) #9
Message was sent while issue was closed.
Committed patchset #3 (id:40001) manually as
3a56918360284f1329235055d59ff156f576de42 (presubmit successful).

Powered by Google App Engine