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_MIPS_MACRO_ASSEMBLER_MIPS_H_ | 5 #ifndef V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ |
6 #define V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ | 6 #define V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ |
7 | 7 |
8 #include "src/assembler.h" | 8 #include "src/assembler.h" |
9 #include "src/globals.h" | 9 #include "src/globals.h" |
10 #include "src/mips/assembler-mips.h" | 10 #include "src/mips/assembler-mips.h" |
(...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
765 // while leaving the low bits unchanged. | 765 // while leaving the low bits unchanged. |
766 void Mthc1(Register rt, FPURegister fs); | 766 void Mthc1(Register rt, FPURegister fs); |
767 | 767 |
768 // FP32 mode: move the high part of the double-register pair into | 768 // FP32 mode: move the high part of the double-register pair into |
769 // general purpose register. | 769 // general purpose register. |
770 // FP64 mode: Move the higher 32 bits of the 64-bit coprocessor register into | 770 // FP64 mode: Move the higher 32 bits of the 64-bit coprocessor register into |
771 // general-purpose register. | 771 // general-purpose register. |
772 void Mfhc1(Register rt, FPURegister fs); | 772 void Mfhc1(Register rt, FPURegister fs); |
773 | 773 |
774 // Wrapper functions for the different cmp/branch types. | 774 // Wrapper functions for the different cmp/branch types. |
775 void BranchFSize(SecondaryField sizeField, Label* target, Label* nan, | 775 inline void BranchF32(Label* target, Label* nan, Condition cc, |
776 Condition cc, FPURegister cmp1, FPURegister cmp2, | 776 FPURegister cmp1, FPURegister cmp2, |
777 BranchDelaySlot bd = PROTECT); | 777 BranchDelaySlot bd = PROTECT) { |
| 778 BranchFCommon(S, target, nan, cc, cmp1, cmp2, bd); |
| 779 } |
778 | 780 |
779 void BranchF(Label* target, | 781 inline void BranchF64(Label* target, Label* nan, Condition cc, |
780 Label* nan, | 782 FPURegister cmp1, FPURegister cmp2, |
781 Condition cc, | 783 BranchDelaySlot bd = PROTECT) { |
782 FPURegister cmp1, | 784 BranchFCommon(D, target, nan, cc, cmp1, cmp2, bd); |
783 FPURegister cmp2, | 785 } |
784 BranchDelaySlot bd = PROTECT); | |
785 | |
786 void BranchFS(Label* target, Label* nan, Condition cc, FPURegister cmp1, | |
787 FPURegister cmp2, BranchDelaySlot bd = PROTECT); | |
788 | 786 |
789 // Alternate (inline) version for better readability with USE_DELAY_SLOT. | 787 // Alternate (inline) version for better readability with USE_DELAY_SLOT. |
790 inline void BranchF(BranchDelaySlot bd, | 788 inline void BranchF64(BranchDelaySlot bd, Label* target, Label* nan, |
791 Label* target, | 789 Condition cc, FPURegister cmp1, FPURegister cmp2) { |
792 Label* nan, | 790 BranchF64(target, nan, cc, cmp1, cmp2, bd); |
793 Condition cc, | |
794 FPURegister cmp1, | |
795 FPURegister cmp2) { | |
796 BranchF(target, nan, cc, cmp1, cmp2, bd); | |
797 } | 791 } |
798 | 792 |
799 inline void BranchFS(BranchDelaySlot bd, Label* target, Label* nan, | 793 inline void BranchF32(BranchDelaySlot bd, Label* target, Label* nan, |
800 Condition cc, FPURegister cmp1, FPURegister cmp2) { | 794 Condition cc, FPURegister cmp1, FPURegister cmp2) { |
801 BranchFS(target, nan, cc, cmp1, cmp2, bd); | 795 BranchF32(target, nan, cc, cmp1, cmp2, bd); |
| 796 } |
| 797 |
| 798 // Alias functions for backward compatibility. |
| 799 inline void BranchF(Label* target, Label* nan, Condition cc, FPURegister cmp1, |
| 800 FPURegister cmp2, BranchDelaySlot bd = PROTECT) { |
| 801 BranchF64(target, nan, cc, cmp1, cmp2, bd); |
| 802 } |
| 803 |
| 804 inline void BranchF(BranchDelaySlot bd, Label* target, Label* nan, |
| 805 Condition cc, FPURegister cmp1, FPURegister cmp2) { |
| 806 BranchF64(bd, target, nan, cc, cmp1, cmp2); |
802 } | 807 } |
803 | 808 |
804 // Truncates a double using a specific rounding mode, and writes the value | 809 // Truncates a double using a specific rounding mode, and writes the value |
805 // to the result register. | 810 // to the result register. |
806 // The except_flag will contain any exceptions caused by the instruction. | 811 // The except_flag will contain any exceptions caused by the instruction. |
807 // If check_inexact is kDontCheckForInexactConversion, then the inexact | 812 // If check_inexact is kDontCheckForInexactConversion, then the inexact |
808 // exception is masked. | 813 // exception is masked. |
809 void EmitFPUTruncate(FPURoundingMode rounding_mode, | 814 void EmitFPUTruncate(FPURoundingMode rounding_mode, |
810 Register result, | 815 Register result, |
811 DoubleRegister double_input, | 816 DoubleRegister double_input, |
(...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1625 const Operand& rt, | 1630 const Operand& rt, |
1626 BranchDelaySlot bdslot = PROTECT); | 1631 BranchDelaySlot bdslot = PROTECT); |
1627 void BranchAndLinkShort(Label* L, BranchDelaySlot bdslot = PROTECT); | 1632 void BranchAndLinkShort(Label* L, BranchDelaySlot bdslot = PROTECT); |
1628 void BranchAndLinkShort(Label* L, Condition cond, Register rs, | 1633 void BranchAndLinkShort(Label* L, Condition cond, Register rs, |
1629 const Operand& rt, | 1634 const Operand& rt, |
1630 BranchDelaySlot bdslot = PROTECT); | 1635 BranchDelaySlot bdslot = PROTECT); |
1631 void J(Label* L, BranchDelaySlot bdslot); | 1636 void J(Label* L, BranchDelaySlot bdslot); |
1632 void Jr(Label* L, BranchDelaySlot bdslot); | 1637 void Jr(Label* L, BranchDelaySlot bdslot); |
1633 void Jalr(Label* L, BranchDelaySlot bdslot); | 1638 void Jalr(Label* L, BranchDelaySlot bdslot); |
1634 | 1639 |
| 1640 // Common implementation of BranchF functions for the different formats. |
| 1641 void BranchFCommon(SecondaryField sizeField, Label* target, Label* nan, |
| 1642 Condition cc, FPURegister cmp1, FPURegister cmp2, |
| 1643 BranchDelaySlot bd = PROTECT); |
| 1644 |
1635 // Helper functions for generating invokes. | 1645 // Helper functions for generating invokes. |
1636 void InvokePrologue(const ParameterCount& expected, | 1646 void InvokePrologue(const ParameterCount& expected, |
1637 const ParameterCount& actual, | 1647 const ParameterCount& actual, |
1638 Handle<Code> code_constant, | 1648 Handle<Code> code_constant, |
1639 Register code_reg, | 1649 Register code_reg, |
1640 Label* done, | 1650 Label* done, |
1641 bool* definitely_mismatches, | 1651 bool* definitely_mismatches, |
1642 InvokeFlag flag, | 1652 InvokeFlag flag, |
1643 const CallWrapper& call_wrapper); | 1653 const CallWrapper& call_wrapper); |
1644 | 1654 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1726 #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x) | 1736 #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x) |
1727 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) | 1737 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) |
1728 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> | 1738 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> |
1729 #else | 1739 #else |
1730 #define ACCESS_MASM(masm) masm-> | 1740 #define ACCESS_MASM(masm) masm-> |
1731 #endif | 1741 #endif |
1732 | 1742 |
1733 } } // namespace v8::internal | 1743 } } // namespace v8::internal |
1734 | 1744 |
1735 #endif // V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ | 1745 #endif // V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ |
OLD | NEW |