| 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 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 } | 546 } |
| 547 | 547 |
| 548 void sw(Register rt, const Address& addr) { | 548 void sw(Register rt, const Address& addr) { |
| 549 EmitLoadStore(SW, rt, addr); | 549 EmitLoadStore(SW, rt, addr); |
| 550 } | 550 } |
| 551 | 551 |
| 552 void swc1(FRegister ft, const Address& addr) { | 552 void swc1(FRegister ft, const Address& addr) { |
| 553 EmitFpuLoadStore(SWC1, ft, addr); | 553 EmitFpuLoadStore(SWC1, ft, addr); |
| 554 } | 554 } |
| 555 | 555 |
| 556 void xori(Register rt, Register rs, const Immediate& imm) { |
| 557 ASSERT(Utils::IsUint(kImmBits, imm.value())); |
| 558 const uint16_t imm_value = static_cast<uint16_t>(imm.value()); |
| 559 EmitIType(XORI, rs, rt, imm_value); |
| 560 } |
| 561 |
| 556 void xor_(Register rd, Register rs, Register rt) { | 562 void xor_(Register rd, Register rs, Register rt) { |
| 557 EmitRType(SPECIAL, rs, rt, rd, 0, XOR); | 563 EmitRType(SPECIAL, rs, rt, rd, 0, XOR); |
| 558 } | 564 } |
| 559 | 565 |
| 560 // Macros in alphabetical order. | 566 // Macros in alphabetical order. |
| 561 | 567 |
| 562 // Addition of rs and rt with the result placed in rd. | 568 // Addition of rs and rt with the result placed in rd. |
| 563 // After, ro < 0 if there was signed overflow, ro >= 0 otherwise. | 569 // After, ro < 0 if there was signed overflow, ro >= 0 otherwise. |
| 564 // rd and ro must not be TMP1 or TMP2. | 570 // rd and ro must not be TMP1 or TMP2. |
| 565 // ro must be different from all the other registers. | 571 // ro must be different from all the other registers. |
| 566 void AdduDetectOverflow(Register rd, Register rs, Register rt, Register ro); | 572 void AdduDetectOverflow(Register rd, Register rs, Register rt, Register ro); |
| 567 | 573 |
| 568 // ro must be different from rd and rs. | 574 // ro must be different from rd and rs. |
| 569 // rd and ro must not be TMP1 or TMP2 | 575 // rd and ro must not be TMP1 or TMP2 |
| 570 void AddImmediateDetectOverflow(Register rd, Register rs, int32_t imm, | 576 void AddImmediateDetectOverflow(Register rd, Register rs, int32_t imm, |
| 571 Register ro) { | 577 Register ro) { |
| 572 LoadImmediate(rd, imm); | 578 LoadImmediate(rd, imm); |
| 573 AdduDetectOverflow(rd, rs, rd, ro); | 579 AdduDetectOverflow(rd, rs, rd, ro); |
| 574 } | 580 } |
| 575 | 581 |
| 582 // Subtraction of rt from rs (rs - rt) with the result placed in rd. |
| 583 // After, ro < 0 if there was signed overflow, ro >= 0 otherwise. |
| 584 // None of rd, rs, rt, or ro may be TMP1. |
| 585 // ro must be different from the other registers. |
| 586 void SubuDetectOverflow(Register rd, Register rs, Register rt, Register ro); |
| 587 |
| 576 void Branch(const ExternalLabel* label) { | 588 void Branch(const ExternalLabel* label) { |
| 577 LoadImmediate(TMP1, label->address()); | 589 LoadImmediate(TMP1, label->address()); |
| 578 jr(TMP1); | 590 jr(TMP1); |
| 579 } | 591 } |
| 580 | 592 |
| 581 void BranchPatchable(const ExternalLabel* label) { | 593 void BranchPatchable(const ExternalLabel* label) { |
| 582 const uint16_t low = Utils::Low16Bits(label->address()); | 594 const uint16_t low = Utils::Low16Bits(label->address()); |
| 583 const uint16_t high = Utils::High16Bits(label->address()); | 595 const uint16_t high = Utils::High16Bits(label->address()); |
| 584 lui(TMP1, Immediate(high)); | 596 lui(TMP1, Immediate(high)); |
| 585 ori(TMP1, TMP1, Immediate(low)); | 597 ori(TMP1, TMP1, Immediate(low)); |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 936 delay_slot_available_ = true; | 948 delay_slot_available_ = true; |
| 937 } | 949 } |
| 938 | 950 |
| 939 DISALLOW_ALLOCATION(); | 951 DISALLOW_ALLOCATION(); |
| 940 DISALLOW_COPY_AND_ASSIGN(Assembler); | 952 DISALLOW_COPY_AND_ASSIGN(Assembler); |
| 941 }; | 953 }; |
| 942 | 954 |
| 943 } // namespace dart | 955 } // namespace dart |
| 944 | 956 |
| 945 #endif // VM_ASSEMBLER_MIPS_H_ | 957 #endif // VM_ASSEMBLER_MIPS_H_ |
| OLD | NEW |