| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_CODE_GENERATOR_IMPL_H_ | 5 #ifndef V8_COMPILER_CODE_GENERATOR_IMPL_H_ |
| 6 #define V8_COMPILER_CODE_GENERATOR_IMPL_H_ | 6 #define V8_COMPILER_CODE_GENERATOR_IMPL_H_ |
| 7 | 7 |
| 8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
| 9 #include "src/compiler/code-generator.h" | 9 #include "src/compiler/code-generator.h" |
| 10 #include "src/compiler/instruction.h" | 10 #include "src/compiler/instruction.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 } | 32 } |
| 33 | 33 |
| 34 FloatRegister InputFloatRegister(size_t index) { | 34 FloatRegister InputFloatRegister(size_t index) { |
| 35 return ToFloatRegister(instr_->InputAt(index)); | 35 return ToFloatRegister(instr_->InputAt(index)); |
| 36 } | 36 } |
| 37 | 37 |
| 38 DoubleRegister InputDoubleRegister(size_t index) { | 38 DoubleRegister InputDoubleRegister(size_t index) { |
| 39 return ToDoubleRegister(instr_->InputAt(index)); | 39 return ToDoubleRegister(instr_->InputAt(index)); |
| 40 } | 40 } |
| 41 | 41 |
| 42 Simd128Register InputSimd128Register(size_t index) { |
| 43 return ToSimd128Register(instr_->InputAt(index)); |
| 44 } |
| 45 |
| 42 double InputDouble(size_t index) { return ToDouble(instr_->InputAt(index)); } | 46 double InputDouble(size_t index) { return ToDouble(instr_->InputAt(index)); } |
| 43 | 47 |
| 44 float InputFloat32(size_t index) { return ToFloat32(instr_->InputAt(index)); } | 48 float InputFloat32(size_t index) { return ToFloat32(instr_->InputAt(index)); } |
| 45 | 49 |
| 46 int32_t InputInt32(size_t index) { | 50 int32_t InputInt32(size_t index) { |
| 47 return ToConstant(instr_->InputAt(index)).ToInt32(); | 51 return ToConstant(instr_->InputAt(index)).ToInt32(); |
| 48 } | 52 } |
| 49 | 53 |
| 50 uint32_t InputUint32(size_t index) { | 54 uint32_t InputUint32(size_t index) { |
| 51 return bit_cast<uint32_t>(InputInt32(index)); | 55 return bit_cast<uint32_t>(InputInt32(index)); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 } | 98 } |
| 95 | 99 |
| 96 FloatRegister OutputFloatRegister() { | 100 FloatRegister OutputFloatRegister() { |
| 97 return ToFloatRegister(instr_->Output()); | 101 return ToFloatRegister(instr_->Output()); |
| 98 } | 102 } |
| 99 | 103 |
| 100 DoubleRegister OutputDoubleRegister() { | 104 DoubleRegister OutputDoubleRegister() { |
| 101 return ToDoubleRegister(instr_->Output()); | 105 return ToDoubleRegister(instr_->Output()); |
| 102 } | 106 } |
| 103 | 107 |
| 108 Simd128Register OutputSimd128Register() { |
| 109 return ToSimd128Register(instr_->Output()); |
| 110 } |
| 111 |
| 104 // -- Conversions for operands ----------------------------------------------- | 112 // -- Conversions for operands ----------------------------------------------- |
| 105 | 113 |
| 106 Label* ToLabel(InstructionOperand* op) { | 114 Label* ToLabel(InstructionOperand* op) { |
| 107 return gen_->GetLabel(ToRpoNumber(op)); | 115 return gen_->GetLabel(ToRpoNumber(op)); |
| 108 } | 116 } |
| 109 | 117 |
| 110 RpoNumber ToRpoNumber(InstructionOperand* op) { | 118 RpoNumber ToRpoNumber(InstructionOperand* op) { |
| 111 return ToConstant(op).ToRpoNumber(); | 119 return ToConstant(op).ToRpoNumber(); |
| 112 } | 120 } |
| 113 | 121 |
| 114 Register ToRegister(InstructionOperand* op) { | 122 Register ToRegister(InstructionOperand* op) { |
| 115 return LocationOperand::cast(op)->GetRegister(); | 123 return LocationOperand::cast(op)->GetRegister(); |
| 116 } | 124 } |
| 117 | 125 |
| 126 FloatRegister ToFloatRegister(InstructionOperand* op) { |
| 127 return LocationOperand::cast(op)->GetFloatRegister(); |
| 128 } |
| 129 |
| 118 DoubleRegister ToDoubleRegister(InstructionOperand* op) { | 130 DoubleRegister ToDoubleRegister(InstructionOperand* op) { |
| 119 return LocationOperand::cast(op)->GetDoubleRegister(); | 131 return LocationOperand::cast(op)->GetDoubleRegister(); |
| 120 } | 132 } |
| 121 | 133 |
| 122 FloatRegister ToFloatRegister(InstructionOperand* op) { | 134 Simd128Register ToSimd128Register(InstructionOperand* op) { |
| 123 return LocationOperand::cast(op)->GetFloatRegister(); | 135 return LocationOperand::cast(op)->GetSimd128Register(); |
| 124 } | 136 } |
| 125 | 137 |
| 126 Constant ToConstant(InstructionOperand* op) { | 138 Constant ToConstant(InstructionOperand* op) { |
| 127 if (op->IsImmediate()) { | 139 if (op->IsImmediate()) { |
| 128 return gen_->code()->GetImmediate(ImmediateOperand::cast(op)); | 140 return gen_->code()->GetImmediate(ImmediateOperand::cast(op)); |
| 129 } | 141 } |
| 130 return gen_->code()->GetConstant( | 142 return gen_->code()->GetConstant( |
| 131 ConstantOperand::cast(op)->virtual_register()); | 143 ConstantOperand::cast(op)->virtual_register()); |
| 132 } | 144 } |
| 133 | 145 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 #elif V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_X64 | 213 #elif V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_X64 |
| 202 masm->ud2(); | 214 masm->ud2(); |
| 203 #endif | 215 #endif |
| 204 } | 216 } |
| 205 | 217 |
| 206 } // namespace compiler | 218 } // namespace compiler |
| 207 } // namespace internal | 219 } // namespace internal |
| 208 } // namespace v8 | 220 } // namespace v8 |
| 209 | 221 |
| 210 #endif // V8_COMPILER_CODE_GENERATOR_IMPL_H | 222 #endif // V8_COMPILER_CODE_GENERATOR_IMPL_H |
| OLD | NEW |