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

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

Issue 261783005: Begins work on arm64 floating point instructions. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 7 months 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/assembler_arm64.cc ('k') | runtime/vm/constants_arm64.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_ARM64) 6 #if defined(TARGET_ARCH_ARM64)
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 1298 matching lines...) Expand 10 before | Expand all | Expand 10 after
1309 __ ret(); 1309 __ ret();
1310 } 1310 }
1311 1311
1312 1312
1313 ASSEMBLER_TEST_RUN(CSelFalse, test) { 1313 ASSEMBLER_TEST_RUN(CSelFalse, test) {
1314 typedef int (*SimpleCode)(); 1314 typedef int (*SimpleCode)();
1315 EXPECT_EQ(1234, EXECUTE_TEST_CODE_INT64(SimpleCode, test->entry())); 1315 EXPECT_EQ(1234, EXECUTE_TEST_CODE_INT64(SimpleCode, test->entry()));
1316 } 1316 }
1317 1317
1318 1318
1319 // Floating point move immediate, to/from integer register.
1320 ASSEMBLER_TEST_GENERATE(Fmovdi, assembler) {
1321 __ LoadDImmediate(V0, 1.0, kNoPP);
1322 __ ret();
1323 }
1324
1325
1326 ASSEMBLER_TEST_RUN(Fmovdi, test) {
1327 typedef int (*SimpleCode)();
1328 EXPECT_EQ(1.0, EXECUTE_TEST_CODE_DOUBLE(SimpleCode, test->entry()));
1329 }
1330
1331
1332 ASSEMBLER_TEST_GENERATE(Fmovdi2, assembler) {
1333 __ LoadDImmediate(V0, 123412983.1324524315, kNoPP);
1334 __ ret();
1335 }
1336
1337
1338 ASSEMBLER_TEST_RUN(Fmovdi2, test) {
1339 typedef int (*SimpleCode)();
1340 EXPECT_FLOAT_EQ(123412983.1324524315,
1341 EXECUTE_TEST_CODE_DOUBLE(SimpleCode, test->entry()), 0.0001f);
1342 }
1343
1344
1345 ASSEMBLER_TEST_GENERATE(Fmovrd, assembler) {
1346 __ LoadDImmediate(V1, 1.0, kNoPP);
1347 __ fmovrd(R0, V1);
1348 __ ret();
1349 }
1350
1351
1352 ASSEMBLER_TEST_RUN(Fmovrd, test) {
1353 typedef int (*SimpleCode)();
1354 const int64_t one = bit_cast<int64_t, double>(1.0);
1355 EXPECT_EQ(one, EXECUTE_TEST_CODE_INT64(SimpleCode, test->entry()));
1356 }
1357
1358
1359 ASSEMBLER_TEST_GENERATE(Fmovdr, assembler) {
1360 __ LoadDImmediate(V1, 1.0, kNoPP);
1361 __ fmovrd(R1, V1);
1362 __ fmovdr(V0, R1);
1363 __ ret();
1364 }
1365
1366
1367 ASSEMBLER_TEST_RUN(Fmovdr, test) {
1368 typedef int (*SimpleCode)();
1369 EXPECT_EQ(1.0, EXECUTE_TEST_CODE_DOUBLE(SimpleCode, test->entry()));
1370 }
1371
1372
1319 // Called from assembler_test.cc. 1373 // Called from assembler_test.cc.
1320 // LR: return address. 1374 // LR: return address.
1321 // R0: context. 1375 // R0: context.
1322 // R1: value. 1376 // R1: value.
1323 // R2: growable array. 1377 // R2: growable array.
1324 ASSEMBLER_TEST_GENERATE(StoreIntoObject, assembler) { 1378 ASSEMBLER_TEST_GENERATE(StoreIntoObject, assembler) {
1325 __ TagAndPushPP(); 1379 __ TagAndPushPP();
1326 __ LoadPoolPointer(PP); 1380 __ LoadPoolPointer(PP);
1327 __ Push(CTX); 1381 __ Push(CTX);
1328 __ Push(LR); 1382 __ Push(LR);
1329 __ mov(CTX, R0); 1383 __ mov(CTX, R0);
1330 __ StoreIntoObject(R2, 1384 __ StoreIntoObject(R2,
1331 FieldAddress(R2, GrowableObjectArray::data_offset()), 1385 FieldAddress(R2, GrowableObjectArray::data_offset()),
1332 R1); 1386 R1);
1333 __ Pop(LR); 1387 __ Pop(LR);
1334 __ Pop(CTX); 1388 __ Pop(CTX);
1335 __ PopAndUntagPP(); 1389 __ PopAndUntagPP();
1336 __ ret(); 1390 __ ret();
1337 } 1391 }
1338 1392
1339 } // namespace dart 1393 } // namespace dart
1340 1394
1341 #endif // defined(TARGET_ARCH_ARM64) 1395 #endif // defined(TARGET_ARCH_ARM64)
OLDNEW
« no previous file with comments | « runtime/vm/assembler_arm64.cc ('k') | runtime/vm/constants_arm64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698