| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_COMPILER_INSTRUCTION_CODES_H_ | 5 #ifndef V8_COMPILER_INSTRUCTION_CODES_H_ |
| 6 #define V8_COMPILER_INSTRUCTION_CODES_H_ | 6 #define V8_COMPILER_INSTRUCTION_CODES_H_ |
| 7 | 7 |
| 8 #include <iosfwd> | 8 #include <iosfwd> |
| 9 | 9 |
| 10 #if V8_TARGET_ARCH_ARM | 10 #if V8_TARGET_ARCH_ARM |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 kEqual, | 107 kEqual, |
| 108 kNotEqual, | 108 kNotEqual, |
| 109 kSignedLessThan, | 109 kSignedLessThan, |
| 110 kSignedGreaterThanOrEqual, | 110 kSignedGreaterThanOrEqual, |
| 111 kSignedLessThanOrEqual, | 111 kSignedLessThanOrEqual, |
| 112 kSignedGreaterThan, | 112 kSignedGreaterThan, |
| 113 kUnsignedLessThan, | 113 kUnsignedLessThan, |
| 114 kUnsignedGreaterThanOrEqual, | 114 kUnsignedGreaterThanOrEqual, |
| 115 kUnsignedLessThanOrEqual, | 115 kUnsignedLessThanOrEqual, |
| 116 kUnsignedGreaterThan, | 116 kUnsignedGreaterThan, |
| 117 kFloatLessThanOrUnordered, |
| 118 kFloatGreaterThanOrEqual, |
| 119 kFloatLessThanOrEqual, |
| 120 kFloatGreaterThanOrUnordered, |
| 121 kFloatLessThan, |
| 122 kFloatGreaterThanOrEqualOrUnordered, |
| 123 kFloatLessThanOrEqualOrUnordered, |
| 124 kFloatGreaterThan, |
| 117 kUnorderedEqual, | 125 kUnorderedEqual, |
| 118 kUnorderedNotEqual, | 126 kUnorderedNotEqual, |
| 119 kOverflow, | 127 kOverflow, |
| 120 kNotOverflow | 128 kNotOverflow |
| 121 }; | 129 }; |
| 122 | 130 |
| 123 inline FlagsCondition NegateFlagsCondition(FlagsCondition condition) { | 131 inline FlagsCondition NegateFlagsCondition(FlagsCondition condition) { |
| 124 return static_cast<FlagsCondition>(condition ^ 1); | 132 return static_cast<FlagsCondition>(condition ^ 1); |
| 125 } | 133 } |
| 126 | 134 |
| 135 FlagsCondition CommuteFlagsCondition(FlagsCondition condition); |
| 136 |
| 127 std::ostream& operator<<(std::ostream& os, const FlagsCondition& fc); | 137 std::ostream& operator<<(std::ostream& os, const FlagsCondition& fc); |
| 128 | 138 |
| 129 // The InstructionCode is an opaque, target-specific integer that encodes | 139 // The InstructionCode is an opaque, target-specific integer that encodes |
| 130 // what code to emit for an instruction in the code generator. It is not | 140 // what code to emit for an instruction in the code generator. It is not |
| 131 // interesting to the register allocator, as the inputs and flags on the | 141 // interesting to the register allocator, as the inputs and flags on the |
| 132 // instructions specify everything of interest. | 142 // instructions specify everything of interest. |
| 133 typedef int32_t InstructionCode; | 143 typedef int32_t InstructionCode; |
| 134 | 144 |
| 135 // Helpers for encoding / decoding InstructionCode into the fields needed | 145 // Helpers for encoding / decoding InstructionCode into the fields needed |
| 136 // for code generation. We encode the instruction, addressing mode, and flags | 146 // for code generation. We encode the instruction, addressing mode, and flags |
| 137 // continuation into a single InstructionCode which is stored as part of | 147 // continuation into a single InstructionCode which is stored as part of |
| 138 // the instruction. | 148 // the instruction. |
| 139 typedef BitField<ArchOpcode, 0, 8> ArchOpcodeField; | 149 typedef BitField<ArchOpcode, 0, 8> ArchOpcodeField; |
| 140 typedef BitField<AddressingMode, 8, 5> AddressingModeField; | 150 typedef BitField<AddressingMode, 8, 5> AddressingModeField; |
| 141 typedef BitField<FlagsMode, 13, 2> FlagsModeField; | 151 typedef BitField<FlagsMode, 13, 2> FlagsModeField; |
| 142 typedef BitField<FlagsCondition, 15, 4> FlagsConditionField; | 152 typedef BitField<FlagsCondition, 15, 5> FlagsConditionField; |
| 143 typedef BitField<int, 19, 13> MiscField; | 153 typedef BitField<int, 20, 12> MiscField; |
| 144 | 154 |
| 145 } // namespace compiler | 155 } // namespace compiler |
| 146 } // namespace internal | 156 } // namespace internal |
| 147 } // namespace v8 | 157 } // namespace v8 |
| 148 | 158 |
| 149 #endif // V8_COMPILER_INSTRUCTION_CODES_H_ | 159 #endif // V8_COMPILER_INSTRUCTION_CODES_H_ |
| OLD | NEW |