Chromium Code Reviews| Index: src/compiler/opcodes.cc |
| diff --git a/src/compiler/opcodes.cc b/src/compiler/opcodes.cc |
| index 2a8e01a26d90e9bfbe4460f015358e13eb2f8be8..cbb39daafd098ae1656dac2a4f7c58181dae3f01 100644 |
| --- a/src/compiler/opcodes.cc |
| +++ b/src/compiler/opcodes.cc |
| @@ -35,6 +35,39 @@ std::ostream& operator<<(std::ostream& os, IrOpcode::Value opcode) { |
| return os << IrOpcode::Mnemonic(opcode); |
| } |
| + |
| +// static |
| +bool IrOpcode::Is64(Value value) { |
|
titzer
2015/11/13 23:35:17
What are the semantics of this predicate? It's not
fedor.indutny
2015/11/14 00:15:52
This method returns true if the opcode output is a
|
| + switch (value) { |
| + case kInt64Constant: |
| + case kFloat64Constant: |
| + case kChangeTaggedToFloat64: |
| + case kWord64Equal: |
| + case kInt64LessThan: |
| + case kInt64LessThanOrEqual: |
| + case kUint64LessThan: |
| + case kUint64LessThanOrEqual: |
| + case kFloat64Equal: |
| + case kFloat64LessThan: |
| + case kFloat64LessThanOrEqual: |
| + case kChangeFloat32ToFloat64: |
| + case kChangeInt32ToFloat64: |
| + case kChangeInt32ToInt64: |
| + case kChangeUint32ToFloat64: |
| + case kChangeUint32ToUint64: |
| + case kRoundInt64ToFloat64: |
| + case kRoundUint64ToFloat64: |
| + case kBitcastFloat64ToInt64: |
| + case kBitcastInt64ToFloat64: |
| + return true; |
| + |
| + default: |
| + return (value >= kWord64Popcnt && value <= kWord64Ctz) || |
| + (value >= kInt64Add && value <= kUint64Mod) || |
| + (value >= kFloat64Add && value <= kFloat64InsertHighWord32); |
| + } |
| +} |
| + |
| } // namespace compiler |
| } // namespace internal |
| } // namespace v8 |