OLD | NEW |
---|---|
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #ifndef VM_ASSEMBLER_X64_H_ | 5 #ifndef VM_ASSEMBLER_X64_H_ |
6 #define VM_ASSEMBLER_X64_H_ | 6 #define VM_ASSEMBLER_X64_H_ |
7 | 7 |
8 #ifndef VM_ASSEMBLER_H_ | 8 #ifndef VM_ASSEMBLER_H_ |
9 #error Do not include assembler_x64.h directly; use assembler.h instead. | 9 #error Do not include assembler_x64.h directly; use assembler.h instead. |
10 #endif | 10 #endif |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
382 void andq(Register dst, Register src); | 382 void andq(Register dst, Register src); |
383 void andq(Register dst, const Address& address); | 383 void andq(Register dst, const Address& address); |
384 void andq(Register dst, const Immediate& imm); | 384 void andq(Register dst, const Immediate& imm); |
385 | 385 |
386 void orq(Register dst, Register src); | 386 void orq(Register dst, Register src); |
387 void orq(Register dst, const Address& address); | 387 void orq(Register dst, const Address& address); |
388 void orq(Register dst, const Immediate& imm); | 388 void orq(Register dst, const Immediate& imm); |
389 | 389 |
390 void xorq(Register dst, Register src); | 390 void xorq(Register dst, Register src); |
391 void xorq(Register dst, const Address& address); | 391 void xorq(Register dst, const Address& address); |
392 void xorq(const Address& dst, Register src); | |
srdjan
2012/07/23 16:18:59
New assembly functions need test.
| |
392 | 393 |
393 void addl(Register dst, Register src); | 394 void addl(Register dst, Register src); |
394 void addl(const Address& address, const Immediate& imm); | 395 void addl(const Address& address, const Immediate& imm); |
395 | 396 |
396 void addq(Register dst, Register src); | 397 void addq(Register dst, Register src); |
397 void addq(Register reg, const Immediate& imm); | 398 void addq(Register reg, const Immediate& imm); |
398 void addq(Register reg, const Address& address); | 399 void addq(Register reg, const Address& address); |
399 void addq(const Address& address, const Immediate& imm); | 400 void addq(const Address& address, const Immediate& imm); |
400 void addq(const Address& address, Register reg); | 401 void addq(const Address& address, Register reg); |
401 | 402 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
485 lock(); | 486 lock(); |
486 cmpxchgl(address, reg); | 487 cmpxchgl(address, reg); |
487 } | 488 } |
488 | 489 |
489 void cmpxchgq(const Address& address, Register reg); | 490 void cmpxchgq(const Address& address, Register reg); |
490 void lock_cmpxchgq(const Address& address, Register reg) { | 491 void lock_cmpxchgq(const Address& address, Register reg) { |
491 lock(); | 492 lock(); |
492 cmpxchgq(address, reg); | 493 cmpxchgq(address, reg); |
493 } | 494 } |
494 | 495 |
496 // Issue memory to memory move through a TMP register. | |
497 void MoveMemory(const Address& dst, const Address& src) { | |
498 movq(TMP, src); | |
499 movq(dst, TMP); | |
500 } | |
501 | |
502 void Exchange(Register reg, const Address& mem) { | |
503 movq(TMP, mem); | |
504 movq(mem, reg); | |
505 movq(reg, TMP); | |
506 } | |
507 | |
508 void Exchange(const Address& mem1, const Address& mem2) { | |
509 movq(TMP, mem1); | |
510 xorq(TMP, mem2); | |
511 xorq(mem1, TMP); | |
512 xorq(mem2, TMP); | |
513 } | |
514 | |
495 /* | 515 /* |
496 * Macros for High-level operations and implemented on all architectures. | 516 * Macros for High-level operations and implemented on all architectures. |
497 */ | 517 */ |
498 | 518 |
499 void CompareRegisters(Register a, Register b); | 519 void CompareRegisters(Register a, Register b); |
500 | 520 |
501 // Issues a move instruction if 'to' is not the same as 'from'. | 521 // Issues a move instruction if 'to' is not the same as 'from'. |
502 void MoveRegister(Register to, Register from); | 522 void MoveRegister(Register to, Register from); |
503 void PushRegister(Register r); | 523 void PushRegister(Register r); |
504 void PopRegister(Register r); | 524 void PopRegister(Register r); |
505 | 525 |
506 void AddImmediate(Register reg, const Immediate& imm); | 526 void AddImmediate(Register reg, const Immediate& imm); |
507 | 527 |
508 void Drop(intptr_t stack_elements); | 528 void Drop(intptr_t stack_elements); |
509 | 529 |
510 void LoadObject(Register dst, const Object& object); | 530 void LoadObject(Register dst, const Object& object); |
531 void StoreObject(const Address& dst, const Object& obj); | |
511 void PushObject(const Object& object); | 532 void PushObject(const Object& object); |
512 void CompareObject(Register reg, const Object& object); | 533 void CompareObject(Register reg, const Object& object); |
513 void LoadDoubleConstant(XmmRegister dst, double value); | 534 void LoadDoubleConstant(XmmRegister dst, double value); |
514 | 535 |
515 void StoreIntoObject(Register object, // Object we are storing into. | 536 void StoreIntoObject(Register object, // Object we are storing into. |
516 const FieldAddress& dest, // Where we are storing into. | 537 const FieldAddress& dest, // Where we are storing into. |
517 Register value); // Value we are storing. | 538 Register value); // Value we are storing. |
518 | 539 |
519 void StoreIntoObjectNoBarrier(Register object, | 540 void StoreIntoObjectNoBarrier(Register object, |
520 const FieldAddress& dest, | 541 const FieldAddress& dest, |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
676 } | 697 } |
677 | 698 |
678 | 699 |
679 inline void Assembler::EmitOperandSizeOverride() { | 700 inline void Assembler::EmitOperandSizeOverride() { |
680 EmitUint8(0x66); | 701 EmitUint8(0x66); |
681 } | 702 } |
682 | 703 |
683 } // namespace dart | 704 } // namespace dart |
684 | 705 |
685 #endif // VM_ASSEMBLER_X64_H_ | 706 #endif // VM_ASSEMBLER_X64_H_ |
OLD | NEW |