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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 kUnorderedEqual, | 91 kUnorderedEqual, |
92 kUnorderedNotEqual, | 92 kUnorderedNotEqual, |
93 kUnorderedLessThan, | 93 kUnorderedLessThan, |
94 kUnorderedGreaterThanOrEqual, | 94 kUnorderedGreaterThanOrEqual, |
95 kUnorderedLessThanOrEqual, | 95 kUnorderedLessThanOrEqual, |
96 kUnorderedGreaterThan, | 96 kUnorderedGreaterThan, |
97 kOverflow, | 97 kOverflow, |
98 kNotOverflow | 98 kNotOverflow |
99 }; | 99 }; |
100 | 100 |
| 101 inline FlagsCondition NegateFlagsCondition(FlagsCondition condition) { |
| 102 return static_cast<FlagsCondition>(condition ^ 1); |
| 103 } |
| 104 |
101 std::ostream& operator<<(std::ostream& os, const FlagsCondition& fc); | 105 std::ostream& operator<<(std::ostream& os, const FlagsCondition& fc); |
102 | 106 |
103 // The InstructionCode is an opaque, target-specific integer that encodes | 107 // The InstructionCode is an opaque, target-specific integer that encodes |
104 // what code to emit for an instruction in the code generator. It is not | 108 // what code to emit for an instruction in the code generator. It is not |
105 // interesting to the register allocator, as the inputs and flags on the | 109 // interesting to the register allocator, as the inputs and flags on the |
106 // instructions specify everything of interest. | 110 // instructions specify everything of interest. |
107 typedef int32_t InstructionCode; | 111 typedef int32_t InstructionCode; |
108 | 112 |
109 // Helpers for encoding / decoding InstructionCode into the fields needed | 113 // Helpers for encoding / decoding InstructionCode into the fields needed |
110 // for code generation. We encode the instruction, addressing mode, and flags | 114 // for code generation. We encode the instruction, addressing mode, and flags |
111 // continuation into a single InstructionCode which is stored as part of | 115 // continuation into a single InstructionCode which is stored as part of |
112 // the instruction. | 116 // the instruction. |
113 typedef BitField<ArchOpcode, 0, 7> ArchOpcodeField; | 117 typedef BitField<ArchOpcode, 0, 7> ArchOpcodeField; |
114 typedef BitField<AddressingMode, 7, 5> AddressingModeField; | 118 typedef BitField<AddressingMode, 7, 5> AddressingModeField; |
115 typedef BitField<FlagsMode, 12, 2> FlagsModeField; | 119 typedef BitField<FlagsMode, 12, 2> FlagsModeField; |
116 typedef BitField<FlagsCondition, 14, 5> FlagsConditionField; | 120 typedef BitField<FlagsCondition, 14, 5> FlagsConditionField; |
117 typedef BitField<int, 14, 18> MiscField; | 121 typedef BitField<int, 14, 18> MiscField; |
118 | 122 |
119 } // namespace compiler | 123 } // namespace compiler |
120 } // namespace internal | 124 } // namespace internal |
121 } // namespace v8 | 125 } // namespace v8 |
122 | 126 |
123 #endif // V8_COMPILER_INSTRUCTION_CODES_H_ | 127 #endif // V8_COMPILER_INSTRUCTION_CODES_H_ |
OLD | NEW |