| 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 #include "vm/globals.h" | 5 #include "vm/globals.h" |
| 6 #if defined(TARGET_ARCH_MIPS) | 6 #if defined(TARGET_ARCH_MIPS) |
| 7 | 7 |
| 8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
| 9 #include "vm/cpu.h" | 9 #include "vm/cpu.h" |
| 10 #include "vm/os.h" | 10 #include "vm/os.h" |
| (...skipping 1941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1952 | 1952 |
| 1953 ASSEMBLER_TEST_RUN(Cop1CvtDW_neg, test) { | 1953 ASSEMBLER_TEST_RUN(Cop1CvtDW_neg, test) { |
| 1954 typedef double (*SimpleCode)(); | 1954 typedef double (*SimpleCode)(); |
| 1955 EXPECT(test != NULL); | 1955 EXPECT(test != NULL); |
| 1956 double res = EXECUTE_TEST_CODE_DOUBLE(SimpleCode, test->entry()); | 1956 double res = EXECUTE_TEST_CODE_DOUBLE(SimpleCode, test->entry()); |
| 1957 EXPECT_FLOAT_EQ(-42.0, res, 0.001); | 1957 EXPECT_FLOAT_EQ(-42.0, res, 0.001); |
| 1958 } | 1958 } |
| 1959 | 1959 |
| 1960 | 1960 |
| 1961 ASSEMBLER_TEST_GENERATE(Cop1CvtDL, assembler) { | 1961 ASSEMBLER_TEST_GENERATE(Cop1CvtDL, assembler) { |
| 1962 __ LoadImmediate(T0, 0x1); | 1962 if (TargetCPUFeatures::mips_version() == MIPS32r2) { |
| 1963 __ mtc1(ZR, F2); | 1963 __ LoadImmediate(T0, 0x1); |
| 1964 __ mtc1(T0, F3); // D0 <- 0x100000000 = 4294967296 | 1964 __ mtc1(ZR, F2); |
| 1965 __ cvtdl(D0, D1); | 1965 __ mtc1(T0, F3); // D0 <- 0x100000000 = 4294967296 |
| 1966 __ cvtdl(D0, D1); |
| 1967 } else { |
| 1968 __ LoadImmediate(D0, 4294967296.0); |
| 1969 } |
| 1966 __ Ret(); | 1970 __ Ret(); |
| 1967 } | 1971 } |
| 1968 | 1972 |
| 1969 | 1973 |
| 1970 ASSEMBLER_TEST_RUN(Cop1CvtDL, test) { | 1974 ASSEMBLER_TEST_RUN(Cop1CvtDL, test) { |
| 1971 typedef double (*SimpleCode)(); | 1975 typedef double (*SimpleCode)(); |
| 1972 EXPECT(test != NULL); | 1976 EXPECT(test != NULL); |
| 1973 double res = EXECUTE_TEST_CODE_DOUBLE(SimpleCode, test->entry()); | 1977 double res = EXECUTE_TEST_CODE_DOUBLE(SimpleCode, test->entry()); |
| 1974 EXPECT_FLOAT_EQ(4294967296.0, res, 0.001); | 1978 EXPECT_FLOAT_EQ(4294967296.0, res, 0.001); |
| 1975 } | 1979 } |
| 1976 | 1980 |
| 1977 | 1981 |
| 1978 ASSEMBLER_TEST_GENERATE(Cop1CvtDL_neg, assembler) { | 1982 ASSEMBLER_TEST_GENERATE(Cop1CvtDL_neg, assembler) { |
| 1979 __ LoadImmediate(T0, 0xffffffff); | 1983 if (TargetCPUFeatures::mips_version() == MIPS32r2) { |
| 1980 __ mtc1(T0, F2); | 1984 __ LoadImmediate(T0, 0xffffffff); |
| 1981 __ mtc1(T0, F3); // D0 <- 0xffffffffffffffff = -1 | 1985 __ mtc1(T0, F2); |
| 1982 __ cvtdl(D0, D1);; | 1986 __ mtc1(T0, F3); // D0 <- 0xffffffffffffffff = -1 |
| 1987 __ cvtdl(D0, D1); |
| 1988 } else { |
| 1989 __ LoadImmediate(D0, -1.0); |
| 1990 } |
| 1983 __ Ret(); | 1991 __ Ret(); |
| 1984 } | 1992 } |
| 1985 | 1993 |
| 1986 | 1994 |
| 1987 ASSEMBLER_TEST_RUN(Cop1CvtDL_neg, test) { | 1995 ASSEMBLER_TEST_RUN(Cop1CvtDL_neg, test) { |
| 1988 typedef double (*SimpleCode)(); | 1996 typedef double (*SimpleCode)(); |
| 1989 EXPECT(test != NULL); | 1997 EXPECT(test != NULL); |
| 1990 double res = EXECUTE_TEST_CODE_DOUBLE(SimpleCode, test->entry()); | 1998 double res = EXECUTE_TEST_CODE_DOUBLE(SimpleCode, test->entry()); |
| 1991 EXPECT_FLOAT_EQ(-1.0, res, 0.001); | 1999 EXPECT_FLOAT_EQ(-1.0, res, 0.001); |
| 1992 } | 2000 } |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2054 A1); | 2062 A1); |
| 2055 __ lw(RA, Address(SP, 0 * kWordSize)); | 2063 __ lw(RA, Address(SP, 0 * kWordSize)); |
| 2056 __ lw(CTX, Address(SP, 1 * kWordSize)); | 2064 __ lw(CTX, Address(SP, 1 * kWordSize)); |
| 2057 __ addiu(SP, SP, Immediate(2 * kWordSize)); | 2065 __ addiu(SP, SP, Immediate(2 * kWordSize)); |
| 2058 __ Ret(); | 2066 __ Ret(); |
| 2059 } | 2067 } |
| 2060 | 2068 |
| 2061 } // namespace dart | 2069 } // namespace dart |
| 2062 | 2070 |
| 2063 #endif // defined TARGET_ARCH_MIPS | 2071 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |