Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(120)

Side by Side Diff: runtime/vm/assembler_mips_test.cc

Issue 1425143003: VM: Improve and fix double negation on MIPS. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1621 matching lines...) Expand 10 before | Expand all | Expand 10 after
1632 1632
1633 1633
1634 ASSEMBLER_TEST_RUN(Movd, test) { 1634 ASSEMBLER_TEST_RUN(Movd, test) {
1635 typedef double (*SimpleCode)() DART_UNUSED; 1635 typedef double (*SimpleCode)() DART_UNUSED;
1636 EXPECT(test != NULL); 1636 EXPECT(test != NULL);
1637 double res = EXECUTE_TEST_CODE_DOUBLE(SimpleCode, test->entry()); 1637 double res = EXECUTE_TEST_CODE_DOUBLE(SimpleCode, test->entry());
1638 EXPECT_FLOAT_EQ(1.0, res, 0.001); 1638 EXPECT_FLOAT_EQ(1.0, res, 0.001);
1639 } 1639 }
1640 1640
1641 1641
1642 ASSEMBLER_TEST_GENERATE(Negd, assembler) {
1643 __ LoadImmediate(D1, 1.0);
1644 __ negd(D0, D1);
1645 __ Ret();
1646 }
1647
1648
1649 ASSEMBLER_TEST_RUN(Negd, test) {
1650 typedef double (*SimpleCode)() DART_UNUSED;
1651 EXPECT(test != NULL);
1652 double res = EXECUTE_TEST_CODE_DOUBLE(SimpleCode, test->entry());
1653 EXPECT_FLOAT_EQ(-1.0, res, 0.001);
1654 }
1655
1656
1642 ASSEMBLER_TEST_GENERATE(Sdc1Ldc1, assembler) { 1657 ASSEMBLER_TEST_GENERATE(Sdc1Ldc1, assembler) {
1643 __ mov(T0, SP); 1658 __ mov(T0, SP);
1644 __ AddImmediate(SP, -3 * kWordSize); 1659 __ AddImmediate(SP, -3 * kWordSize);
1645 __ AndImmediate(SP, SP, ~(8 - 1)); // Align SP by 8 bytes. 1660 __ AndImmediate(SP, SP, ~(8 - 1)); // Align SP by 8 bytes.
1646 __ LoadImmediate(D1, 1.0); 1661 __ LoadImmediate(D1, 1.0);
1647 __ sdc1(D1, Address(SP)); 1662 __ sdc1(D1, Address(SP));
1648 __ ldc1(D0, Address(SP)); 1663 __ ldc1(D0, Address(SP));
1649 __ mov(SP, T0); 1664 __ mov(SP, T0);
1650 __ Ret(); 1665 __ Ret();
1651 } 1666 }
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
2150 2165
2151 EXPECT_EQ(-1, RANGE_OF(Bool::True().raw())); 2166 EXPECT_EQ(-1, RANGE_OF(Bool::True().raw()));
2152 2167
2153 #undef RANGE_OF 2168 #undef RANGE_OF
2154 } 2169 }
2155 2170
2156 2171
2157 } // namespace dart 2172 } // namespace dart
2158 2173
2159 #endif // defined TARGET_ARCH_MIPS 2174 #endif // defined TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698