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 #ifndef V8_X64_ASSEMBLER_X64_INL_H_ | 5 #ifndef V8_X64_ASSEMBLER_X64_INL_H_ |
6 #define V8_X64_ASSEMBLER_X64_INL_H_ | 6 #define V8_X64_ASSEMBLER_X64_INL_H_ |
7 | 7 |
8 #include "src/x64/assembler-x64.h" | 8 #include "src/x64/assembler-x64.h" |
9 | 9 |
10 #include "src/base/cpu.h" | 10 #include "src/base/cpu.h" |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 void Assembler::emit_optional_rex_32(Register reg, XMMRegister base) { | 172 void Assembler::emit_optional_rex_32(Register reg, XMMRegister base) { |
173 byte rex_bits = (reg.code() & 0x8) >> 1 | (base.code() & 0x8) >> 3; | 173 byte rex_bits = (reg.code() & 0x8) >> 1 | (base.code() & 0x8) >> 3; |
174 if (rex_bits != 0) emit(0x40 | rex_bits); | 174 if (rex_bits != 0) emit(0x40 | rex_bits); |
175 } | 175 } |
176 | 176 |
177 | 177 |
178 void Assembler::emit_optional_rex_32(Register rm_reg) { | 178 void Assembler::emit_optional_rex_32(Register rm_reg) { |
179 if (rm_reg.high_bit()) emit(0x41); | 179 if (rm_reg.high_bit()) emit(0x41); |
180 } | 180 } |
181 | 181 |
182 | 182 void Assembler::emit_optional_rex_32(XMMRegister reg) { |
183 void Assembler::emit_optional_rex_32(XMMRegister rm_reg) { | 183 byte rex_bits = (reg.code() & 0x8) >> 1; |
184 if (rm_reg.high_bit()) emit(0x41); | 184 if (rex_bits != 0) emit(0x40 | rex_bits); |
185 } | 185 } |
186 | 186 |
187 | |
188 void Assembler::emit_optional_rex_32(const Operand& op) { | 187 void Assembler::emit_optional_rex_32(const Operand& op) { |
189 if (op.rex_ != 0) emit(0x40 | op.rex_); | 188 if (op.rex_ != 0) emit(0x40 | op.rex_); |
190 } | 189 } |
191 | 190 |
192 | 191 |
193 // byte 1 of 3-byte VEX | 192 // byte 1 of 3-byte VEX |
194 void Assembler::emit_vex3_byte1(XMMRegister reg, XMMRegister rm, | 193 void Assembler::emit_vex3_byte1(XMMRegister reg, XMMRegister rm, |
195 LeadingOpcode m) { | 194 LeadingOpcode m) { |
196 byte rxb = ~((reg.high_bit() << 2) | rm.high_bit()) << 5; | 195 byte rxb = ~((reg.high_bit() << 2) | rm.high_bit()) << 5; |
197 emit(rxb | m); | 196 emit(rxb | m); |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 void Operand::set_disp64(int64_t disp) { | 609 void Operand::set_disp64(int64_t disp) { |
611 DCHECK_EQ(1, len_); | 610 DCHECK_EQ(1, len_); |
612 int64_t* p = reinterpret_cast<int64_t*>(&buf_[len_]); | 611 int64_t* p = reinterpret_cast<int64_t*>(&buf_[len_]); |
613 *p = disp; | 612 *p = disp; |
614 len_ += sizeof(disp); | 613 len_ += sizeof(disp); |
615 } | 614 } |
616 } // namespace internal | 615 } // namespace internal |
617 } // namespace v8 | 616 } // namespace v8 |
618 | 617 |
619 #endif // V8_X64_ASSEMBLER_X64_INL_H_ | 618 #endif // V8_X64_ASSEMBLER_X64_INL_H_ |
OLD | NEW |