| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 #include "src/x64/assembler-x64.h" | 5 #include "src/x64/assembler-x64.h" |
| 6 | 6 |
| 7 #include <cstring> | 7 #include <cstring> |
| 8 | 8 |
| 9 #if V8_TARGET_ARCH_X64 | 9 #if V8_TARGET_ARCH_X64 |
| 10 | 10 |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 "POPCNT=%d ATOM=%d\n", | 109 "POPCNT=%d ATOM=%d\n", |
| 110 CpuFeatures::IsSupported(SSE3), CpuFeatures::IsSupported(SSE4_1), | 110 CpuFeatures::IsSupported(SSE3), CpuFeatures::IsSupported(SSE4_1), |
| 111 CpuFeatures::IsSupported(SAHF), CpuFeatures::IsSupported(AVX), | 111 CpuFeatures::IsSupported(SAHF), CpuFeatures::IsSupported(AVX), |
| 112 CpuFeatures::IsSupported(FMA3), CpuFeatures::IsSupported(BMI1), | 112 CpuFeatures::IsSupported(FMA3), CpuFeatures::IsSupported(BMI1), |
| 113 CpuFeatures::IsSupported(BMI2), CpuFeatures::IsSupported(LZCNT), | 113 CpuFeatures::IsSupported(BMI2), CpuFeatures::IsSupported(LZCNT), |
| 114 CpuFeatures::IsSupported(POPCNT), CpuFeatures::IsSupported(ATOM)); | 114 CpuFeatures::IsSupported(POPCNT), CpuFeatures::IsSupported(ATOM)); |
| 115 } | 115 } |
| 116 | 116 |
| 117 | 117 |
| 118 // ----------------------------------------------------------------------------- | 118 // ----------------------------------------------------------------------------- |
| 119 // Register constants. | |
| 120 | |
| 121 const int | |
| 122 Register::kRegisterCodeByAllocationIndex[kMaxNumAllocatableRegisters] = { | |
| 123 // rax, rbx, rdx, rcx, rsi, rdi, r8, r9, r11, r12, r14, r15 | |
| 124 0, 3, 2, 1, 6, 7, 8, 9, 11, 12, 14, 15 | |
| 125 }; | |
| 126 | |
| 127 const int Register::kAllocationIndexByRegisterCode[kNumRegisters] = { | |
| 128 0, 3, 2, 1, -1, -1, 4, 5, 6, 7, -1, 8, 9, -1, 10, 11 | |
| 129 }; | |
| 130 | |
| 131 | |
| 132 // ----------------------------------------------------------------------------- | |
| 133 // Implementation of Operand | 119 // Implementation of Operand |
| 134 | 120 |
| 135 Operand::Operand(Register base, int32_t disp) : rex_(0) { | 121 Operand::Operand(Register base, int32_t disp) : rex_(0) { |
| 136 len_ = 1; | 122 len_ = 1; |
| 137 if (base.is(rsp) || base.is(r12)) { | 123 if (base.is(rsp) || base.is(r12)) { |
| 138 // SIB byte is needed to encode (rsp + offset) or (r12 + offset). | 124 // SIB byte is needed to encode (rsp + offset) or (r12 + offset). |
| 139 set_sib(times_1, rsp, base); | 125 set_sib(times_1, rsp, base); |
| 140 } | 126 } |
| 141 | 127 |
| 142 if (disp == 0 && !base.is(rbp) && !base.is(r13)) { | 128 if (disp == 0 && !base.is(rbp) && !base.is(r13)) { |
| (...skipping 3800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3943 | 3929 |
| 3944 bool RelocInfo::IsInConstantPool() { | 3930 bool RelocInfo::IsInConstantPool() { |
| 3945 return false; | 3931 return false; |
| 3946 } | 3932 } |
| 3947 | 3933 |
| 3948 | 3934 |
| 3949 } // namespace internal | 3935 } // namespace internal |
| 3950 } // namespace v8 | 3936 } // namespace v8 |
| 3951 | 3937 |
| 3952 #endif // V8_TARGET_ARCH_X64 | 3938 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |