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

Unified Diff: src/compiler/opcodes.h

Issue 951903003: [turbofan] Strength reduction for inline comparisons. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/node-matchers.cc ('k') | test/unittests/compiler/machine-operator-reducer-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/opcodes.h
diff --git a/src/compiler/opcodes.h b/src/compiler/opcodes.h
index 31ef304bbacfda421a7358450bb1cb9f74789865..18f40dd6a76b38b8f4e4c10b8363e0ed5ff6f328 100644
--- a/src/compiler/opcodes.h
+++ b/src/compiler/opcodes.h
@@ -140,113 +140,119 @@
JS_OTHER_OP_LIST(V)
// Opcodes for VirtuaMachine-level operators.
-#define SIMPLIFIED_OP_LIST(V) \
- V(AnyToBoolean) \
- V(BooleanNot) \
- V(BooleanToNumber) \
- V(NumberEqual) \
- V(NumberLessThan) \
- V(NumberLessThanOrEqual) \
- V(NumberAdd) \
- V(NumberSubtract) \
- V(NumberMultiply) \
- V(NumberDivide) \
- V(NumberModulus) \
- V(NumberToInt32) \
- V(NumberToUint32) \
- V(PlainPrimitiveToNumber) \
- V(ReferenceEqual) \
- V(StringEqual) \
- V(StringLessThan) \
- V(StringLessThanOrEqual) \
- V(StringAdd) \
- V(ChangeTaggedToInt32) \
- V(ChangeTaggedToUint32) \
- V(ChangeTaggedToFloat64) \
- V(ChangeInt32ToTagged) \
- V(ChangeUint32ToTagged) \
- V(ChangeFloat64ToTagged) \
- V(ChangeBoolToBit) \
- V(ChangeBitToBool) \
- V(LoadField) \
- V(LoadBuffer) \
- V(LoadElement) \
- V(StoreField) \
- V(StoreBuffer) \
- V(StoreElement) \
- V(ObjectIsSmi) \
+#define SIMPLIFIED_COMPARE_BINOP_LIST(V) \
+ V(NumberEqual) \
+ V(NumberLessThan) \
+ V(NumberLessThanOrEqual) \
+ V(ReferenceEqual) \
+ V(StringEqual) \
+ V(StringLessThan) \
+ V(StringLessThanOrEqual)
+
+#define SIMPLIFIED_OP_LIST(V) \
+ SIMPLIFIED_COMPARE_BINOP_LIST(V) \
+ V(AnyToBoolean) \
+ V(BooleanNot) \
+ V(BooleanToNumber) \
+ V(NumberAdd) \
+ V(NumberSubtract) \
+ V(NumberMultiply) \
+ V(NumberDivide) \
+ V(NumberModulus) \
+ V(NumberToInt32) \
+ V(NumberToUint32) \
+ V(PlainPrimitiveToNumber) \
+ V(StringAdd) \
+ V(ChangeTaggedToInt32) \
+ V(ChangeTaggedToUint32) \
+ V(ChangeTaggedToFloat64) \
+ V(ChangeInt32ToTagged) \
+ V(ChangeUint32ToTagged) \
+ V(ChangeFloat64ToTagged) \
+ V(ChangeBoolToBit) \
+ V(ChangeBitToBool) \
+ V(LoadField) \
+ V(LoadBuffer) \
+ V(LoadElement) \
+ V(StoreField) \
+ V(StoreBuffer) \
+ V(StoreElement) \
+ V(ObjectIsSmi) \
V(ObjectIsNonNegativeSmi)
// Opcodes for Machine-level operators.
-#define MACHINE_OP_LIST(V) \
- V(Load) \
- V(Store) \
- V(Word32And) \
- V(Word32Or) \
- V(Word32Xor) \
- V(Word32Shl) \
- V(Word32Shr) \
- V(Word32Sar) \
- V(Word32Ror) \
- V(Word32Equal) \
- V(Word64And) \
- V(Word64Or) \
- V(Word64Xor) \
- V(Word64Shl) \
- V(Word64Shr) \
- V(Word64Sar) \
- V(Word64Ror) \
- V(Word64Equal) \
- V(Int32Add) \
- V(Int32AddWithOverflow) \
- V(Int32Sub) \
- V(Int32SubWithOverflow) \
- V(Int32Mul) \
- V(Int32MulHigh) \
- V(Int32Div) \
- V(Int32Mod) \
- V(Int32LessThan) \
- V(Int32LessThanOrEqual) \
- V(Uint32Div) \
- V(Uint32LessThan) \
- V(Uint32LessThanOrEqual) \
- V(Uint32Mod) \
- V(Uint32MulHigh) \
- V(Int64Add) \
- V(Int64Sub) \
- V(Int64Mul) \
- V(Int64Div) \
- V(Int64Mod) \
- V(Int64LessThan) \
- V(Int64LessThanOrEqual) \
- V(Uint64Div) \
- V(Uint64LessThan) \
- V(Uint64Mod) \
- V(ChangeFloat32ToFloat64) \
- V(ChangeFloat64ToInt32) \
- V(ChangeFloat64ToUint32) \
- V(ChangeInt32ToFloat64) \
- V(ChangeInt32ToInt64) \
- V(ChangeUint32ToFloat64) \
- V(ChangeUint32ToUint64) \
- V(TruncateFloat64ToFloat32) \
- V(TruncateFloat64ToInt32) \
- V(TruncateInt64ToInt32) \
- V(Float64Add) \
- V(Float64Sub) \
- V(Float64Mul) \
- V(Float64Div) \
- V(Float64Mod) \
- V(Float64Sqrt) \
- V(Float64Equal) \
- V(Float64LessThan) \
- V(Float64LessThanOrEqual) \
- V(Float64Floor) \
- V(Float64Ceil) \
- V(Float64RoundTruncate) \
- V(Float64RoundTiesAway) \
- V(LoadStackPointer) \
- V(CheckedLoad) \
+#define MACHINE_COMPARE_BINOP_LIST(V) \
+ V(Word32Equal) \
+ V(Word64Equal) \
+ V(Int32LessThan) \
+ V(Int32LessThanOrEqual) \
+ V(Uint32LessThan) \
+ V(Uint32LessThanOrEqual) \
+ V(Int64LessThan) \
+ V(Int64LessThanOrEqual) \
+ V(Uint64LessThan) \
+ V(Float64Equal) \
+ V(Float64LessThan) \
+ V(Float64LessThanOrEqual)
+
+#define MACHINE_OP_LIST(V) \
+ MACHINE_COMPARE_BINOP_LIST(V) \
+ V(Load) \
+ V(Store) \
+ V(Word32And) \
+ V(Word32Or) \
+ V(Word32Xor) \
+ V(Word32Shl) \
+ V(Word32Shr) \
+ V(Word32Sar) \
+ V(Word32Ror) \
+ V(Word64And) \
+ V(Word64Or) \
+ V(Word64Xor) \
+ V(Word64Shl) \
+ V(Word64Shr) \
+ V(Word64Sar) \
+ V(Word64Ror) \
+ V(Int32Add) \
+ V(Int32AddWithOverflow) \
+ V(Int32Sub) \
+ V(Int32SubWithOverflow) \
+ V(Int32Mul) \
+ V(Int32MulHigh) \
+ V(Int32Div) \
+ V(Int32Mod) \
+ V(Uint32Div) \
+ V(Uint32Mod) \
+ V(Uint32MulHigh) \
+ V(Int64Add) \
+ V(Int64Sub) \
+ V(Int64Mul) \
+ V(Int64Div) \
+ V(Int64Mod) \
+ V(Uint64Div) \
+ V(Uint64Mod) \
+ V(ChangeFloat32ToFloat64) \
+ V(ChangeFloat64ToInt32) \
+ V(ChangeFloat64ToUint32) \
+ V(ChangeInt32ToFloat64) \
+ V(ChangeInt32ToInt64) \
+ V(ChangeUint32ToFloat64) \
+ V(ChangeUint32ToUint64) \
+ V(TruncateFloat64ToFloat32) \
+ V(TruncateFloat64ToInt32) \
+ V(TruncateInt64ToInt32) \
+ V(Float64Add) \
+ V(Float64Sub) \
+ V(Float64Mul) \
+ V(Float64Div) \
+ V(Float64Mod) \
+ V(Float64Sqrt) \
+ V(Float64Floor) \
+ V(Float64Ceil) \
+ V(Float64RoundTruncate) \
+ V(Float64RoundTiesAway) \
+ V(LoadStackPointer) \
+ V(CheckedLoad) \
V(CheckedStore)
#define VALUE_OP_LIST(V) \
@@ -308,6 +314,13 @@ class IrOpcode {
static bool IsMergeOpcode(Value value) {
return value == kMerge || value == kLoop;
}
+
+ // Returns true if opcode for comparison operator.
+ static bool IsComparisonOpcode(Value value) {
+ return (kJSEqual <= value && value <= kJSGreaterThanOrEqual) ||
+ (kNumberEqual <= value && value <= kStringLessThanOrEqual) ||
+ (kWord32Equal <= value && value <= kFloat64LessThanOrEqual);
+ }
};
} // namespace compiler
« no previous file with comments | « src/compiler/node-matchers.cc ('k') | test/unittests/compiler/machine-operator-reducer-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698