OLD | NEW |
---|---|
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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_MIPS_H_ | 5 #ifndef VM_ASSEMBLER_MIPS_H_ |
6 #define VM_ASSEMBLER_MIPS_H_ | 6 #define VM_ASSEMBLER_MIPS_H_ |
7 | 7 |
8 #ifndef VM_ASSEMBLER_H_ | 8 #ifndef VM_ASSEMBLER_H_ |
9 #error Do not include assembler_mips.h directly; use assembler.h instead. | 9 #error Do not include assembler_mips.h directly; use assembler.h instead. |
10 #endif | 10 #endif |
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
508 EmitRType(SPECIAL, rs, rt, rd, 0, XOR); | 508 EmitRType(SPECIAL, rs, rt, rd, 0, XOR); |
509 } | 509 } |
510 | 510 |
511 // Macros in alphabetical order. | 511 // Macros in alphabetical order. |
512 | 512 |
513 void Branch(const ExternalLabel* label) { | 513 void Branch(const ExternalLabel* label) { |
514 LoadImmediate(TMP, label->address()); | 514 LoadImmediate(TMP, label->address()); |
515 jr(TMP); | 515 jr(TMP); |
516 } | 516 } |
517 | 517 |
518 void BranchPatchable(const ExternalLabel* label) { | |
519 const uint16_t low = Utils::Low16Bits(label->address()); | |
520 const uint16_t high = Utils::High16Bits(label->address()); | |
521 lui(TMP, Immediate(high)); | |
522 ori(TMP, TMP, Immediate(low)); | |
523 jr(TMP); | |
524 delay_slot()->nop(); | |
regis
2013/04/02 20:40:51
This works, but there is already a nop in the dela
| |
525 } | |
526 | |
518 void BranchLink(const ExternalLabel* label) { | 527 void BranchLink(const ExternalLabel* label) { |
519 LoadImmediate(TMP, label->address()); | 528 LoadImmediate(TMP, label->address()); |
520 jalr(TMP); | 529 jalr(TMP); |
521 } | 530 } |
522 | 531 |
523 void BranchLinkPatchable(const ExternalLabel* label) { | 532 void BranchLinkPatchable(const ExternalLabel* label) { |
524 const int32_t offset = | 533 const int32_t offset = |
525 Array::data_offset() + 4*AddExternalLabel(label) - kHeapObjectTag; | 534 Array::data_offset() + 4*AddExternalLabel(label) - kHeapObjectTag; |
526 LoadWordFromPoolOffset(TMP, offset); | 535 LoadWordFromPoolOffset(TMP, offset); |
527 jalr(TMP); | 536 jalr(TMP); |
537 delay_slot()->nop(); | |
regis
2013/04/02 20:40:51
ditto
| |
528 } | 538 } |
529 | 539 |
530 // If the signed value in rs is less than value, rd is 1, and 0 otherwise. | 540 // If the signed value in rs is less than value, rd is 1, and 0 otherwise. |
531 void LessThanSImmediate(Register rd, Register rs, int32_t value) { | 541 void LessThanSImmediate(Register rd, Register rs, int32_t value) { |
532 LoadImmediate(TMP, value); | 542 LoadImmediate(TMP, value); |
533 slt(rd, rs, TMP); | 543 slt(rd, rs, TMP); |
534 } | 544 } |
535 | 545 |
536 // If the unsigned value in rs is less than value, rd is 1, and 0 otherwise. | 546 // If the unsigned value in rs is less than value, rd is 1, and 0 otherwise. |
537 void LessThanUImmediate(Register rd, Register rs, uint32_t value) { | 547 void LessThanUImmediate(Register rd, Register rs, uint32_t value) { |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
717 delay_slot_available_ = true; | 727 delay_slot_available_ = true; |
718 } | 728 } |
719 | 729 |
720 DISALLOW_ALLOCATION(); | 730 DISALLOW_ALLOCATION(); |
721 DISALLOW_COPY_AND_ASSIGN(Assembler); | 731 DISALLOW_COPY_AND_ASSIGN(Assembler); |
722 }; | 732 }; |
723 | 733 |
724 } // namespace dart | 734 } // namespace dart |
725 | 735 |
726 #endif // VM_ASSEMBLER_MIPS_H_ | 736 #endif // VM_ASSEMBLER_MIPS_H_ |
OLD | NEW |