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/mips64/assembler-mips64.h" | 10 #include "src/mips64/assembler-mips64.h" |
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
670 DEFINE_INSTRUCTION(Sltu); | 670 DEFINE_INSTRUCTION(Sltu); |
671 | 671 |
672 // MIPS32 R2 instruction macro. | 672 // MIPS32 R2 instruction macro. |
673 DEFINE_INSTRUCTION(Ror); | 673 DEFINE_INSTRUCTION(Ror); |
674 DEFINE_INSTRUCTION(Dror); | 674 DEFINE_INSTRUCTION(Dror); |
675 | 675 |
676 #undef DEFINE_INSTRUCTION | 676 #undef DEFINE_INSTRUCTION |
677 #undef DEFINE_INSTRUCTION2 | 677 #undef DEFINE_INSTRUCTION2 |
678 #undef DEFINE_INSTRUCTION3 | 678 #undef DEFINE_INSTRUCTION3 |
679 | 679 |
| 680 // Load Scaled Address instructions. Parameter sa (shift argument) must be |
| 681 // between [1, 31] (inclusive). On pre-r6 architectures the scratch register |
| 682 // may be clobbered. |
680 void Lsa(Register rd, Register rs, Register rt, uint8_t sa, | 683 void Lsa(Register rd, Register rs, Register rt, uint8_t sa, |
681 Register scratch = at); | 684 Register scratch = at); |
682 void Dlsa(Register rd, Register rs, Register rt, uint8_t sa, | 685 void Dlsa(Register rd, Register rs, Register rt, uint8_t sa, |
683 Register scratch = at); | 686 Register scratch = at); |
684 | 687 |
685 void Pref(int32_t hint, const MemOperand& rs); | 688 void Pref(int32_t hint, const MemOperand& rs); |
686 | 689 |
687 | 690 |
688 // --------------------------------------------------------------------------- | 691 // --------------------------------------------------------------------------- |
689 // Pseudo-instructions. | 692 // Pseudo-instructions. |
(...skipping 1257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1947 Func GetLabelFunction) { | 1950 Func GetLabelFunction) { |
1948 // Ensure that dd-ed labels following this instruction use 8 bytes aligned | 1951 // Ensure that dd-ed labels following this instruction use 8 bytes aligned |
1949 // addresses. | 1952 // addresses. |
1950 if (kArchVariant >= kMips64r6) { | 1953 if (kArchVariant >= kMips64r6) { |
1951 BlockTrampolinePoolFor(static_cast<int>(case_count) * 2 + 6); | 1954 BlockTrampolinePoolFor(static_cast<int>(case_count) * 2 + 6); |
1952 // Opposite of Align(8) as we have odd number of instructions in this case. | 1955 // Opposite of Align(8) as we have odd number of instructions in this case. |
1953 if ((pc_offset() & 7) == 0) { | 1956 if ((pc_offset() & 7) == 0) { |
1954 nop(); | 1957 nop(); |
1955 } | 1958 } |
1956 addiupc(at, 5); | 1959 addiupc(at, 5); |
1957 dlsa(at, at, index, kPointerSizeLog2); | 1960 Dlsa(at, at, index, kPointerSizeLog2); |
1958 ld(at, MemOperand(at)); | 1961 ld(at, MemOperand(at)); |
1959 } else { | 1962 } else { |
1960 Label here; | 1963 Label here; |
1961 BlockTrampolinePoolFor(static_cast<int>(case_count) * 2 + 11); | 1964 BlockTrampolinePoolFor(static_cast<int>(case_count) * 2 + 11); |
1962 Align(8); | 1965 Align(8); |
1963 push(ra); | 1966 push(ra); |
1964 bal(&here); | 1967 bal(&here); |
1965 dsll(at, index, kPointerSizeLog2); // Branch delay slot. | 1968 dsll(at, index, kPointerSizeLog2); // Branch delay slot. |
1966 bind(&here); | 1969 bind(&here); |
1967 daddu(at, at, ra); | 1970 daddu(at, at, ra); |
(...skipping 13 matching lines...) Expand all Loading... |
1981 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) | 1984 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) |
1982 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> | 1985 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> |
1983 #else | 1986 #else |
1984 #define ACCESS_MASM(masm) masm-> | 1987 #define ACCESS_MASM(masm) masm-> |
1985 #endif | 1988 #endif |
1986 | 1989 |
1987 } // namespace internal | 1990 } // namespace internal |
1988 } // namespace v8 | 1991 } // namespace v8 |
1989 | 1992 |
1990 #endif // V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ | 1993 #endif // V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ |
OLD | NEW |