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_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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 } | 280 } |
281 | 281 |
282 | 282 |
283 ASSEMBLER_TEST_RUN(AddExtReg, test) { | 283 ASSEMBLER_TEST_RUN(AddExtReg, test) { |
284 typedef int64_t (*Int64Return)() DART_UNUSED; | 284 typedef int64_t (*Int64Return)() DART_UNUSED; |
285 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); | 285 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
286 } | 286 } |
287 | 287 |
288 | 288 |
289 ASSEMBLER_TEST_GENERATE(AddCarryInOut, assembler) { | 289 ASSEMBLER_TEST_GENERATE(AddCarryInOut, assembler) { |
290 __ LoadImmediate(R2, -1, kNoPP); | 290 __ LoadImmediate(R2, -1); |
291 __ LoadImmediate(R1, 1, kNoPP); | 291 __ LoadImmediate(R1, 1); |
292 __ LoadImmediate(R0, 0, kNoPP); | 292 __ LoadImmediate(R0, 0); |
293 __ adds(IP0, R2, Operand(R1)); // c_out = 1. | 293 __ adds(IP0, R2, Operand(R1)); // c_out = 1. |
294 __ adcs(IP0, R2, R0); // c_in = 1, c_out = 1. | 294 __ adcs(IP0, R2, R0); // c_in = 1, c_out = 1. |
295 __ adc(R0, R0, R0); // c_in = 1. | 295 __ adc(R0, R0, R0); // c_in = 1. |
296 __ ret(); | 296 __ ret(); |
297 } | 297 } |
298 | 298 |
299 | 299 |
300 ASSEMBLER_TEST_RUN(AddCarryInOut, test) { | 300 ASSEMBLER_TEST_RUN(AddCarryInOut, test) { |
301 typedef int64_t (*Int64Return)() DART_UNUSED; | 301 typedef int64_t (*Int64Return)() DART_UNUSED; |
302 EXPECT_EQ(1, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); | 302 EXPECT_EQ(1, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
303 } | 303 } |
304 | 304 |
305 | 305 |
306 ASSEMBLER_TEST_GENERATE(SubCarryInOut, assembler) { | 306 ASSEMBLER_TEST_GENERATE(SubCarryInOut, assembler) { |
307 __ LoadImmediate(R1, 1, kNoPP); | 307 __ LoadImmediate(R1, 1); |
308 __ LoadImmediate(R0, 0, kNoPP); | 308 __ LoadImmediate(R0, 0); |
309 __ subs(IP0, R0, Operand(R1)); // c_out = 1. | 309 __ subs(IP0, R0, Operand(R1)); // c_out = 1. |
310 __ sbcs(IP0, R0, R0); // c_in = 1, c_out = 1. | 310 __ sbcs(IP0, R0, R0); // c_in = 1, c_out = 1. |
311 __ sbc(R0, R0, R0); // c_in = 1. | 311 __ sbc(R0, R0, R0); // c_in = 1. |
312 __ ret(); | 312 __ ret(); |
313 } | 313 } |
314 | 314 |
315 | 315 |
316 ASSEMBLER_TEST_RUN(SubCarryInOut, test) { | 316 ASSEMBLER_TEST_RUN(SubCarryInOut, test) { |
317 typedef int64_t (*Int64Return)() DART_UNUSED; | 317 typedef int64_t (*Int64Return)() DART_UNUSED; |
318 EXPECT_EQ(-1, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); | 318 EXPECT_EQ(-1, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
319 } | 319 } |
320 | 320 |
321 | 321 |
322 ASSEMBLER_TEST_GENERATE(Overflow, assembler) { | 322 ASSEMBLER_TEST_GENERATE(Overflow, assembler) { |
323 __ LoadImmediate(R0, 0, kNoPP); | 323 __ LoadImmediate(R0, 0); |
324 __ LoadImmediate(R1, 1, kNoPP); | 324 __ LoadImmediate(R1, 1); |
325 __ LoadImmediate(R2, 0xFFFFFFFFFFFFFFFF, kNoPP); | 325 __ LoadImmediate(R2, 0xFFFFFFFFFFFFFFFF); |
326 __ LoadImmediate(R3, 0x7FFFFFFFFFFFFFFF, kNoPP); | 326 __ LoadImmediate(R3, 0x7FFFFFFFFFFFFFFF); |
327 __ adds(IP0, R2, Operand(R1)); // c_out = 1. | 327 __ adds(IP0, R2, Operand(R1)); // c_out = 1. |
328 __ adcs(IP0, R3, R0); // c_in = 1, c_out = 1, v = 1. | 328 __ adcs(IP0, R3, R0); // c_in = 1, c_out = 1, v = 1. |
329 __ csinc(R0, R0, R0, VS); // R0 = v ? R0 : R0 + 1. | 329 __ csinc(R0, R0, R0, VS); // R0 = v ? R0 : R0 + 1. |
330 __ ret(); | 330 __ ret(); |
331 } | 331 } |
332 | 332 |
333 | 333 |
334 ASSEMBLER_TEST_RUN(Overflow, test) { | 334 ASSEMBLER_TEST_RUN(Overflow, test) { |
335 typedef int64_t (*Int64Return)() DART_UNUSED; | 335 typedef int64_t (*Int64Return)() DART_UNUSED; |
336 EXPECT_EQ(0, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); | 336 EXPECT_EQ(0, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
337 } | 337 } |
338 | 338 |
339 | 339 |
340 ASSEMBLER_TEST_GENERATE(WordAddCarryInOut, assembler) { | 340 ASSEMBLER_TEST_GENERATE(WordAddCarryInOut, assembler) { |
341 __ LoadImmediate(R2, -1, kNoPP); | 341 __ LoadImmediate(R2, -1); |
342 __ LoadImmediate(R1, 1, kNoPP); | 342 __ LoadImmediate(R1, 1); |
343 __ LoadImmediate(R0, 0, kNoPP); | 343 __ LoadImmediate(R0, 0); |
344 __ addsw(IP0, R2, Operand(R1)); // c_out = 1. | 344 __ addsw(IP0, R2, Operand(R1)); // c_out = 1. |
345 __ adcsw(IP0, R2, R0); // c_in = 1, c_out = 1. | 345 __ adcsw(IP0, R2, R0); // c_in = 1, c_out = 1. |
346 __ adcw(R0, R0, R0); // c_in = 1. | 346 __ adcw(R0, R0, R0); // c_in = 1. |
347 __ ret(); | 347 __ ret(); |
348 } | 348 } |
349 | 349 |
350 | 350 |
351 ASSEMBLER_TEST_RUN(WordAddCarryInOut, test) { | 351 ASSEMBLER_TEST_RUN(WordAddCarryInOut, test) { |
352 typedef int64_t (*Int64Return)() DART_UNUSED; | 352 typedef int64_t (*Int64Return)() DART_UNUSED; |
353 EXPECT_EQ(1, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); | 353 EXPECT_EQ(1, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
354 } | 354 } |
355 | 355 |
356 | 356 |
357 ASSEMBLER_TEST_GENERATE(WordSubCarryInOut, assembler) { | 357 ASSEMBLER_TEST_GENERATE(WordSubCarryInOut, assembler) { |
358 __ LoadImmediate(R1, 1, kNoPP); | 358 __ LoadImmediate(R1, 1); |
359 __ LoadImmediate(R0, 0, kNoPP); | 359 __ LoadImmediate(R0, 0); |
360 __ subsw(IP0, R0, Operand(R1)); // c_out = 1. | 360 __ subsw(IP0, R0, Operand(R1)); // c_out = 1. |
361 __ sbcsw(IP0, R0, R0); // c_in = 1, c_out = 1. | 361 __ sbcsw(IP0, R0, R0); // c_in = 1, c_out = 1. |
362 __ sbcw(R0, R0, R0); // c_in = 1. | 362 __ sbcw(R0, R0, R0); // c_in = 1. |
363 __ ret(); | 363 __ ret(); |
364 } | 364 } |
365 | 365 |
366 | 366 |
367 ASSEMBLER_TEST_RUN(WordSubCarryInOut, test) { | 367 ASSEMBLER_TEST_RUN(WordSubCarryInOut, test) { |
368 typedef int64_t (*Int64Return)() DART_UNUSED; | 368 typedef int64_t (*Int64Return)() DART_UNUSED; |
369 EXPECT_EQ(0x0FFFFFFFF, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); | 369 EXPECT_EQ(0x0FFFFFFFF, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
370 } | 370 } |
371 | 371 |
372 | 372 |
373 ASSEMBLER_TEST_GENERATE(WordOverflow, assembler) { | 373 ASSEMBLER_TEST_GENERATE(WordOverflow, assembler) { |
374 __ LoadImmediate(R0, 0, kNoPP); | 374 __ LoadImmediate(R0, 0); |
375 __ LoadImmediate(R1, 1, kNoPP); | 375 __ LoadImmediate(R1, 1); |
376 __ LoadImmediate(R2, 0xFFFFFFFF, kNoPP); | 376 __ LoadImmediate(R2, 0xFFFFFFFF); |
377 __ LoadImmediate(R3, 0x7FFFFFFF, kNoPP); | 377 __ LoadImmediate(R3, 0x7FFFFFFF); |
378 __ addsw(IP0, R2, Operand(R1)); // c_out = 1. | 378 __ addsw(IP0, R2, Operand(R1)); // c_out = 1. |
379 __ adcsw(IP0, R3, R0); // c_in = 1, c_out = 1, v = 1. | 379 __ adcsw(IP0, R3, R0); // c_in = 1, c_out = 1, v = 1. |
380 __ csinc(R0, R0, R0, VS); // R0 = v ? R0 : R0 + 1. | 380 __ csinc(R0, R0, R0, VS); // R0 = v ? R0 : R0 + 1. |
381 __ ret(); | 381 __ ret(); |
382 } | 382 } |
383 | 383 |
384 | 384 |
385 ASSEMBLER_TEST_RUN(WordOverflow, test) { | 385 ASSEMBLER_TEST_RUN(WordOverflow, test) { |
386 typedef int64_t (*Int64Return)() DART_UNUSED; | 386 typedef int64_t (*Int64Return)() DART_UNUSED; |
387 EXPECT_EQ(0, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); | 387 EXPECT_EQ(0, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 | 503 |
504 | 504 |
505 ASSEMBLER_TEST_RUN(LoadStoreScaledReg, test) { | 505 ASSEMBLER_TEST_RUN(LoadStoreScaledReg, test) { |
506 typedef int64_t (*Int64Return)() DART_UNUSED; | 506 typedef int64_t (*Int64Return)() DART_UNUSED; |
507 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); | 507 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
508 } | 508 } |
509 | 509 |
510 | 510 |
511 ASSEMBLER_TEST_GENERATE(LoadSigned32Bit, assembler) { | 511 ASSEMBLER_TEST_GENERATE(LoadSigned32Bit, assembler) { |
512 __ SetupDartSP(kTestStackSpace); | 512 __ SetupDartSP(kTestStackSpace); |
513 __ LoadImmediate(R1, 0xffffffff, kNoPP); | 513 __ LoadImmediate(R1, 0xffffffff); |
514 __ str(R1, Address(SP, -4, Address::PreIndex, kWord), kWord); | 514 __ str(R1, Address(SP, -4, Address::PreIndex, kWord), kWord); |
515 __ ldr(R0, Address(SP), kWord); | 515 __ ldr(R0, Address(SP), kWord); |
516 __ ldr(R1, Address(SP, 4, Address::PostIndex, kWord), kWord); | 516 __ ldr(R1, Address(SP, 4, Address::PostIndex, kWord), kWord); |
517 __ mov(CSP, SP); | 517 __ mov(CSP, SP); |
518 __ ret(); | 518 __ ret(); |
519 } | 519 } |
520 | 520 |
521 | 521 |
522 ASSEMBLER_TEST_RUN(LoadSigned32Bit, test) { | 522 ASSEMBLER_TEST_RUN(LoadSigned32Bit, test) { |
523 typedef int64_t (*Int64Return)() DART_UNUSED; | 523 typedef int64_t (*Int64Return)() DART_UNUSED; |
524 EXPECT_EQ(-1, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); | 524 EXPECT_EQ(-1, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
525 } | 525 } |
526 | 526 |
527 | 527 |
528 ASSEMBLER_TEST_GENERATE(SimpleLoadStorePair, assembler) { | 528 ASSEMBLER_TEST_GENERATE(SimpleLoadStorePair, assembler) { |
529 __ SetupDartSP(kTestStackSpace); | 529 __ SetupDartSP(kTestStackSpace); |
530 __ LoadImmediate(R2, 43, kNoPP); | 530 __ LoadImmediate(R2, 43); |
531 __ LoadImmediate(R3, 42, kNoPP); | 531 __ LoadImmediate(R3, 42); |
532 __ stp(R2, R3, Address(SP, -2*kWordSize, Address::PairPreIndex)); | 532 __ stp(R2, R3, Address(SP, -2*kWordSize, Address::PairPreIndex)); |
533 __ ldp(R0, R1, Address(SP, 2*kWordSize, Address::PairPostIndex)); | 533 __ ldp(R0, R1, Address(SP, 2*kWordSize, Address::PairPostIndex)); |
534 __ sub(R0, R0, Operand(R1)); | 534 __ sub(R0, R0, Operand(R1)); |
535 __ mov(CSP, SP); | 535 __ mov(CSP, SP); |
536 __ ret(); | 536 __ ret(); |
537 } | 537 } |
538 | 538 |
539 | 539 |
540 ASSEMBLER_TEST_RUN(SimpleLoadStorePair, test) { | 540 ASSEMBLER_TEST_RUN(SimpleLoadStorePair, test) { |
541 typedef int64_t (*Int64Return)() DART_UNUSED; | 541 typedef int64_t (*Int64Return)() DART_UNUSED; |
542 EXPECT_EQ(1, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); | 542 EXPECT_EQ(1, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
543 } | 543 } |
544 | 544 |
545 | 545 |
546 ASSEMBLER_TEST_GENERATE(LoadStorePairOffset, assembler) { | 546 ASSEMBLER_TEST_GENERATE(LoadStorePairOffset, assembler) { |
547 __ SetupDartSP(kTestStackSpace); | 547 __ SetupDartSP(kTestStackSpace); |
548 __ LoadImmediate(R2, 43, kNoPP); | 548 __ LoadImmediate(R2, 43); |
549 __ LoadImmediate(R3, 42, kNoPP); | 549 __ LoadImmediate(R3, 42); |
550 __ sub(SP, SP, Operand(4 * kWordSize)); | 550 __ sub(SP, SP, Operand(4 * kWordSize)); |
551 __ stp(R2, R3, Address::Pair(SP, 2 * kWordSize)); | 551 __ stp(R2, R3, Address::Pair(SP, 2 * kWordSize)); |
552 __ ldp(R0, R1, Address::Pair(SP, 2 * kWordSize)); | 552 __ ldp(R0, R1, Address::Pair(SP, 2 * kWordSize)); |
553 __ add(SP, SP, Operand(4 * kWordSize)); | 553 __ add(SP, SP, Operand(4 * kWordSize)); |
554 __ sub(R0, R0, Operand(R1)); | 554 __ sub(R0, R0, Operand(R1)); |
555 __ mov(CSP, SP); | 555 __ mov(CSP, SP); |
556 __ ret(); | 556 __ ret(); |
557 } | 557 } |
558 | 558 |
559 | 559 |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
722 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); | 722 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
723 } | 723 } |
724 | 724 |
725 | 725 |
726 ASSEMBLER_TEST_GENERATE(Clz, assembler) { | 726 ASSEMBLER_TEST_GENERATE(Clz, assembler) { |
727 Label error; | 727 Label error; |
728 | 728 |
729 __ clz(R1, ZR); | 729 __ clz(R1, ZR); |
730 __ cmp(R1, Operand(64)); | 730 __ cmp(R1, Operand(64)); |
731 __ b(&error, NE); | 731 __ b(&error, NE); |
732 __ LoadImmediate(R2, 42, kNoPP); | 732 __ LoadImmediate(R2, 42); |
733 __ clz(R2, R2); | 733 __ clz(R2, R2); |
734 __ cmp(R2, Operand(58)); | 734 __ cmp(R2, Operand(58)); |
735 __ b(&error, NE); | 735 __ b(&error, NE); |
736 __ LoadImmediate(R0, -1, kNoPP); | 736 __ LoadImmediate(R0, -1); |
737 __ clz(R1, R0); | 737 __ clz(R1, R0); |
738 __ cmp(R1, Operand(0)); | 738 __ cmp(R1, Operand(0)); |
739 __ b(&error, NE); | 739 __ b(&error, NE); |
740 __ add(R0, ZR, Operand(R0, LSR, 3)); | 740 __ add(R0, ZR, Operand(R0, LSR, 3)); |
741 __ clz(R1, R0); | 741 __ clz(R1, R0); |
742 __ cmp(R1, Operand(3)); | 742 __ cmp(R1, Operand(3)); |
743 __ b(&error, NE); | 743 __ b(&error, NE); |
744 __ mov(R0, ZR); | 744 __ mov(R0, ZR); |
745 __ ret(); | 745 __ ret(); |
746 __ Bind(&error); | 746 __ Bind(&error); |
747 __ LoadImmediate(R0, 1, kNoPP); | 747 __ LoadImmediate(R0, 1); |
748 __ ret(); | 748 __ ret(); |
749 } | 749 } |
750 | 750 |
751 | 751 |
752 ASSEMBLER_TEST_RUN(Clz, test) { | 752 ASSEMBLER_TEST_RUN(Clz, test) { |
753 typedef int64_t (*Int64Return)() DART_UNUSED; | 753 typedef int64_t (*Int64Return)() DART_UNUSED; |
754 EXPECT_EQ(0, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); | 754 EXPECT_EQ(0, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
755 } | 755 } |
756 | 756 |
757 | 757 |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
991 | 991 |
992 ASSEMBLER_TEST_RUN(CmpBranchIfNotZeroNotTaken, test) { | 992 ASSEMBLER_TEST_RUN(CmpBranchIfNotZeroNotTaken, test) { |
993 typedef int64_t (*Int64Return)() DART_UNUSED; | 993 typedef int64_t (*Int64Return)() DART_UNUSED; |
994 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); | 994 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
995 } | 995 } |
996 | 996 |
997 | 997 |
998 ASSEMBLER_TEST_GENERATE(FcmpEqBranch, assembler) { | 998 ASSEMBLER_TEST_GENERATE(FcmpEqBranch, assembler) { |
999 Label l; | 999 Label l; |
1000 | 1000 |
1001 __ LoadDImmediate(V0, 42.0, kNoPP); | 1001 __ LoadDImmediate(V0, 42.0); |
1002 __ LoadDImmediate(V1, 234.0, kNoPP); | 1002 __ LoadDImmediate(V1, 234.0); |
1003 __ LoadDImmediate(V2, 234.0, kNoPP); | 1003 __ LoadDImmediate(V2, 234.0); |
1004 | 1004 |
1005 __ fcmpd(V1, V2); | 1005 __ fcmpd(V1, V2); |
1006 __ b(&l, EQ); | 1006 __ b(&l, EQ); |
1007 __ LoadDImmediate(V0, 0.0, kNoPP); | 1007 __ LoadDImmediate(V0, 0.0); |
1008 __ Bind(&l); | 1008 __ Bind(&l); |
1009 __ ret(); | 1009 __ ret(); |
1010 } | 1010 } |
1011 | 1011 |
1012 | 1012 |
1013 ASSEMBLER_TEST_RUN(FcmpEqBranch, test) { | 1013 ASSEMBLER_TEST_RUN(FcmpEqBranch, test) { |
1014 typedef double (*DoubleReturn)() DART_UNUSED; | 1014 typedef double (*DoubleReturn)() DART_UNUSED; |
1015 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); | 1015 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); |
1016 } | 1016 } |
1017 | 1017 |
1018 | 1018 |
1019 ASSEMBLER_TEST_GENERATE(FcmpEqBranchNotTaken, assembler) { | 1019 ASSEMBLER_TEST_GENERATE(FcmpEqBranchNotTaken, assembler) { |
1020 Label l; | 1020 Label l; |
1021 | 1021 |
1022 __ LoadDImmediate(V0, 0.0, kNoPP); | 1022 __ LoadDImmediate(V0, 0.0); |
1023 __ LoadDImmediate(V1, 233.0, kNoPP); | 1023 __ LoadDImmediate(V1, 233.0); |
1024 __ LoadDImmediate(V2, 234.0, kNoPP); | 1024 __ LoadDImmediate(V2, 234.0); |
1025 | 1025 |
1026 __ fcmpd(V1, V2); | 1026 __ fcmpd(V1, V2); |
1027 __ b(&l, EQ); | 1027 __ b(&l, EQ); |
1028 __ LoadDImmediate(V0, 42.0, kNoPP); | 1028 __ LoadDImmediate(V0, 42.0); |
1029 __ Bind(&l); | 1029 __ Bind(&l); |
1030 __ ret(); | 1030 __ ret(); |
1031 } | 1031 } |
1032 | 1032 |
1033 | 1033 |
1034 ASSEMBLER_TEST_RUN(FcmpEqBranchNotTaken, test) { | 1034 ASSEMBLER_TEST_RUN(FcmpEqBranchNotTaken, test) { |
1035 typedef double (*DoubleReturn)() DART_UNUSED; | 1035 typedef double (*DoubleReturn)() DART_UNUSED; |
1036 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); | 1036 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); |
1037 } | 1037 } |
1038 | 1038 |
1039 | 1039 |
1040 ASSEMBLER_TEST_GENERATE(FcmpLtBranch, assembler) { | 1040 ASSEMBLER_TEST_GENERATE(FcmpLtBranch, assembler) { |
1041 Label l; | 1041 Label l; |
1042 | 1042 |
1043 __ LoadDImmediate(V0, 42.0, kNoPP); | 1043 __ LoadDImmediate(V0, 42.0); |
1044 __ LoadDImmediate(V1, 233.0, kNoPP); | 1044 __ LoadDImmediate(V1, 233.0); |
1045 __ LoadDImmediate(V2, 234.0, kNoPP); | 1045 __ LoadDImmediate(V2, 234.0); |
1046 | 1046 |
1047 __ fcmpd(V1, V2); | 1047 __ fcmpd(V1, V2); |
1048 __ b(&l, LT); | 1048 __ b(&l, LT); |
1049 __ LoadDImmediate(V0, 0.0, kNoPP); | 1049 __ LoadDImmediate(V0, 0.0); |
1050 __ Bind(&l); | 1050 __ Bind(&l); |
1051 __ ret(); | 1051 __ ret(); |
1052 } | 1052 } |
1053 | 1053 |
1054 | 1054 |
1055 ASSEMBLER_TEST_RUN(FcmpLtBranch, test) { | 1055 ASSEMBLER_TEST_RUN(FcmpLtBranch, test) { |
1056 typedef double (*DoubleReturn)() DART_UNUSED; | 1056 typedef double (*DoubleReturn)() DART_UNUSED; |
1057 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); | 1057 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); |
1058 } | 1058 } |
1059 | 1059 |
1060 | 1060 |
1061 ASSEMBLER_TEST_GENERATE(FcmpLtBranchNotTaken, assembler) { | 1061 ASSEMBLER_TEST_GENERATE(FcmpLtBranchNotTaken, assembler) { |
1062 Label l; | 1062 Label l; |
1063 | 1063 |
1064 __ LoadDImmediate(V0, 0.0, kNoPP); | 1064 __ LoadDImmediate(V0, 0.0); |
1065 __ LoadDImmediate(V1, 235.0, kNoPP); | 1065 __ LoadDImmediate(V1, 235.0); |
1066 __ LoadDImmediate(V2, 234.0, kNoPP); | 1066 __ LoadDImmediate(V2, 234.0); |
1067 | 1067 |
1068 __ fcmpd(V1, V2); | 1068 __ fcmpd(V1, V2); |
1069 __ b(&l, LT); | 1069 __ b(&l, LT); |
1070 __ LoadDImmediate(V0, 42.0, kNoPP); | 1070 __ LoadDImmediate(V0, 42.0); |
1071 __ Bind(&l); | 1071 __ Bind(&l); |
1072 __ ret(); | 1072 __ ret(); |
1073 } | 1073 } |
1074 | 1074 |
1075 | 1075 |
1076 ASSEMBLER_TEST_RUN(FcmpLtBranchNotTaken, test) { | 1076 ASSEMBLER_TEST_RUN(FcmpLtBranchNotTaken, test) { |
1077 typedef double (*DoubleReturn)() DART_UNUSED; | 1077 typedef double (*DoubleReturn)() DART_UNUSED; |
1078 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); | 1078 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); |
1079 } | 1079 } |
1080 | 1080 |
1081 | 1081 |
1082 ASSEMBLER_TEST_GENERATE(FcmpzGtBranch, assembler) { | 1082 ASSEMBLER_TEST_GENERATE(FcmpzGtBranch, assembler) { |
1083 Label l; | 1083 Label l; |
1084 | 1084 |
1085 __ LoadDImmediate(V0, 235.0, kNoPP); | 1085 __ LoadDImmediate(V0, 235.0); |
1086 __ LoadDImmediate(V1, 233.0, kNoPP); | 1086 __ LoadDImmediate(V1, 233.0); |
1087 | 1087 |
1088 __ fcmpdz(V1); | 1088 __ fcmpdz(V1); |
1089 __ b(&l, GT); | 1089 __ b(&l, GT); |
1090 __ LoadDImmediate(V0, 0.0, kNoPP); | 1090 __ LoadDImmediate(V0, 0.0); |
1091 __ ret(); | 1091 __ ret(); |
1092 __ Bind(&l); | 1092 __ Bind(&l); |
1093 __ LoadDImmediate(V0, 42.0, kNoPP); | 1093 __ LoadDImmediate(V0, 42.0); |
1094 __ ret(); | 1094 __ ret(); |
1095 } | 1095 } |
1096 | 1096 |
1097 | 1097 |
1098 ASSEMBLER_TEST_RUN(FcmpzGtBranch, test) { | 1098 ASSEMBLER_TEST_RUN(FcmpzGtBranch, test) { |
1099 typedef double (*DoubleReturn)() DART_UNUSED; | 1099 typedef double (*DoubleReturn)() DART_UNUSED; |
1100 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); | 1100 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); |
1101 } | 1101 } |
1102 | 1102 |
1103 | 1103 |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1506 | 1506 |
1507 | 1507 |
1508 ASSEMBLER_TEST_RUN(Umaddl, test) { | 1508 ASSEMBLER_TEST_RUN(Umaddl, test) { |
1509 typedef int64_t (*Int64Return)() DART_UNUSED; | 1509 typedef int64_t (*Int64Return)() DART_UNUSED; |
1510 EXPECT_EQ(0x700000001, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); | 1510 EXPECT_EQ(0x700000001, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
1511 } | 1511 } |
1512 | 1512 |
1513 | 1513 |
1514 // Loading immediate values without the object pool. | 1514 // Loading immediate values without the object pool. |
1515 ASSEMBLER_TEST_GENERATE(LoadImmediateSmall, assembler) { | 1515 ASSEMBLER_TEST_GENERATE(LoadImmediateSmall, assembler) { |
1516 __ LoadImmediate(R0, 42, kNoRegister); | 1516 __ LoadImmediate(R0, 42); |
1517 __ ret(); | 1517 __ ret(); |
1518 } | 1518 } |
1519 | 1519 |
1520 | 1520 |
1521 ASSEMBLER_TEST_RUN(LoadImmediateSmall, test) { | 1521 ASSEMBLER_TEST_RUN(LoadImmediateSmall, test) { |
1522 typedef int64_t (*Int64Return)() DART_UNUSED; | 1522 typedef int64_t (*Int64Return)() DART_UNUSED; |
1523 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); | 1523 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
1524 } | 1524 } |
1525 | 1525 |
1526 | 1526 |
1527 ASSEMBLER_TEST_GENERATE(LoadImmediateMed, assembler) { | 1527 ASSEMBLER_TEST_GENERATE(LoadImmediateMed, assembler) { |
1528 __ LoadImmediate(R0, 0xf1234123, kNoRegister); | 1528 __ LoadImmediate(R0, 0xf1234123); |
1529 __ ret(); | 1529 __ ret(); |
1530 } | 1530 } |
1531 | 1531 |
1532 | 1532 |
1533 ASSEMBLER_TEST_RUN(LoadImmediateMed, test) { | 1533 ASSEMBLER_TEST_RUN(LoadImmediateMed, test) { |
1534 typedef int64_t (*Int64Return)() DART_UNUSED; | 1534 typedef int64_t (*Int64Return)() DART_UNUSED; |
1535 EXPECT_EQ(0xf1234123, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); | 1535 EXPECT_EQ(0xf1234123, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
1536 } | 1536 } |
1537 | 1537 |
1538 | 1538 |
1539 ASSEMBLER_TEST_GENERATE(LoadImmediateMed2, assembler) { | 1539 ASSEMBLER_TEST_GENERATE(LoadImmediateMed2, assembler) { |
1540 __ LoadImmediate(R0, 0x4321f1234123, kNoRegister); | 1540 __ LoadImmediate(R0, 0x4321f1234123); |
1541 __ ret(); | 1541 __ ret(); |
1542 } | 1542 } |
1543 | 1543 |
1544 | 1544 |
1545 ASSEMBLER_TEST_RUN(LoadImmediateMed2, test) { | 1545 ASSEMBLER_TEST_RUN(LoadImmediateMed2, test) { |
1546 typedef int64_t (*Int64Return)() DART_UNUSED; | 1546 typedef int64_t (*Int64Return)() DART_UNUSED; |
1547 EXPECT_EQ( | 1547 EXPECT_EQ( |
1548 0x4321f1234123, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); | 1548 0x4321f1234123, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
1549 } | 1549 } |
1550 | 1550 |
1551 | 1551 |
1552 ASSEMBLER_TEST_GENERATE(LoadImmediateLarge, assembler) { | 1552 ASSEMBLER_TEST_GENERATE(LoadImmediateLarge, assembler) { |
1553 __ LoadImmediate(R0, 0x9287436598237465, kNoRegister); | 1553 __ LoadImmediate(R0, 0x9287436598237465); |
1554 __ ret(); | 1554 __ ret(); |
1555 } | 1555 } |
1556 | 1556 |
1557 | 1557 |
1558 ASSEMBLER_TEST_RUN(LoadImmediateLarge, test) { | 1558 ASSEMBLER_TEST_RUN(LoadImmediateLarge, test) { |
1559 typedef int64_t (*Int64Return)() DART_UNUSED; | 1559 typedef int64_t (*Int64Return)() DART_UNUSED; |
1560 EXPECT_EQ(static_cast<int64_t>(0x9287436598237465), | 1560 EXPECT_EQ(static_cast<int64_t>(0x9287436598237465), |
1561 EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); | 1561 EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
1562 } | 1562 } |
1563 | 1563 |
1564 | 1564 |
1565 ASSEMBLER_TEST_GENERATE(LoadImmediateSmallNeg, assembler) { | 1565 ASSEMBLER_TEST_GENERATE(LoadImmediateSmallNeg, assembler) { |
1566 __ LoadImmediate(R0, -42, kNoRegister); | 1566 __ LoadImmediate(R0, -42); |
1567 __ ret(); | 1567 __ ret(); |
1568 } | 1568 } |
1569 | 1569 |
1570 | 1570 |
1571 ASSEMBLER_TEST_RUN(LoadImmediateSmallNeg, test) { | 1571 ASSEMBLER_TEST_RUN(LoadImmediateSmallNeg, test) { |
1572 typedef int64_t (*Int64Return)() DART_UNUSED; | 1572 typedef int64_t (*Int64Return)() DART_UNUSED; |
1573 EXPECT_EQ(-42, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); | 1573 EXPECT_EQ(-42, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
1574 } | 1574 } |
1575 | 1575 |
1576 | 1576 |
1577 ASSEMBLER_TEST_GENERATE(LoadImmediateMedNeg, assembler) { | 1577 ASSEMBLER_TEST_GENERATE(LoadImmediateMedNeg, assembler) { |
1578 __ LoadImmediate(R0, -0x1212341234, kNoRegister); | 1578 __ LoadImmediate(R0, -0x1212341234); |
1579 __ ret(); | 1579 __ ret(); |
1580 } | 1580 } |
1581 | 1581 |
1582 | 1582 |
1583 ASSEMBLER_TEST_RUN(LoadImmediateMedNeg, test) { | 1583 ASSEMBLER_TEST_RUN(LoadImmediateMedNeg, test) { |
1584 typedef int64_t (*Int64Return)() DART_UNUSED; | 1584 typedef int64_t (*Int64Return)() DART_UNUSED; |
1585 EXPECT_EQ(-0x1212341234, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); | 1585 EXPECT_EQ(-0x1212341234, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
1586 } | 1586 } |
1587 | 1587 |
1588 | 1588 |
1589 ASSEMBLER_TEST_GENERATE(LoadImmediateMedNeg2, assembler) { | 1589 ASSEMBLER_TEST_GENERATE(LoadImmediateMedNeg2, assembler) { |
1590 __ LoadImmediate(R0, -0x1212340000, kNoRegister); | 1590 __ LoadImmediate(R0, -0x1212340000); |
1591 __ ret(); | 1591 __ ret(); |
1592 } | 1592 } |
1593 | 1593 |
1594 | 1594 |
1595 ASSEMBLER_TEST_RUN(LoadImmediateMedNeg2, test) { | 1595 ASSEMBLER_TEST_RUN(LoadImmediateMedNeg2, test) { |
1596 typedef int64_t (*Int64Return)() DART_UNUSED; | 1596 typedef int64_t (*Int64Return)() DART_UNUSED; |
1597 EXPECT_EQ(-0x1212340000, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); | 1597 EXPECT_EQ(-0x1212340000, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
1598 } | 1598 } |
1599 | 1599 |
1600 | 1600 |
1601 ASSEMBLER_TEST_GENERATE(LoadImmediateMedNeg3, assembler) { | 1601 ASSEMBLER_TEST_GENERATE(LoadImmediateMedNeg3, assembler) { |
1602 __ LoadImmediate(R0, -0x1200001234, kNoRegister); | 1602 __ LoadImmediate(R0, -0x1200001234); |
1603 __ ret(); | 1603 __ ret(); |
1604 } | 1604 } |
1605 | 1605 |
1606 | 1606 |
1607 ASSEMBLER_TEST_RUN(LoadImmediateMedNeg3, test) { | 1607 ASSEMBLER_TEST_RUN(LoadImmediateMedNeg3, test) { |
1608 typedef int64_t (*Int64Return)() DART_UNUSED; | 1608 typedef int64_t (*Int64Return)() DART_UNUSED; |
1609 EXPECT_EQ(-0x1200001234, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); | 1609 EXPECT_EQ(-0x1200001234, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
1610 } | 1610 } |
1611 | 1611 |
1612 | 1612 |
1613 ASSEMBLER_TEST_GENERATE(LoadImmediateMedNeg4, assembler) { | 1613 ASSEMBLER_TEST_GENERATE(LoadImmediateMedNeg4, assembler) { |
1614 __ LoadImmediate(R0, -0x12341234, kNoRegister); | 1614 __ LoadImmediate(R0, -0x12341234); |
1615 __ ret(); | 1615 __ ret(); |
1616 } | 1616 } |
1617 | 1617 |
1618 | 1618 |
1619 ASSEMBLER_TEST_RUN(LoadImmediateMedNeg4, test) { | 1619 ASSEMBLER_TEST_RUN(LoadImmediateMedNeg4, test) { |
1620 typedef int64_t (*Int64Return)() DART_UNUSED; | 1620 typedef int64_t (*Int64Return)() DART_UNUSED; |
1621 EXPECT_EQ(-0x12341234, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); | 1621 EXPECT_EQ(-0x12341234, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
1622 } | 1622 } |
1623 | 1623 |
1624 | 1624 |
1625 // Loading immediate values with the object pool. | 1625 // Loading immediate values with the object pool. |
1626 ASSEMBLER_TEST_GENERATE(LoadImmediatePPSmall, assembler) { | 1626 ASSEMBLER_TEST_GENERATE(LoadImmediatePPSmall, assembler) { |
1627 __ SetupDartSP(kTestStackSpace); | 1627 __ SetupDartSP(kTestStackSpace); |
1628 __ TagAndPushPP(); // Save caller's pool pointer and load a new one here. | 1628 __ TagAndPushPP(); // Save caller's pool pointer and load a new one here. |
1629 __ LoadPoolPointer(PP); | 1629 __ LoadPoolPointer(); |
1630 __ LoadImmediate(R0, 42, PP); | 1630 __ LoadImmediate(R0, 42); |
1631 __ PopAndUntagPP(); | 1631 __ PopAndUntagPP(); |
1632 __ mov(CSP, SP); | 1632 __ mov(CSP, SP); |
1633 __ ret(); | 1633 __ ret(); |
1634 } | 1634 } |
1635 | 1635 |
1636 | 1636 |
1637 ASSEMBLER_TEST_RUN(LoadImmediatePPSmall, test) { | 1637 ASSEMBLER_TEST_RUN(LoadImmediatePPSmall, test) { |
1638 typedef int64_t (*Int64Return)() DART_UNUSED; | 1638 typedef int64_t (*Int64Return)() DART_UNUSED; |
1639 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); | 1639 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
1640 } | 1640 } |
1641 | 1641 |
1642 | 1642 |
1643 ASSEMBLER_TEST_GENERATE(LoadImmediatePPMed, assembler) { | 1643 ASSEMBLER_TEST_GENERATE(LoadImmediatePPMed, assembler) { |
1644 __ SetupDartSP(kTestStackSpace); | 1644 __ SetupDartSP(kTestStackSpace); |
1645 __ TagAndPushPP(); // Save caller's pool pointer and load a new one here. | 1645 __ TagAndPushPP(); // Save caller's pool pointer and load a new one here. |
1646 __ LoadPoolPointer(PP); | 1646 __ LoadPoolPointer(); |
1647 __ LoadImmediate(R0, 0xf1234123, PP); | 1647 __ LoadImmediate(R0, 0xf1234123); |
1648 __ PopAndUntagPP(); | 1648 __ PopAndUntagPP(); |
1649 __ mov(CSP, SP); | 1649 __ mov(CSP, SP); |
1650 __ ret(); | 1650 __ ret(); |
1651 } | 1651 } |
1652 | 1652 |
1653 | 1653 |
1654 ASSEMBLER_TEST_RUN(LoadImmediatePPMed, test) { | 1654 ASSEMBLER_TEST_RUN(LoadImmediatePPMed, test) { |
1655 typedef int64_t (*Int64Return)() DART_UNUSED; | 1655 typedef int64_t (*Int64Return)() DART_UNUSED; |
1656 EXPECT_EQ(0xf1234123, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); | 1656 EXPECT_EQ(0xf1234123, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
1657 } | 1657 } |
1658 | 1658 |
1659 | 1659 |
1660 ASSEMBLER_TEST_GENERATE(LoadImmediatePPMed2, assembler) { | 1660 ASSEMBLER_TEST_GENERATE(LoadImmediatePPMed2, assembler) { |
1661 __ SetupDartSP(kTestStackSpace); | 1661 __ SetupDartSP(kTestStackSpace); |
1662 __ TagAndPushPP(); // Save caller's pool pointer and load a new one here. | 1662 __ TagAndPushPP(); // Save caller's pool pointer and load a new one here. |
1663 __ LoadPoolPointer(PP); | 1663 __ LoadPoolPointer(); |
1664 __ LoadImmediate(R0, 0x4321f1234124, PP); | 1664 __ LoadImmediate(R0, 0x4321f1234124); |
1665 __ PopAndUntagPP(); | 1665 __ PopAndUntagPP(); |
1666 __ mov(CSP, SP); | 1666 __ mov(CSP, SP); |
1667 __ ret(); | 1667 __ ret(); |
1668 } | 1668 } |
1669 | 1669 |
1670 | 1670 |
1671 ASSEMBLER_TEST_RUN(LoadImmediatePPMed2, test) { | 1671 ASSEMBLER_TEST_RUN(LoadImmediatePPMed2, test) { |
1672 typedef int64_t (*Int64Return)() DART_UNUSED; | 1672 typedef int64_t (*Int64Return)() DART_UNUSED; |
1673 EXPECT_EQ( | 1673 EXPECT_EQ( |
1674 0x4321f1234124, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); | 1674 0x4321f1234124, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
1675 } | 1675 } |
1676 | 1676 |
1677 | 1677 |
1678 ASSEMBLER_TEST_GENERATE(LoadImmediatePPLarge, assembler) { | 1678 ASSEMBLER_TEST_GENERATE(LoadImmediatePPLarge, assembler) { |
1679 __ SetupDartSP(kTestStackSpace); | 1679 __ SetupDartSP(kTestStackSpace); |
1680 __ TagAndPushPP(); // Save caller's pool pointer and load a new one here. | 1680 __ TagAndPushPP(); // Save caller's pool pointer and load a new one here. |
1681 __ LoadPoolPointer(PP); | 1681 __ LoadPoolPointer(); |
1682 __ LoadImmediate(R0, 0x9287436598237465, PP); | 1682 __ LoadImmediate(R0, 0x9287436598237465); |
1683 __ PopAndUntagPP(); | 1683 __ PopAndUntagPP(); |
1684 __ mov(CSP, SP); | 1684 __ mov(CSP, SP); |
1685 __ ret(); | 1685 __ ret(); |
1686 } | 1686 } |
1687 | 1687 |
1688 | 1688 |
1689 ASSEMBLER_TEST_RUN(LoadImmediatePPLarge, test) { | 1689 ASSEMBLER_TEST_RUN(LoadImmediatePPLarge, test) { |
1690 typedef int64_t (*Int64Return)() DART_UNUSED; | 1690 typedef int64_t (*Int64Return)() DART_UNUSED; |
1691 EXPECT_EQ(static_cast<int64_t>(0x9287436598237465), | 1691 EXPECT_EQ(static_cast<int64_t>(0x9287436598237465), |
1692 EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); | 1692 EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
(...skipping 13 matching lines...) Expand all Loading... |
1706 int64_t var_name = test_code(thread) | 1706 int64_t var_name = test_code(thread) |
1707 #endif | 1707 #endif |
1708 | 1708 |
1709 | 1709 |
1710 // LoadObject null. | 1710 // LoadObject null. |
1711 ASSEMBLER_TEST_GENERATE(LoadObjectNull, assembler) { | 1711 ASSEMBLER_TEST_GENERATE(LoadObjectNull, assembler) { |
1712 __ SetupDartSP(kTestStackSpace); | 1712 __ SetupDartSP(kTestStackSpace); |
1713 __ Push(THR); | 1713 __ Push(THR); |
1714 __ mov(THR, R0); | 1714 __ mov(THR, R0); |
1715 __ TagAndPushPP(); // Save caller's pool pointer and load a new one here. | 1715 __ TagAndPushPP(); // Save caller's pool pointer and load a new one here. |
1716 __ LoadPoolPointer(PP); | 1716 __ LoadPoolPointer(); |
1717 __ LoadObject(R0, Object::null_object(), PP); | 1717 __ LoadObject(R0, Object::null_object()); |
1718 __ PopAndUntagPP(); | 1718 __ PopAndUntagPP(); |
1719 __ Pop(THR); | 1719 __ Pop(THR); |
1720 __ mov(CSP, SP); | 1720 __ mov(CSP, SP); |
1721 __ ret(); | 1721 __ ret(); |
1722 } | 1722 } |
1723 | 1723 |
1724 | 1724 |
1725 ASSEMBLER_TEST_RUN(LoadObjectNull, test) { | 1725 ASSEMBLER_TEST_RUN(LoadObjectNull, test) { |
1726 ASSEMBLER_TEST_RUN_WITH_THREAD(result); | 1726 ASSEMBLER_TEST_RUN_WITH_THREAD(result); |
1727 EXPECT_EQ(reinterpret_cast<int64_t>(Object::null()), result); | 1727 EXPECT_EQ(reinterpret_cast<int64_t>(Object::null()), result); |
1728 } | 1728 } |
1729 | 1729 |
1730 | 1730 |
1731 ASSEMBLER_TEST_GENERATE(LoadObjectTrue, assembler) { | 1731 ASSEMBLER_TEST_GENERATE(LoadObjectTrue, assembler) { |
1732 __ SetupDartSP(kTestStackSpace); | 1732 __ SetupDartSP(kTestStackSpace); |
1733 __ Push(THR); | 1733 __ Push(THR); |
1734 __ mov(THR, R0); | 1734 __ mov(THR, R0); |
1735 __ TagAndPushPP(); // Save caller's pool pointer and load a new one here. | 1735 __ TagAndPushPP(); // Save caller's pool pointer and load a new one here. |
1736 __ LoadPoolPointer(PP); | 1736 __ LoadPoolPointer(); |
1737 __ LoadObject(R0, Bool::True(), PP); | 1737 __ LoadObject(R0, Bool::True()); |
1738 __ PopAndUntagPP(); | 1738 __ PopAndUntagPP(); |
1739 __ Pop(THR); | 1739 __ Pop(THR); |
1740 __ mov(CSP, SP); | 1740 __ mov(CSP, SP); |
1741 __ ret(); | 1741 __ ret(); |
1742 } | 1742 } |
1743 | 1743 |
1744 | 1744 |
1745 ASSEMBLER_TEST_RUN(LoadObjectTrue, test) { | 1745 ASSEMBLER_TEST_RUN(LoadObjectTrue, test) { |
1746 ASSEMBLER_TEST_RUN_WITH_THREAD(result); | 1746 ASSEMBLER_TEST_RUN_WITH_THREAD(result); |
1747 EXPECT_EQ(reinterpret_cast<int64_t>(Bool::True().raw()), result); | 1747 EXPECT_EQ(reinterpret_cast<int64_t>(Bool::True().raw()), result); |
1748 } | 1748 } |
1749 | 1749 |
1750 | 1750 |
1751 ASSEMBLER_TEST_GENERATE(LoadObjectFalse, assembler) { | 1751 ASSEMBLER_TEST_GENERATE(LoadObjectFalse, assembler) { |
1752 __ SetupDartSP(kTestStackSpace); | 1752 __ SetupDartSP(kTestStackSpace); |
1753 __ Push(THR); | 1753 __ Push(THR); |
1754 __ mov(THR, R0); | 1754 __ mov(THR, R0); |
1755 __ TagAndPushPP(); // Save caller's pool pointer and load a new one here. | 1755 __ TagAndPushPP(); // Save caller's pool pointer and load a new one here. |
1756 __ LoadPoolPointer(PP); | 1756 __ LoadPoolPointer(); |
1757 __ LoadObject(R0, Bool::False(), PP); | 1757 __ LoadObject(R0, Bool::False()); |
1758 __ PopAndUntagPP(); | 1758 __ PopAndUntagPP(); |
1759 __ Pop(THR); | 1759 __ Pop(THR); |
1760 __ mov(CSP, SP); | 1760 __ mov(CSP, SP); |
1761 __ ret(); | 1761 __ ret(); |
1762 } | 1762 } |
1763 | 1763 |
1764 | 1764 |
1765 ASSEMBLER_TEST_RUN(LoadObjectFalse, test) { | 1765 ASSEMBLER_TEST_RUN(LoadObjectFalse, test) { |
1766 ASSEMBLER_TEST_RUN_WITH_THREAD(result); | 1766 ASSEMBLER_TEST_RUN_WITH_THREAD(result); |
1767 EXPECT_EQ(reinterpret_cast<int64_t>(Bool::False().raw()), result); | 1767 EXPECT_EQ(reinterpret_cast<int64_t>(Bool::False().raw()), result); |
1768 } | 1768 } |
1769 | 1769 |
1770 | 1770 |
1771 ASSEMBLER_TEST_GENERATE(CSelTrue, assembler) { | 1771 ASSEMBLER_TEST_GENERATE(CSelTrue, assembler) { |
1772 __ LoadImmediate(R1, 42, kNoRegister); | 1772 __ LoadImmediate(R1, 42); |
1773 __ LoadImmediate(R2, 1234, kNoRegister); | 1773 __ LoadImmediate(R2, 1234); |
1774 __ CompareRegisters(R1, R2); | 1774 __ CompareRegisters(R1, R2); |
1775 __ csel(R0, R1, R2, LT); | 1775 __ csel(R0, R1, R2, LT); |
1776 __ ret(); | 1776 __ ret(); |
1777 } | 1777 } |
1778 | 1778 |
1779 | 1779 |
1780 ASSEMBLER_TEST_RUN(CSelTrue, test) { | 1780 ASSEMBLER_TEST_RUN(CSelTrue, test) { |
1781 typedef int64_t (*Int64Return)() DART_UNUSED; | 1781 typedef int64_t (*Int64Return)() DART_UNUSED; |
1782 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); | 1782 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
1783 } | 1783 } |
1784 | 1784 |
1785 | 1785 |
1786 ASSEMBLER_TEST_GENERATE(CSelFalse, assembler) { | 1786 ASSEMBLER_TEST_GENERATE(CSelFalse, assembler) { |
1787 __ LoadImmediate(R1, 42, kNoRegister); | 1787 __ LoadImmediate(R1, 42); |
1788 __ LoadImmediate(R2, 1234, kNoRegister); | 1788 __ LoadImmediate(R2, 1234); |
1789 __ CompareRegisters(R1, R2); | 1789 __ CompareRegisters(R1, R2); |
1790 __ csel(R0, R1, R2, GE); | 1790 __ csel(R0, R1, R2, GE); |
1791 __ ret(); | 1791 __ ret(); |
1792 } | 1792 } |
1793 | 1793 |
1794 | 1794 |
1795 ASSEMBLER_TEST_RUN(CSelFalse, test) { | 1795 ASSEMBLER_TEST_RUN(CSelFalse, test) { |
1796 typedef int64_t (*Int64Return)() DART_UNUSED; | 1796 typedef int64_t (*Int64Return)() DART_UNUSED; |
1797 EXPECT_EQ(1234, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); | 1797 EXPECT_EQ(1234, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
1798 } | 1798 } |
1799 | 1799 |
1800 | 1800 |
1801 ASSEMBLER_TEST_GENERATE(CsincFalse, assembler) { | 1801 ASSEMBLER_TEST_GENERATE(CsincFalse, assembler) { |
1802 __ LoadImmediate(R1, 42, kNoRegister); | 1802 __ LoadImmediate(R1, 42); |
1803 __ LoadImmediate(R2, 1234, kNoRegister); | 1803 __ LoadImmediate(R2, 1234); |
1804 __ CompareRegisters(R1, R2); | 1804 __ CompareRegisters(R1, R2); |
1805 __ csinc(R0, R2, R1, GE); | 1805 __ csinc(R0, R2, R1, GE); |
1806 __ ret(); | 1806 __ ret(); |
1807 } | 1807 } |
1808 | 1808 |
1809 | 1809 |
1810 ASSEMBLER_TEST_RUN(CsincFalse, test) { | 1810 ASSEMBLER_TEST_RUN(CsincFalse, test) { |
1811 typedef int64_t (*Int64Return)() DART_UNUSED; | 1811 typedef int64_t (*Int64Return)() DART_UNUSED; |
1812 EXPECT_EQ(43, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); | 1812 EXPECT_EQ(43, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
1813 } | 1813 } |
1814 | 1814 |
1815 | 1815 |
1816 ASSEMBLER_TEST_GENERATE(CsincTrue, assembler) { | 1816 ASSEMBLER_TEST_GENERATE(CsincTrue, assembler) { |
1817 __ LoadImmediate(R1, 42, kNoRegister); | 1817 __ LoadImmediate(R1, 42); |
1818 __ LoadImmediate(R2, 1234, kNoRegister); | 1818 __ LoadImmediate(R2, 1234); |
1819 __ CompareRegisters(R1, R2); | 1819 __ CompareRegisters(R1, R2); |
1820 __ csinc(R0, R2, R1, LT); | 1820 __ csinc(R0, R2, R1, LT); |
1821 __ ret(); | 1821 __ ret(); |
1822 } | 1822 } |
1823 | 1823 |
1824 | 1824 |
1825 ASSEMBLER_TEST_RUN(CsincTrue, test) { | 1825 ASSEMBLER_TEST_RUN(CsincTrue, test) { |
1826 typedef int64_t (*Int64Return)() DART_UNUSED; | 1826 typedef int64_t (*Int64Return)() DART_UNUSED; |
1827 EXPECT_EQ(1234, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); | 1827 EXPECT_EQ(1234, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
1828 } | 1828 } |
1829 | 1829 |
1830 | 1830 |
1831 ASSEMBLER_TEST_GENERATE(CsinvFalse, assembler) { | 1831 ASSEMBLER_TEST_GENERATE(CsinvFalse, assembler) { |
1832 __ LoadImmediate(R1, 42, kNoRegister); | 1832 __ LoadImmediate(R1, 42); |
1833 __ LoadImmediate(R2, 1234, kNoRegister); | 1833 __ LoadImmediate(R2, 1234); |
1834 __ CompareRegisters(R1, R2); | 1834 __ CompareRegisters(R1, R2); |
1835 __ csinv(R0, R2, R1, GE); | 1835 __ csinv(R0, R2, R1, GE); |
1836 __ ret(); | 1836 __ ret(); |
1837 } | 1837 } |
1838 | 1838 |
1839 | 1839 |
1840 ASSEMBLER_TEST_RUN(CsinvFalse, test) { | 1840 ASSEMBLER_TEST_RUN(CsinvFalse, test) { |
1841 typedef int64_t (*Int64Return)() DART_UNUSED; | 1841 typedef int64_t (*Int64Return)() DART_UNUSED; |
1842 EXPECT_EQ(~42, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); | 1842 EXPECT_EQ(~42, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
1843 } | 1843 } |
1844 | 1844 |
1845 | 1845 |
1846 ASSEMBLER_TEST_GENERATE(CsinvTrue, assembler) { | 1846 ASSEMBLER_TEST_GENERATE(CsinvTrue, assembler) { |
1847 __ LoadImmediate(R1, 42, kNoRegister); | 1847 __ LoadImmediate(R1, 42); |
1848 __ LoadImmediate(R2, 1234, kNoRegister); | 1848 __ LoadImmediate(R2, 1234); |
1849 __ CompareRegisters(R1, R2); | 1849 __ CompareRegisters(R1, R2); |
1850 __ csinv(R0, R2, R1, LT); | 1850 __ csinv(R0, R2, R1, LT); |
1851 __ ret(); | 1851 __ ret(); |
1852 } | 1852 } |
1853 | 1853 |
1854 | 1854 |
1855 ASSEMBLER_TEST_RUN(CsinvTrue, test) { | 1855 ASSEMBLER_TEST_RUN(CsinvTrue, test) { |
1856 typedef int64_t (*Int64Return)() DART_UNUSED; | 1856 typedef int64_t (*Int64Return)() DART_UNUSED; |
1857 EXPECT_EQ(1234, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); | 1857 EXPECT_EQ(1234, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
1858 } | 1858 } |
1859 | 1859 |
1860 | 1860 |
1861 // Floating point move immediate, to/from integer register. | 1861 // Floating point move immediate, to/from integer register. |
1862 ASSEMBLER_TEST_GENERATE(Fmovdi, assembler) { | 1862 ASSEMBLER_TEST_GENERATE(Fmovdi, assembler) { |
1863 __ LoadDImmediate(V0, 1.0, kNoPP); | 1863 __ LoadDImmediate(V0, 1.0); |
1864 __ ret(); | 1864 __ ret(); |
1865 } | 1865 } |
1866 | 1866 |
1867 | 1867 |
1868 ASSEMBLER_TEST_RUN(Fmovdi, test) { | 1868 ASSEMBLER_TEST_RUN(Fmovdi, test) { |
1869 typedef double (*DoubleReturn)() DART_UNUSED; | 1869 typedef double (*DoubleReturn)() DART_UNUSED; |
1870 EXPECT_EQ(1.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); | 1870 EXPECT_EQ(1.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); |
1871 } | 1871 } |
1872 | 1872 |
1873 | 1873 |
1874 ASSEMBLER_TEST_GENERATE(Fmovdi2, assembler) { | 1874 ASSEMBLER_TEST_GENERATE(Fmovdi2, assembler) { |
1875 __ LoadDImmediate(V0, 123412983.1324524315, kNoPP); | 1875 __ LoadDImmediate(V0, 123412983.1324524315); |
1876 __ ret(); | 1876 __ ret(); |
1877 } | 1877 } |
1878 | 1878 |
1879 | 1879 |
1880 ASSEMBLER_TEST_RUN(Fmovdi2, test) { | 1880 ASSEMBLER_TEST_RUN(Fmovdi2, test) { |
1881 typedef double (*DoubleReturn)() DART_UNUSED; | 1881 typedef double (*DoubleReturn)() DART_UNUSED; |
1882 EXPECT_FLOAT_EQ(123412983.1324524315, | 1882 EXPECT_FLOAT_EQ(123412983.1324524315, |
1883 EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry()), 0.0001f); | 1883 EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry()), 0.0001f); |
1884 } | 1884 } |
1885 | 1885 |
1886 | 1886 |
1887 ASSEMBLER_TEST_GENERATE(Fmovrd, assembler) { | 1887 ASSEMBLER_TEST_GENERATE(Fmovrd, assembler) { |
1888 __ LoadDImmediate(V1, 1.0, kNoPP); | 1888 __ LoadDImmediate(V1, 1.0); |
1889 __ fmovrd(R0, V1); | 1889 __ fmovrd(R0, V1); |
1890 __ ret(); | 1890 __ ret(); |
1891 } | 1891 } |
1892 | 1892 |
1893 | 1893 |
1894 ASSEMBLER_TEST_RUN(Fmovrd, test) { | 1894 ASSEMBLER_TEST_RUN(Fmovrd, test) { |
1895 typedef int64_t (*Int64Return)() DART_UNUSED; | 1895 typedef int64_t (*Int64Return)() DART_UNUSED; |
1896 const int64_t one = bit_cast<int64_t, double>(1.0); | 1896 const int64_t one = bit_cast<int64_t, double>(1.0); |
1897 EXPECT_EQ(one, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); | 1897 EXPECT_EQ(one, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
1898 } | 1898 } |
1899 | 1899 |
1900 | 1900 |
1901 ASSEMBLER_TEST_GENERATE(Fmovdr, assembler) { | 1901 ASSEMBLER_TEST_GENERATE(Fmovdr, assembler) { |
1902 __ LoadDImmediate(V1, 1.0, kNoPP); | 1902 __ LoadDImmediate(V1, 1.0); |
1903 __ fmovrd(R1, V1); | 1903 __ fmovrd(R1, V1); |
1904 __ fmovdr(V0, R1); | 1904 __ fmovdr(V0, R1); |
1905 __ ret(); | 1905 __ ret(); |
1906 } | 1906 } |
1907 | 1907 |
1908 | 1908 |
1909 ASSEMBLER_TEST_RUN(Fmovdr, test) { | 1909 ASSEMBLER_TEST_RUN(Fmovdr, test) { |
1910 typedef double (*DoubleReturn)() DART_UNUSED; | 1910 typedef double (*DoubleReturn)() DART_UNUSED; |
1911 EXPECT_EQ(1.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); | 1911 EXPECT_EQ(1.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); |
1912 } | 1912 } |
1913 | 1913 |
1914 | 1914 |
1915 ASSEMBLER_TEST_GENERATE(FldrdFstrdPrePostIndex, assembler) { | 1915 ASSEMBLER_TEST_GENERATE(FldrdFstrdPrePostIndex, assembler) { |
1916 __ SetupDartSP(kTestStackSpace); | 1916 __ SetupDartSP(kTestStackSpace); |
1917 __ LoadDImmediate(V1, 42.0, kNoPP); | 1917 __ LoadDImmediate(V1, 42.0); |
1918 __ fstrd(V1, Address(SP, -1*kWordSize, Address::PreIndex)); | 1918 __ fstrd(V1, Address(SP, -1*kWordSize, Address::PreIndex)); |
1919 __ fldrd(V0, Address(SP, 1*kWordSize, Address::PostIndex)); | 1919 __ fldrd(V0, Address(SP, 1*kWordSize, Address::PostIndex)); |
1920 __ mov(CSP, SP); | 1920 __ mov(CSP, SP); |
1921 __ ret(); | 1921 __ ret(); |
1922 } | 1922 } |
1923 | 1923 |
1924 | 1924 |
1925 ASSEMBLER_TEST_RUN(FldrdFstrdPrePostIndex, test) { | 1925 ASSEMBLER_TEST_RUN(FldrdFstrdPrePostIndex, test) { |
1926 typedef double (*DoubleReturn)() DART_UNUSED; | 1926 typedef double (*DoubleReturn)() DART_UNUSED; |
1927 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); | 1927 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); |
1928 } | 1928 } |
1929 | 1929 |
1930 | 1930 |
1931 ASSEMBLER_TEST_GENERATE(FldrsFstrsPrePostIndex, assembler) { | 1931 ASSEMBLER_TEST_GENERATE(FldrsFstrsPrePostIndex, assembler) { |
1932 __ SetupDartSP(kTestStackSpace); | 1932 __ SetupDartSP(kTestStackSpace); |
1933 __ LoadDImmediate(V1, 42.0, kNoPP); | 1933 __ LoadDImmediate(V1, 42.0); |
1934 __ fcvtsd(V2, V1); | 1934 __ fcvtsd(V2, V1); |
1935 __ fstrs(V2, Address(SP, -1*kWordSize, Address::PreIndex)); | 1935 __ fstrs(V2, Address(SP, -1*kWordSize, Address::PreIndex)); |
1936 __ fldrs(V3, Address(SP, 1*kWordSize, Address::PostIndex)); | 1936 __ fldrs(V3, Address(SP, 1*kWordSize, Address::PostIndex)); |
1937 __ fcvtds(V0, V3); | 1937 __ fcvtds(V0, V3); |
1938 __ mov(CSP, SP); | 1938 __ mov(CSP, SP); |
1939 __ ret(); | 1939 __ ret(); |
1940 } | 1940 } |
1941 | 1941 |
1942 | 1942 |
1943 ASSEMBLER_TEST_RUN(FldrsFstrsPrePostIndex, test) { | 1943 ASSEMBLER_TEST_RUN(FldrsFstrsPrePostIndex, test) { |
1944 typedef double (*DoubleReturn)() DART_UNUSED; | 1944 typedef double (*DoubleReturn)() DART_UNUSED; |
1945 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); | 1945 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); |
1946 } | 1946 } |
1947 | 1947 |
1948 | 1948 |
1949 ASSEMBLER_TEST_GENERATE(FldrqFstrqPrePostIndex, assembler) { | 1949 ASSEMBLER_TEST_GENERATE(FldrqFstrqPrePostIndex, assembler) { |
1950 __ SetupDartSP(kTestStackSpace); | 1950 __ SetupDartSP(kTestStackSpace); |
1951 __ LoadDImmediate(V1, 21.0, kNoPP); | 1951 __ LoadDImmediate(V1, 21.0); |
1952 __ LoadDImmediate(V2, 21.0, kNoPP); | 1952 __ LoadDImmediate(V2, 21.0); |
1953 __ LoadImmediate(R1, 42, kNoPP); | 1953 __ LoadImmediate(R1, 42); |
1954 __ Push(R1); | 1954 __ Push(R1); |
1955 __ PushDouble(V1); | 1955 __ PushDouble(V1); |
1956 __ PushDouble(V2); | 1956 __ PushDouble(V2); |
1957 __ fldrq(V3, Address(SP, 2 * kWordSize, Address::PostIndex)); | 1957 __ fldrq(V3, Address(SP, 2 * kWordSize, Address::PostIndex)); |
1958 __ Pop(R0); | 1958 __ Pop(R0); |
1959 __ fstrq(V3, Address(SP, -2 * kWordSize, Address::PreIndex)); | 1959 __ fstrq(V3, Address(SP, -2 * kWordSize, Address::PreIndex)); |
1960 __ PopDouble(V0); | 1960 __ PopDouble(V0); |
1961 __ PopDouble(V1); | 1961 __ PopDouble(V1); |
1962 __ faddd(V0, V0, V1); | 1962 __ faddd(V0, V0, V1); |
1963 __ mov(CSP, SP); | 1963 __ mov(CSP, SP); |
1964 __ ret(); | 1964 __ ret(); |
1965 } | 1965 } |
1966 | 1966 |
1967 | 1967 |
1968 ASSEMBLER_TEST_RUN(FldrqFstrqPrePostIndex, test) { | 1968 ASSEMBLER_TEST_RUN(FldrqFstrqPrePostIndex, test) { |
1969 typedef double (*DoubleReturn)() DART_UNUSED; | 1969 typedef double (*DoubleReturn)() DART_UNUSED; |
1970 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); | 1970 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); |
1971 } | 1971 } |
1972 | 1972 |
1973 | 1973 |
1974 ASSEMBLER_TEST_GENERATE(Fcvtzds, assembler) { | 1974 ASSEMBLER_TEST_GENERATE(Fcvtzds, assembler) { |
1975 __ LoadDImmediate(V0, 42.0, kNoPP); | 1975 __ LoadDImmediate(V0, 42.0); |
1976 __ fcvtzds(R0, V0); | 1976 __ fcvtzds(R0, V0); |
1977 __ ret(); | 1977 __ ret(); |
1978 } | 1978 } |
1979 | 1979 |
1980 | 1980 |
1981 ASSEMBLER_TEST_RUN(Fcvtzds, test) { | 1981 ASSEMBLER_TEST_RUN(Fcvtzds, test) { |
1982 typedef int64_t (*Int64Return)() DART_UNUSED; | 1982 typedef int64_t (*Int64Return)() DART_UNUSED; |
1983 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); | 1983 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
1984 } | 1984 } |
1985 | 1985 |
1986 | 1986 |
1987 ASSEMBLER_TEST_GENERATE(Scvtfdx, assembler) { | 1987 ASSEMBLER_TEST_GENERATE(Scvtfdx, assembler) { |
1988 __ LoadImmediate(R0, 42, kNoPP); | 1988 __ LoadImmediate(R0, 42); |
1989 __ scvtfdx(V0, R0); | 1989 __ scvtfdx(V0, R0); |
1990 __ ret(); | 1990 __ ret(); |
1991 } | 1991 } |
1992 | 1992 |
1993 | 1993 |
1994 ASSEMBLER_TEST_RUN(Scvtfdx, test) { | 1994 ASSEMBLER_TEST_RUN(Scvtfdx, test) { |
1995 typedef double (*DoubleReturn)() DART_UNUSED; | 1995 typedef double (*DoubleReturn)() DART_UNUSED; |
1996 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); | 1996 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); |
1997 } | 1997 } |
1998 | 1998 |
1999 | 1999 |
2000 ASSEMBLER_TEST_GENERATE(Scvtfdw, assembler) { | 2000 ASSEMBLER_TEST_GENERATE(Scvtfdw, assembler) { |
2001 // Fill upper 32-bits with garbage. | 2001 // Fill upper 32-bits with garbage. |
2002 __ LoadImmediate(R0, 0x111111110000002A, kNoPP); | 2002 __ LoadImmediate(R0, 0x111111110000002A); |
2003 __ scvtfdw(V0, R0); | 2003 __ scvtfdw(V0, R0); |
2004 __ ret(); | 2004 __ ret(); |
2005 } | 2005 } |
2006 | 2006 |
2007 | 2007 |
2008 ASSEMBLER_TEST_RUN(Scvtfdw, test) { | 2008 ASSEMBLER_TEST_RUN(Scvtfdw, test) { |
2009 typedef double (*DoubleReturn)() DART_UNUSED; | 2009 typedef double (*DoubleReturn)() DART_UNUSED; |
2010 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); | 2010 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); |
2011 } | 2011 } |
2012 | 2012 |
2013 | 2013 |
2014 ASSEMBLER_TEST_GENERATE(FabsdPos, assembler) { | 2014 ASSEMBLER_TEST_GENERATE(FabsdPos, assembler) { |
2015 __ LoadDImmediate(V1, 42.0, kNoPP); | 2015 __ LoadDImmediate(V1, 42.0); |
2016 __ fabsd(V0, V1); | 2016 __ fabsd(V0, V1); |
2017 __ ret(); | 2017 __ ret(); |
2018 } | 2018 } |
2019 | 2019 |
2020 | 2020 |
2021 ASSEMBLER_TEST_RUN(FabsdPos, test) { | 2021 ASSEMBLER_TEST_RUN(FabsdPos, test) { |
2022 typedef double (*DoubleReturn)() DART_UNUSED; | 2022 typedef double (*DoubleReturn)() DART_UNUSED; |
2023 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); | 2023 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); |
2024 } | 2024 } |
2025 | 2025 |
2026 | 2026 |
2027 ASSEMBLER_TEST_GENERATE(FabsdNeg, assembler) { | 2027 ASSEMBLER_TEST_GENERATE(FabsdNeg, assembler) { |
2028 __ LoadDImmediate(V1, -42.0, kNoPP); | 2028 __ LoadDImmediate(V1, -42.0); |
2029 __ fabsd(V0, V1); | 2029 __ fabsd(V0, V1); |
2030 __ ret(); | 2030 __ ret(); |
2031 } | 2031 } |
2032 | 2032 |
2033 | 2033 |
2034 ASSEMBLER_TEST_RUN(FabsdNeg, test) { | 2034 ASSEMBLER_TEST_RUN(FabsdNeg, test) { |
2035 typedef double (*DoubleReturn)() DART_UNUSED; | 2035 typedef double (*DoubleReturn)() DART_UNUSED; |
2036 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); | 2036 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); |
2037 } | 2037 } |
2038 | 2038 |
2039 | 2039 |
2040 ASSEMBLER_TEST_GENERATE(FnegdPos, assembler) { | 2040 ASSEMBLER_TEST_GENERATE(FnegdPos, assembler) { |
2041 __ LoadDImmediate(V1, 42.0, kNoPP); | 2041 __ LoadDImmediate(V1, 42.0); |
2042 __ fnegd(V0, V1); | 2042 __ fnegd(V0, V1); |
2043 __ ret(); | 2043 __ ret(); |
2044 } | 2044 } |
2045 | 2045 |
2046 | 2046 |
2047 ASSEMBLER_TEST_RUN(FnegdPos, test) { | 2047 ASSEMBLER_TEST_RUN(FnegdPos, test) { |
2048 typedef double (*DoubleReturn)() DART_UNUSED; | 2048 typedef double (*DoubleReturn)() DART_UNUSED; |
2049 EXPECT_EQ(-42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); | 2049 EXPECT_EQ(-42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); |
2050 } | 2050 } |
2051 | 2051 |
2052 | 2052 |
2053 ASSEMBLER_TEST_GENERATE(FnegdNeg, assembler) { | 2053 ASSEMBLER_TEST_GENERATE(FnegdNeg, assembler) { |
2054 __ LoadDImmediate(V1, -42.0, kNoPP); | 2054 __ LoadDImmediate(V1, -42.0); |
2055 __ fnegd(V0, V1); | 2055 __ fnegd(V0, V1); |
2056 __ ret(); | 2056 __ ret(); |
2057 } | 2057 } |
2058 | 2058 |
2059 | 2059 |
2060 ASSEMBLER_TEST_RUN(FnegdNeg, test) { | 2060 ASSEMBLER_TEST_RUN(FnegdNeg, test) { |
2061 typedef double (*DoubleReturn)() DART_UNUSED; | 2061 typedef double (*DoubleReturn)() DART_UNUSED; |
2062 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); | 2062 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); |
2063 } | 2063 } |
2064 | 2064 |
2065 | 2065 |
2066 ASSEMBLER_TEST_GENERATE(Fsqrtd, assembler) { | 2066 ASSEMBLER_TEST_GENERATE(Fsqrtd, assembler) { |
2067 __ LoadDImmediate(V1, 64.0, kNoPP); | 2067 __ LoadDImmediate(V1, 64.0); |
2068 __ fsqrtd(V0, V1); | 2068 __ fsqrtd(V0, V1); |
2069 __ ret(); | 2069 __ ret(); |
2070 } | 2070 } |
2071 | 2071 |
2072 | 2072 |
2073 ASSEMBLER_TEST_RUN(Fsqrtd, test) { | 2073 ASSEMBLER_TEST_RUN(Fsqrtd, test) { |
2074 typedef double (*DoubleReturn)() DART_UNUSED; | 2074 typedef double (*DoubleReturn)() DART_UNUSED; |
2075 EXPECT_EQ(8.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); | 2075 EXPECT_EQ(8.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); |
2076 } | 2076 } |
2077 | 2077 |
2078 | 2078 |
2079 ASSEMBLER_TEST_GENERATE(Fmuld, assembler) { | 2079 ASSEMBLER_TEST_GENERATE(Fmuld, assembler) { |
2080 __ LoadDImmediate(V1, 84.0, kNoPP); | 2080 __ LoadDImmediate(V1, 84.0); |
2081 __ LoadDImmediate(V2, 0.5, kNoPP); | 2081 __ LoadDImmediate(V2, 0.5); |
2082 __ fmuld(V0, V1, V2); | 2082 __ fmuld(V0, V1, V2); |
2083 __ ret(); | 2083 __ ret(); |
2084 } | 2084 } |
2085 | 2085 |
2086 | 2086 |
2087 ASSEMBLER_TEST_RUN(Fmuld, test) { | 2087 ASSEMBLER_TEST_RUN(Fmuld, test) { |
2088 typedef double (*DoubleReturn)() DART_UNUSED; | 2088 typedef double (*DoubleReturn)() DART_UNUSED; |
2089 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); | 2089 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); |
2090 } | 2090 } |
2091 | 2091 |
2092 | 2092 |
2093 ASSEMBLER_TEST_GENERATE(Fdivd, assembler) { | 2093 ASSEMBLER_TEST_GENERATE(Fdivd, assembler) { |
2094 __ LoadDImmediate(V1, 84.0, kNoPP); | 2094 __ LoadDImmediate(V1, 84.0); |
2095 __ LoadDImmediate(V2, 2.0, kNoPP); | 2095 __ LoadDImmediate(V2, 2.0); |
2096 __ fdivd(V0, V1, V2); | 2096 __ fdivd(V0, V1, V2); |
2097 __ ret(); | 2097 __ ret(); |
2098 } | 2098 } |
2099 | 2099 |
2100 | 2100 |
2101 ASSEMBLER_TEST_RUN(Fdivd, test) { | 2101 ASSEMBLER_TEST_RUN(Fdivd, test) { |
2102 typedef double (*DoubleReturn)() DART_UNUSED; | 2102 typedef double (*DoubleReturn)() DART_UNUSED; |
2103 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); | 2103 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); |
2104 } | 2104 } |
2105 | 2105 |
2106 | 2106 |
2107 ASSEMBLER_TEST_GENERATE(Faddd, assembler) { | 2107 ASSEMBLER_TEST_GENERATE(Faddd, assembler) { |
2108 __ LoadDImmediate(V1, 41.5, kNoPP); | 2108 __ LoadDImmediate(V1, 41.5); |
2109 __ LoadDImmediate(V2, 0.5, kNoPP); | 2109 __ LoadDImmediate(V2, 0.5); |
2110 __ faddd(V0, V1, V2); | 2110 __ faddd(V0, V1, V2); |
2111 __ ret(); | 2111 __ ret(); |
2112 } | 2112 } |
2113 | 2113 |
2114 | 2114 |
2115 ASSEMBLER_TEST_RUN(Faddd, test) { | 2115 ASSEMBLER_TEST_RUN(Faddd, test) { |
2116 typedef double (*DoubleReturn)() DART_UNUSED; | 2116 typedef double (*DoubleReturn)() DART_UNUSED; |
2117 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); | 2117 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); |
2118 } | 2118 } |
2119 | 2119 |
2120 | 2120 |
2121 ASSEMBLER_TEST_GENERATE(Fsubd, assembler) { | 2121 ASSEMBLER_TEST_GENERATE(Fsubd, assembler) { |
2122 __ LoadDImmediate(V1, 42.5, kNoPP); | 2122 __ LoadDImmediate(V1, 42.5); |
2123 __ LoadDImmediate(V2, 0.5, kNoPP); | 2123 __ LoadDImmediate(V2, 0.5); |
2124 __ fsubd(V0, V1, V2); | 2124 __ fsubd(V0, V1, V2); |
2125 __ ret(); | 2125 __ ret(); |
2126 } | 2126 } |
2127 | 2127 |
2128 | 2128 |
2129 ASSEMBLER_TEST_RUN(Fsubd, test) { | 2129 ASSEMBLER_TEST_RUN(Fsubd, test) { |
2130 typedef double (*DoubleReturn)() DART_UNUSED; | 2130 typedef double (*DoubleReturn)() DART_UNUSED; |
2131 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); | 2131 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); |
2132 } | 2132 } |
2133 | 2133 |
2134 | 2134 |
2135 ASSEMBLER_TEST_GENERATE(FldrdFstrdHeapTag, assembler) { | 2135 ASSEMBLER_TEST_GENERATE(FldrdFstrdHeapTag, assembler) { |
2136 __ SetupDartSP(kTestStackSpace); | 2136 __ SetupDartSP(kTestStackSpace); |
2137 __ LoadDImmediate(V0, 43.0, kNoPP); | 2137 __ LoadDImmediate(V0, 43.0); |
2138 __ LoadDImmediate(V1, 42.0, kNoPP); | 2138 __ LoadDImmediate(V1, 42.0); |
2139 __ AddImmediate(SP, SP, -1 * kWordSize, kNoPP); | 2139 __ AddImmediate(SP, SP, -1 * kWordSize); |
2140 __ add(R2, SP, Operand(1)); | 2140 __ add(R2, SP, Operand(1)); |
2141 __ fstrd(V1, Address(R2, -1)); | 2141 __ fstrd(V1, Address(R2, -1)); |
2142 __ fldrd(V0, Address(R2, -1)); | 2142 __ fldrd(V0, Address(R2, -1)); |
2143 __ AddImmediate(SP, SP, 1 * kWordSize, kNoPP); | 2143 __ AddImmediate(SP, SP, 1 * kWordSize); |
2144 __ mov(CSP, SP); | 2144 __ mov(CSP, SP); |
2145 __ ret(); | 2145 __ ret(); |
2146 } | 2146 } |
2147 | 2147 |
2148 | 2148 |
2149 ASSEMBLER_TEST_RUN(FldrdFstrdHeapTag, test) { | 2149 ASSEMBLER_TEST_RUN(FldrdFstrdHeapTag, test) { |
2150 typedef double (*DoubleReturn)() DART_UNUSED; | 2150 typedef double (*DoubleReturn)() DART_UNUSED; |
2151 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); | 2151 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); |
2152 } | 2152 } |
2153 | 2153 |
2154 | 2154 |
2155 ASSEMBLER_TEST_GENERATE(FldrdFstrdLargeIndex, assembler) { | 2155 ASSEMBLER_TEST_GENERATE(FldrdFstrdLargeIndex, assembler) { |
2156 __ SetupDartSP(kTestStackSpace); | 2156 __ SetupDartSP(kTestStackSpace); |
2157 __ LoadDImmediate(V0, 43.0, kNoPP); | 2157 __ LoadDImmediate(V0, 43.0); |
2158 __ LoadDImmediate(V1, 42.0, kNoPP); | 2158 __ LoadDImmediate(V1, 42.0); |
2159 // Largest negative offset that can fit in the signed 9-bit immediate field. | 2159 // Largest negative offset that can fit in the signed 9-bit immediate field. |
2160 __ fstrd(V1, Address(SP, -32*kWordSize, Address::PreIndex)); | 2160 __ fstrd(V1, Address(SP, -32*kWordSize, Address::PreIndex)); |
2161 // Largest positive kWordSize aligned offset that we can fit. | 2161 // Largest positive kWordSize aligned offset that we can fit. |
2162 __ fldrd(V0, Address(SP, 31*kWordSize, Address::PostIndex)); | 2162 __ fldrd(V0, Address(SP, 31*kWordSize, Address::PostIndex)); |
2163 // Correction. | 2163 // Correction. |
2164 __ add(SP, SP, Operand(kWordSize)); // Restore SP. | 2164 __ add(SP, SP, Operand(kWordSize)); // Restore SP. |
2165 __ mov(CSP, SP); | 2165 __ mov(CSP, SP); |
2166 __ ret(); | 2166 __ ret(); |
2167 } | 2167 } |
2168 | 2168 |
2169 | 2169 |
2170 ASSEMBLER_TEST_RUN(FldrdFstrdLargeIndex, test) { | 2170 ASSEMBLER_TEST_RUN(FldrdFstrdLargeIndex, test) { |
2171 typedef double (*DoubleReturn)() DART_UNUSED; | 2171 typedef double (*DoubleReturn)() DART_UNUSED; |
2172 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); | 2172 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); |
2173 } | 2173 } |
2174 | 2174 |
2175 | 2175 |
2176 ASSEMBLER_TEST_GENERATE(FldrdFstrdLargeOffset, assembler) { | 2176 ASSEMBLER_TEST_GENERATE(FldrdFstrdLargeOffset, assembler) { |
2177 __ SetupDartSP(kTestStackSpace); | 2177 __ SetupDartSP(kTestStackSpace); |
2178 __ LoadDImmediate(V0, 43.0, kNoPP); | 2178 __ LoadDImmediate(V0, 43.0); |
2179 __ LoadDImmediate(V1, 42.0, kNoPP); | 2179 __ LoadDImmediate(V1, 42.0); |
2180 __ sub(SP, SP, Operand(512*kWordSize)); | 2180 __ sub(SP, SP, Operand(512*kWordSize)); |
2181 __ fstrd(V1, Address(SP, 512*kWordSize, Address::Offset)); | 2181 __ fstrd(V1, Address(SP, 512*kWordSize, Address::Offset)); |
2182 __ add(SP, SP, Operand(512*kWordSize)); | 2182 __ add(SP, SP, Operand(512*kWordSize)); |
2183 __ fldrd(V0, Address(SP)); | 2183 __ fldrd(V0, Address(SP)); |
2184 __ mov(CSP, SP); | 2184 __ mov(CSP, SP); |
2185 __ ret(); | 2185 __ ret(); |
2186 } | 2186 } |
2187 | 2187 |
2188 | 2188 |
2189 ASSEMBLER_TEST_RUN(FldrdFstrdLargeOffset, test) { | 2189 ASSEMBLER_TEST_RUN(FldrdFstrdLargeOffset, test) { |
2190 typedef double (*DoubleReturn)() DART_UNUSED; | 2190 typedef double (*DoubleReturn)() DART_UNUSED; |
2191 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); | 2191 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); |
2192 } | 2192 } |
2193 | 2193 |
2194 | 2194 |
2195 ASSEMBLER_TEST_GENERATE(FldrdFstrdExtReg, assembler) { | 2195 ASSEMBLER_TEST_GENERATE(FldrdFstrdExtReg, assembler) { |
2196 __ SetupDartSP(kTestStackSpace); | 2196 __ SetupDartSP(kTestStackSpace); |
2197 __ LoadDImmediate(V0, 43.0, kNoPP); | 2197 __ LoadDImmediate(V0, 43.0); |
2198 __ LoadDImmediate(V1, 42.0, kNoPP); | 2198 __ LoadDImmediate(V1, 42.0); |
2199 __ movz(R2, Immediate(0xfff8), 0); | 2199 __ movz(R2, Immediate(0xfff8), 0); |
2200 __ movk(R2, Immediate(0xffff), 1); // R2 <- -8 (int32_t). | 2200 __ movk(R2, Immediate(0xffff), 1); // R2 <- -8 (int32_t). |
2201 // This should sign extend R2, and add to SP to get address, | 2201 // This should sign extend R2, and add to SP to get address, |
2202 // i.e. SP - kWordSize. | 2202 // i.e. SP - kWordSize. |
2203 __ fstrd(V1, Address(SP, R2, SXTW)); | 2203 __ fstrd(V1, Address(SP, R2, SXTW)); |
2204 __ sub(SP, SP, Operand(kWordSize)); | 2204 __ sub(SP, SP, Operand(kWordSize)); |
2205 __ fldrd(V0, Address(SP)); | 2205 __ fldrd(V0, Address(SP)); |
2206 __ add(SP, SP, Operand(kWordSize)); | 2206 __ add(SP, SP, Operand(kWordSize)); |
2207 __ mov(CSP, SP); | 2207 __ mov(CSP, SP); |
2208 __ ret(); | 2208 __ ret(); |
2209 } | 2209 } |
2210 | 2210 |
2211 | 2211 |
2212 ASSEMBLER_TEST_RUN(FldrdFstrdExtReg, test) { | 2212 ASSEMBLER_TEST_RUN(FldrdFstrdExtReg, test) { |
2213 typedef double (*DoubleReturn)() DART_UNUSED; | 2213 typedef double (*DoubleReturn)() DART_UNUSED; |
2214 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); | 2214 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); |
2215 } | 2215 } |
2216 | 2216 |
2217 | 2217 |
2218 ASSEMBLER_TEST_GENERATE(FldrdFstrdScaledReg, assembler) { | 2218 ASSEMBLER_TEST_GENERATE(FldrdFstrdScaledReg, assembler) { |
2219 __ SetupDartSP(kTestStackSpace); | 2219 __ SetupDartSP(kTestStackSpace); |
2220 __ LoadDImmediate(V0, 43.0, kNoPP); | 2220 __ LoadDImmediate(V0, 43.0); |
2221 __ LoadDImmediate(V1, 42.0, kNoPP); | 2221 __ LoadDImmediate(V1, 42.0); |
2222 __ movz(R2, Immediate(10), 0); | 2222 __ movz(R2, Immediate(10), 0); |
2223 __ sub(SP, SP, Operand(10*kWordSize)); | 2223 __ sub(SP, SP, Operand(10*kWordSize)); |
2224 // Store V1 into SP + R2 * kWordSize. | 2224 // Store V1 into SP + R2 * kWordSize. |
2225 __ fstrd(V1, Address(SP, R2, UXTX, Address::Scaled)); | 2225 __ fstrd(V1, Address(SP, R2, UXTX, Address::Scaled)); |
2226 __ fldrd(V0, Address(SP, R2, UXTX, Address::Scaled)); | 2226 __ fldrd(V0, Address(SP, R2, UXTX, Address::Scaled)); |
2227 __ add(SP, SP, Operand(10*kWordSize)); | 2227 __ add(SP, SP, Operand(10*kWordSize)); |
2228 __ mov(CSP, SP); | 2228 __ mov(CSP, SP); |
2229 __ ret(); | 2229 __ ret(); |
2230 } | 2230 } |
2231 | 2231 |
2232 | 2232 |
2233 ASSEMBLER_TEST_RUN(FldrdFstrdScaledReg, test) { | 2233 ASSEMBLER_TEST_RUN(FldrdFstrdScaledReg, test) { |
2234 typedef double (*DoubleReturn)() DART_UNUSED; | 2234 typedef double (*DoubleReturn)() DART_UNUSED; |
2235 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); | 2235 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); |
2236 } | 2236 } |
2237 | 2237 |
2238 | 2238 |
2239 ASSEMBLER_TEST_GENERATE(VinswVmovrs, assembler) { | 2239 ASSEMBLER_TEST_GENERATE(VinswVmovrs, assembler) { |
2240 __ LoadImmediate(R0, 42, kNoPP); | 2240 __ LoadImmediate(R0, 42); |
2241 __ LoadImmediate(R1, 43, kNoPP); | 2241 __ LoadImmediate(R1, 43); |
2242 __ LoadImmediate(R2, 44, kNoPP); | 2242 __ LoadImmediate(R2, 44); |
2243 __ LoadImmediate(R3, 45, kNoPP); | 2243 __ LoadImmediate(R3, 45); |
2244 | 2244 |
2245 __ vinsw(V0, 0, R0); | 2245 __ vinsw(V0, 0, R0); |
2246 __ vinsw(V0, 1, R1); | 2246 __ vinsw(V0, 1, R1); |
2247 __ vinsw(V0, 2, R2); | 2247 __ vinsw(V0, 2, R2); |
2248 __ vinsw(V0, 3, R3); | 2248 __ vinsw(V0, 3, R3); |
2249 | 2249 |
2250 __ vmovrs(R4, V0, 0); | 2250 __ vmovrs(R4, V0, 0); |
2251 __ vmovrs(R5, V0, 1); | 2251 __ vmovrs(R5, V0, 1); |
2252 __ vmovrs(R6, V0, 2); | 2252 __ vmovrs(R6, V0, 2); |
2253 __ vmovrs(R7, V0, 3); | 2253 __ vmovrs(R7, V0, 3); |
2254 | 2254 |
2255 __ add(R0, R4, Operand(R5)); | 2255 __ add(R0, R4, Operand(R5)); |
2256 __ add(R0, R0, Operand(R6)); | 2256 __ add(R0, R0, Operand(R6)); |
2257 __ add(R0, R0, Operand(R7)); | 2257 __ add(R0, R0, Operand(R7)); |
2258 __ ret(); | 2258 __ ret(); |
2259 } | 2259 } |
2260 | 2260 |
2261 | 2261 |
2262 ASSEMBLER_TEST_RUN(VinswVmovrs, test) { | 2262 ASSEMBLER_TEST_RUN(VinswVmovrs, test) { |
2263 EXPECT(test != NULL); | 2263 EXPECT(test != NULL); |
2264 typedef int64_t (*Int64Return)() DART_UNUSED; | 2264 typedef int64_t (*Int64Return)() DART_UNUSED; |
2265 EXPECT_EQ(174, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); | 2265 EXPECT_EQ(174, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
2266 } | 2266 } |
2267 | 2267 |
2268 | 2268 |
2269 ASSEMBLER_TEST_GENERATE(VinsxVmovrd, assembler) { | 2269 ASSEMBLER_TEST_GENERATE(VinsxVmovrd, assembler) { |
2270 __ LoadImmediate(R0, 42, kNoPP); | 2270 __ LoadImmediate(R0, 42); |
2271 __ LoadImmediate(R1, 43, kNoPP); | 2271 __ LoadImmediate(R1, 43); |
2272 | 2272 |
2273 __ vinsx(V0, 0, R0); | 2273 __ vinsx(V0, 0, R0); |
2274 __ vinsx(V0, 1, R1); | 2274 __ vinsx(V0, 1, R1); |
2275 | 2275 |
2276 __ vmovrd(R2, V0, 0); | 2276 __ vmovrd(R2, V0, 0); |
2277 __ vmovrd(R3, V0, 1); | 2277 __ vmovrd(R3, V0, 1); |
2278 | 2278 |
2279 __ add(R0, R2, Operand(R3)); | 2279 __ add(R0, R2, Operand(R3)); |
2280 __ ret(); | 2280 __ ret(); |
2281 } | 2281 } |
2282 | 2282 |
2283 | 2283 |
2284 ASSEMBLER_TEST_RUN(VinsxVmovrd, test) { | 2284 ASSEMBLER_TEST_RUN(VinsxVmovrd, test) { |
2285 EXPECT(test != NULL); | 2285 EXPECT(test != NULL); |
2286 typedef int64_t (*Int64Return)() DART_UNUSED; | 2286 typedef int64_t (*Int64Return)() DART_UNUSED; |
2287 EXPECT_EQ(85, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); | 2287 EXPECT_EQ(85, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
2288 } | 2288 } |
2289 | 2289 |
2290 | 2290 |
2291 ASSEMBLER_TEST_GENERATE(Vnot, assembler) { | 2291 ASSEMBLER_TEST_GENERATE(Vnot, assembler) { |
2292 __ LoadImmediate(R0, 0xfffffffe, kNoPP); | 2292 __ LoadImmediate(R0, 0xfffffffe); |
2293 __ LoadImmediate(R1, 0xffffffff, kNoPP); | 2293 __ LoadImmediate(R1, 0xffffffff); |
2294 __ vinsw(V1, 0, R1); | 2294 __ vinsw(V1, 0, R1); |
2295 __ vinsw(V1, 1, R0); | 2295 __ vinsw(V1, 1, R0); |
2296 __ vinsw(V1, 2, R1); | 2296 __ vinsw(V1, 2, R1); |
2297 __ vinsw(V1, 3, R0); | 2297 __ vinsw(V1, 3, R0); |
2298 | 2298 |
2299 __ vnot(V0, V1); | 2299 __ vnot(V0, V1); |
2300 | 2300 |
2301 __ vmovrs(R2, V0, 0); | 2301 __ vmovrs(R2, V0, 0); |
2302 __ vmovrs(R3, V0, 1); | 2302 __ vmovrs(R3, V0, 1); |
2303 __ vmovrs(R4, V0, 2); | 2303 __ vmovrs(R4, V0, 2); |
2304 __ vmovrs(R5, V0, 3); | 2304 __ vmovrs(R5, V0, 3); |
2305 __ add(R0, R2, Operand(R3)); | 2305 __ add(R0, R2, Operand(R3)); |
2306 __ add(R0, R0, Operand(R4)); | 2306 __ add(R0, R0, Operand(R4)); |
2307 __ add(R0, R0, Operand(R5)); | 2307 __ add(R0, R0, Operand(R5)); |
2308 __ ret(); | 2308 __ ret(); |
2309 } | 2309 } |
2310 | 2310 |
2311 | 2311 |
2312 ASSEMBLER_TEST_RUN(Vnot, test) { | 2312 ASSEMBLER_TEST_RUN(Vnot, test) { |
2313 EXPECT(test != NULL); | 2313 EXPECT(test != NULL); |
2314 typedef int64_t (*Int64Return)() DART_UNUSED; | 2314 typedef int64_t (*Int64Return)() DART_UNUSED; |
2315 EXPECT_EQ(2, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); | 2315 EXPECT_EQ(2, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
2316 } | 2316 } |
2317 | 2317 |
2318 | 2318 |
2319 ASSEMBLER_TEST_GENERATE(Vabss, assembler) { | 2319 ASSEMBLER_TEST_GENERATE(Vabss, assembler) { |
2320 __ LoadDImmediate(V1, 21.0, kNoPP); | 2320 __ LoadDImmediate(V1, 21.0); |
2321 __ LoadDImmediate(V2, -21.0, kNoPP); | 2321 __ LoadDImmediate(V2, -21.0); |
2322 | 2322 |
2323 __ fcvtsd(V1, V1); | 2323 __ fcvtsd(V1, V1); |
2324 __ fcvtsd(V2, V2); | 2324 __ fcvtsd(V2, V2); |
2325 | 2325 |
2326 __ veor(V3, V3, V3); | 2326 __ veor(V3, V3, V3); |
2327 __ vinss(V3, 1, V1, 0); | 2327 __ vinss(V3, 1, V1, 0); |
2328 __ vinss(V3, 3, V2, 0); | 2328 __ vinss(V3, 3, V2, 0); |
2329 | 2329 |
2330 __ vabss(V4, V3); | 2330 __ vabss(V4, V3); |
2331 | 2331 |
2332 __ vinss(V5, 0, V4, 1); | 2332 __ vinss(V5, 0, V4, 1); |
2333 __ vinss(V6, 0, V4, 3); | 2333 __ vinss(V6, 0, V4, 3); |
2334 | 2334 |
2335 __ fcvtds(V5, V5); | 2335 __ fcvtds(V5, V5); |
2336 __ fcvtds(V6, V6); | 2336 __ fcvtds(V6, V6); |
2337 | 2337 |
2338 __ faddd(V0, V5, V6); | 2338 __ faddd(V0, V5, V6); |
2339 __ ret(); | 2339 __ ret(); |
2340 } | 2340 } |
2341 | 2341 |
2342 | 2342 |
2343 ASSEMBLER_TEST_RUN(Vabss, test) { | 2343 ASSEMBLER_TEST_RUN(Vabss, test) { |
2344 typedef double (*DoubleReturn)() DART_UNUSED; | 2344 typedef double (*DoubleReturn)() DART_UNUSED; |
2345 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); | 2345 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); |
2346 } | 2346 } |
2347 | 2347 |
2348 | 2348 |
2349 ASSEMBLER_TEST_GENERATE(Vabsd, assembler) { | 2349 ASSEMBLER_TEST_GENERATE(Vabsd, assembler) { |
2350 __ LoadDImmediate(V1, 21.0, kNoPP); | 2350 __ LoadDImmediate(V1, 21.0); |
2351 __ LoadDImmediate(V2, -21.0, kNoPP); | 2351 __ LoadDImmediate(V2, -21.0); |
2352 | 2352 |
2353 __ vinsd(V3, 0, V1, 0); | 2353 __ vinsd(V3, 0, V1, 0); |
2354 __ vinsd(V3, 1, V2, 0); | 2354 __ vinsd(V3, 1, V2, 0); |
2355 | 2355 |
2356 __ vabsd(V4, V3); | 2356 __ vabsd(V4, V3); |
2357 | 2357 |
2358 __ vinsd(V5, 0, V4, 0); | 2358 __ vinsd(V5, 0, V4, 0); |
2359 __ vinsd(V6, 0, V4, 1); | 2359 __ vinsd(V6, 0, V4, 1); |
2360 | 2360 |
2361 __ faddd(V0, V5, V6); | 2361 __ faddd(V0, V5, V6); |
2362 __ ret(); | 2362 __ ret(); |
2363 } | 2363 } |
2364 | 2364 |
2365 | 2365 |
2366 ASSEMBLER_TEST_RUN(Vabsd, test) { | 2366 ASSEMBLER_TEST_RUN(Vabsd, test) { |
2367 typedef double (*DoubleReturn)() DART_UNUSED; | 2367 typedef double (*DoubleReturn)() DART_UNUSED; |
2368 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); | 2368 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); |
2369 } | 2369 } |
2370 | 2370 |
2371 | 2371 |
2372 ASSEMBLER_TEST_GENERATE(Vnegs, assembler) { | 2372 ASSEMBLER_TEST_GENERATE(Vnegs, assembler) { |
2373 __ LoadDImmediate(V1, 42.0, kNoPP); | 2373 __ LoadDImmediate(V1, 42.0); |
2374 __ LoadDImmediate(V2, -84.0, kNoPP); | 2374 __ LoadDImmediate(V2, -84.0); |
2375 | 2375 |
2376 __ fcvtsd(V1, V1); | 2376 __ fcvtsd(V1, V1); |
2377 __ fcvtsd(V2, V2); | 2377 __ fcvtsd(V2, V2); |
2378 | 2378 |
2379 __ veor(V3, V3, V3); | 2379 __ veor(V3, V3, V3); |
2380 __ vinss(V3, 1, V1, 0); | 2380 __ vinss(V3, 1, V1, 0); |
2381 __ vinss(V3, 3, V2, 0); | 2381 __ vinss(V3, 3, V2, 0); |
2382 | 2382 |
2383 __ vnegs(V4, V3); | 2383 __ vnegs(V4, V3); |
2384 | 2384 |
2385 __ vinss(V5, 0, V4, 1); | 2385 __ vinss(V5, 0, V4, 1); |
2386 __ vinss(V6, 0, V4, 3); | 2386 __ vinss(V6, 0, V4, 3); |
2387 | 2387 |
2388 __ fcvtds(V5, V5); | 2388 __ fcvtds(V5, V5); |
2389 __ fcvtds(V6, V6); | 2389 __ fcvtds(V6, V6); |
2390 __ faddd(V0, V5, V6); | 2390 __ faddd(V0, V5, V6); |
2391 __ ret(); | 2391 __ ret(); |
2392 } | 2392 } |
2393 | 2393 |
2394 | 2394 |
2395 ASSEMBLER_TEST_RUN(Vnegs, test) { | 2395 ASSEMBLER_TEST_RUN(Vnegs, test) { |
2396 typedef double (*DoubleReturn)() DART_UNUSED; | 2396 typedef double (*DoubleReturn)() DART_UNUSED; |
2397 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); | 2397 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); |
2398 } | 2398 } |
2399 | 2399 |
2400 | 2400 |
2401 ASSEMBLER_TEST_GENERATE(Vnegd, assembler) { | 2401 ASSEMBLER_TEST_GENERATE(Vnegd, assembler) { |
2402 __ LoadDImmediate(V1, 42.0, kNoPP); | 2402 __ LoadDImmediate(V1, 42.0); |
2403 __ LoadDImmediate(V2, -84.0, kNoPP); | 2403 __ LoadDImmediate(V2, -84.0); |
2404 | 2404 |
2405 __ vinsd(V3, 0, V1, 0); | 2405 __ vinsd(V3, 0, V1, 0); |
2406 __ vinsd(V3, 1, V2, 0); | 2406 __ vinsd(V3, 1, V2, 0); |
2407 | 2407 |
2408 __ vnegd(V4, V3); | 2408 __ vnegd(V4, V3); |
2409 | 2409 |
2410 __ vinsd(V5, 0, V4, 0); | 2410 __ vinsd(V5, 0, V4, 0); |
2411 __ vinsd(V6, 0, V4, 1); | 2411 __ vinsd(V6, 0, V4, 1); |
2412 | 2412 |
2413 __ faddd(V0, V5, V6); | 2413 __ faddd(V0, V5, V6); |
2414 __ ret(); | 2414 __ ret(); |
2415 } | 2415 } |
2416 | 2416 |
2417 | 2417 |
2418 ASSEMBLER_TEST_RUN(Vnegd, test) { | 2418 ASSEMBLER_TEST_RUN(Vnegd, test) { |
2419 typedef double (*DoubleReturn)() DART_UNUSED; | 2419 typedef double (*DoubleReturn)() DART_UNUSED; |
2420 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); | 2420 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); |
2421 } | 2421 } |
2422 | 2422 |
2423 | 2423 |
2424 ASSEMBLER_TEST_GENERATE(Vadds, assembler) { | 2424 ASSEMBLER_TEST_GENERATE(Vadds, assembler) { |
2425 __ LoadDImmediate(V0, 0.0, kNoPP); | 2425 __ LoadDImmediate(V0, 0.0); |
2426 __ LoadDImmediate(V1, 1.0, kNoPP); | 2426 __ LoadDImmediate(V1, 1.0); |
2427 __ LoadDImmediate(V2, 2.0, kNoPP); | 2427 __ LoadDImmediate(V2, 2.0); |
2428 __ LoadDImmediate(V3, 3.0, kNoPP); | 2428 __ LoadDImmediate(V3, 3.0); |
2429 | 2429 |
2430 __ fcvtsd(V0, V0); | 2430 __ fcvtsd(V0, V0); |
2431 __ fcvtsd(V1, V1); | 2431 __ fcvtsd(V1, V1); |
2432 __ fcvtsd(V2, V2); | 2432 __ fcvtsd(V2, V2); |
2433 __ fcvtsd(V3, V3); | 2433 __ fcvtsd(V3, V3); |
2434 | 2434 |
2435 __ vinss(V4, 0, V0, 0); | 2435 __ vinss(V4, 0, V0, 0); |
2436 __ vinss(V4, 1, V1, 0); | 2436 __ vinss(V4, 1, V1, 0); |
2437 __ vinss(V4, 2, V2, 0); | 2437 __ vinss(V4, 2, V2, 0); |
2438 __ vinss(V4, 3, V3, 0); | 2438 __ vinss(V4, 3, V3, 0); |
(...skipping 17 matching lines...) Expand all Loading... |
2456 } | 2456 } |
2457 | 2457 |
2458 | 2458 |
2459 ASSEMBLER_TEST_RUN(Vadds, test) { | 2459 ASSEMBLER_TEST_RUN(Vadds, test) { |
2460 typedef double (*DoubleReturn)() DART_UNUSED; | 2460 typedef double (*DoubleReturn)() DART_UNUSED; |
2461 EXPECT_EQ(12.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); | 2461 EXPECT_EQ(12.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); |
2462 } | 2462 } |
2463 | 2463 |
2464 | 2464 |
2465 ASSEMBLER_TEST_GENERATE(Vsubs, assembler) { | 2465 ASSEMBLER_TEST_GENERATE(Vsubs, assembler) { |
2466 __ LoadDImmediate(V0, 0.0, kNoPP); | 2466 __ LoadDImmediate(V0, 0.0); |
2467 __ LoadDImmediate(V1, 1.0, kNoPP); | 2467 __ LoadDImmediate(V1, 1.0); |
2468 __ LoadDImmediate(V2, 2.0, kNoPP); | 2468 __ LoadDImmediate(V2, 2.0); |
2469 __ LoadDImmediate(V3, 3.0, kNoPP); | 2469 __ LoadDImmediate(V3, 3.0); |
2470 __ LoadDImmediate(V5, 0.0, kNoPP); | 2470 __ LoadDImmediate(V5, 0.0); |
2471 | 2471 |
2472 __ fcvtsd(V0, V0); | 2472 __ fcvtsd(V0, V0); |
2473 __ fcvtsd(V1, V1); | 2473 __ fcvtsd(V1, V1); |
2474 __ fcvtsd(V2, V2); | 2474 __ fcvtsd(V2, V2); |
2475 __ fcvtsd(V3, V3); | 2475 __ fcvtsd(V3, V3); |
2476 | 2476 |
2477 __ vinss(V4, 0, V0, 0); | 2477 __ vinss(V4, 0, V0, 0); |
2478 __ vinss(V4, 1, V1, 0); | 2478 __ vinss(V4, 1, V1, 0); |
2479 __ vinss(V4, 2, V2, 0); | 2479 __ vinss(V4, 2, V2, 0); |
2480 __ vinss(V4, 3, V3, 0); | 2480 __ vinss(V4, 3, V3, 0); |
(...skipping 17 matching lines...) Expand all Loading... |
2498 } | 2498 } |
2499 | 2499 |
2500 | 2500 |
2501 ASSEMBLER_TEST_RUN(Vsubs, test) { | 2501 ASSEMBLER_TEST_RUN(Vsubs, test) { |
2502 typedef double (*DoubleReturn)() DART_UNUSED; | 2502 typedef double (*DoubleReturn)() DART_UNUSED; |
2503 EXPECT_EQ(-6.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); | 2503 EXPECT_EQ(-6.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); |
2504 } | 2504 } |
2505 | 2505 |
2506 | 2506 |
2507 ASSEMBLER_TEST_GENERATE(Vmuls, assembler) { | 2507 ASSEMBLER_TEST_GENERATE(Vmuls, assembler) { |
2508 __ LoadDImmediate(V0, 0.0, kNoPP); | 2508 __ LoadDImmediate(V0, 0.0); |
2509 __ LoadDImmediate(V1, 1.0, kNoPP); | 2509 __ LoadDImmediate(V1, 1.0); |
2510 __ LoadDImmediate(V2, 2.0, kNoPP); | 2510 __ LoadDImmediate(V2, 2.0); |
2511 __ LoadDImmediate(V3, 3.0, kNoPP); | 2511 __ LoadDImmediate(V3, 3.0); |
2512 | 2512 |
2513 __ fcvtsd(V0, V0); | 2513 __ fcvtsd(V0, V0); |
2514 __ fcvtsd(V1, V1); | 2514 __ fcvtsd(V1, V1); |
2515 __ fcvtsd(V2, V2); | 2515 __ fcvtsd(V2, V2); |
2516 __ fcvtsd(V3, V3); | 2516 __ fcvtsd(V3, V3); |
2517 | 2517 |
2518 __ vinss(V4, 0, V0, 0); | 2518 __ vinss(V4, 0, V0, 0); |
2519 __ vinss(V4, 1, V1, 0); | 2519 __ vinss(V4, 1, V1, 0); |
2520 __ vinss(V4, 2, V2, 0); | 2520 __ vinss(V4, 2, V2, 0); |
2521 __ vinss(V4, 3, V3, 0); | 2521 __ vinss(V4, 3, V3, 0); |
(...skipping 17 matching lines...) Expand all Loading... |
2539 } | 2539 } |
2540 | 2540 |
2541 | 2541 |
2542 ASSEMBLER_TEST_RUN(Vmuls, test) { | 2542 ASSEMBLER_TEST_RUN(Vmuls, test) { |
2543 typedef double (*DoubleReturn)() DART_UNUSED; | 2543 typedef double (*DoubleReturn)() DART_UNUSED; |
2544 EXPECT_EQ(14.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); | 2544 EXPECT_EQ(14.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); |
2545 } | 2545 } |
2546 | 2546 |
2547 | 2547 |
2548 ASSEMBLER_TEST_GENERATE(Vdivs, assembler) { | 2548 ASSEMBLER_TEST_GENERATE(Vdivs, assembler) { |
2549 __ LoadDImmediate(V0, 0.0, kNoPP); | 2549 __ LoadDImmediate(V0, 0.0); |
2550 __ LoadDImmediate(V1, 1.0, kNoPP); | 2550 __ LoadDImmediate(V1, 1.0); |
2551 __ LoadDImmediate(V2, 2.0, kNoPP); | 2551 __ LoadDImmediate(V2, 2.0); |
2552 __ LoadDImmediate(V3, 3.0, kNoPP); | 2552 __ LoadDImmediate(V3, 3.0); |
2553 | 2553 |
2554 __ fcvtsd(V0, V0); | 2554 __ fcvtsd(V0, V0); |
2555 __ fcvtsd(V1, V1); | 2555 __ fcvtsd(V1, V1); |
2556 __ fcvtsd(V2, V2); | 2556 __ fcvtsd(V2, V2); |
2557 __ fcvtsd(V3, V3); | 2557 __ fcvtsd(V3, V3); |
2558 | 2558 |
2559 __ vinss(V4, 0, V0, 0); | 2559 __ vinss(V4, 0, V0, 0); |
2560 __ vinss(V4, 1, V1, 0); | 2560 __ vinss(V4, 1, V1, 0); |
2561 __ vinss(V4, 2, V2, 0); | 2561 __ vinss(V4, 2, V2, 0); |
2562 __ vinss(V4, 3, V3, 0); | 2562 __ vinss(V4, 3, V3, 0); |
(...skipping 17 matching lines...) Expand all Loading... |
2580 } | 2580 } |
2581 | 2581 |
2582 | 2582 |
2583 ASSEMBLER_TEST_RUN(Vdivs, test) { | 2583 ASSEMBLER_TEST_RUN(Vdivs, test) { |
2584 typedef double (*DoubleReturn)() DART_UNUSED; | 2584 typedef double (*DoubleReturn)() DART_UNUSED; |
2585 EXPECT_EQ(4.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); | 2585 EXPECT_EQ(4.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); |
2586 } | 2586 } |
2587 | 2587 |
2588 | 2588 |
2589 ASSEMBLER_TEST_GENERATE(Vaddd, assembler) { | 2589 ASSEMBLER_TEST_GENERATE(Vaddd, assembler) { |
2590 __ LoadDImmediate(V0, 2.0, kNoPP); | 2590 __ LoadDImmediate(V0, 2.0); |
2591 __ LoadDImmediate(V1, 3.0, kNoPP); | 2591 __ LoadDImmediate(V1, 3.0); |
2592 | 2592 |
2593 __ vinsd(V4, 0, V0, 0); | 2593 __ vinsd(V4, 0, V0, 0); |
2594 __ vinsd(V4, 1, V1, 0); | 2594 __ vinsd(V4, 1, V1, 0); |
2595 | 2595 |
2596 __ vaddd(V5, V4, V4); | 2596 __ vaddd(V5, V4, V4); |
2597 | 2597 |
2598 __ vinsd(V0, 0, V5, 0); | 2598 __ vinsd(V0, 0, V5, 0); |
2599 __ vinsd(V1, 0, V5, 1); | 2599 __ vinsd(V1, 0, V5, 1); |
2600 | 2600 |
2601 __ faddd(V0, V0, V1); | 2601 __ faddd(V0, V0, V1); |
2602 __ ret(); | 2602 __ ret(); |
2603 } | 2603 } |
2604 | 2604 |
2605 | 2605 |
2606 ASSEMBLER_TEST_RUN(Vaddd, test) { | 2606 ASSEMBLER_TEST_RUN(Vaddd, test) { |
2607 typedef double (*DoubleReturn)() DART_UNUSED; | 2607 typedef double (*DoubleReturn)() DART_UNUSED; |
2608 EXPECT_EQ(10.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); | 2608 EXPECT_EQ(10.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); |
2609 } | 2609 } |
2610 | 2610 |
2611 | 2611 |
2612 ASSEMBLER_TEST_GENERATE(Vsubd, assembler) { | 2612 ASSEMBLER_TEST_GENERATE(Vsubd, assembler) { |
2613 __ LoadDImmediate(V0, 2.0, kNoPP); | 2613 __ LoadDImmediate(V0, 2.0); |
2614 __ LoadDImmediate(V1, 3.0, kNoPP); | 2614 __ LoadDImmediate(V1, 3.0); |
2615 __ LoadDImmediate(V5, 0.0, kNoPP); | 2615 __ LoadDImmediate(V5, 0.0); |
2616 | 2616 |
2617 __ vinsd(V4, 0, V0, 0); | 2617 __ vinsd(V4, 0, V0, 0); |
2618 __ vinsd(V4, 1, V1, 0); | 2618 __ vinsd(V4, 1, V1, 0); |
2619 | 2619 |
2620 __ vsubd(V5, V5, V4); | 2620 __ vsubd(V5, V5, V4); |
2621 | 2621 |
2622 __ vinsd(V0, 0, V5, 0); | 2622 __ vinsd(V0, 0, V5, 0); |
2623 __ vinsd(V1, 0, V5, 1); | 2623 __ vinsd(V1, 0, V5, 1); |
2624 | 2624 |
2625 __ faddd(V0, V0, V1); | 2625 __ faddd(V0, V0, V1); |
2626 __ ret(); | 2626 __ ret(); |
2627 } | 2627 } |
2628 | 2628 |
2629 | 2629 |
2630 ASSEMBLER_TEST_RUN(Vsubd, test) { | 2630 ASSEMBLER_TEST_RUN(Vsubd, test) { |
2631 typedef double (*DoubleReturn)() DART_UNUSED; | 2631 typedef double (*DoubleReturn)() DART_UNUSED; |
2632 EXPECT_EQ(-5.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); | 2632 EXPECT_EQ(-5.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); |
2633 } | 2633 } |
2634 | 2634 |
2635 | 2635 |
2636 ASSEMBLER_TEST_GENERATE(Vmuld, assembler) { | 2636 ASSEMBLER_TEST_GENERATE(Vmuld, assembler) { |
2637 __ LoadDImmediate(V0, 2.0, kNoPP); | 2637 __ LoadDImmediate(V0, 2.0); |
2638 __ LoadDImmediate(V1, 3.0, kNoPP); | 2638 __ LoadDImmediate(V1, 3.0); |
2639 | 2639 |
2640 __ vinsd(V4, 0, V0, 0); | 2640 __ vinsd(V4, 0, V0, 0); |
2641 __ vinsd(V4, 1, V1, 0); | 2641 __ vinsd(V4, 1, V1, 0); |
2642 | 2642 |
2643 __ vmuld(V5, V4, V4); | 2643 __ vmuld(V5, V4, V4); |
2644 | 2644 |
2645 __ vinsd(V0, 0, V5, 0); | 2645 __ vinsd(V0, 0, V5, 0); |
2646 __ vinsd(V1, 0, V5, 1); | 2646 __ vinsd(V1, 0, V5, 1); |
2647 | 2647 |
2648 __ faddd(V0, V0, V1); | 2648 __ faddd(V0, V0, V1); |
2649 __ ret(); | 2649 __ ret(); |
2650 } | 2650 } |
2651 | 2651 |
2652 | 2652 |
2653 ASSEMBLER_TEST_RUN(Vmuld, test) { | 2653 ASSEMBLER_TEST_RUN(Vmuld, test) { |
2654 typedef double (*DoubleReturn)() DART_UNUSED; | 2654 typedef double (*DoubleReturn)() DART_UNUSED; |
2655 EXPECT_EQ(13.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); | 2655 EXPECT_EQ(13.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); |
2656 } | 2656 } |
2657 | 2657 |
2658 | 2658 |
2659 ASSEMBLER_TEST_GENERATE(Vdivd, assembler) { | 2659 ASSEMBLER_TEST_GENERATE(Vdivd, assembler) { |
2660 __ LoadDImmediate(V0, 2.0, kNoPP); | 2660 __ LoadDImmediate(V0, 2.0); |
2661 __ LoadDImmediate(V1, 3.0, kNoPP); | 2661 __ LoadDImmediate(V1, 3.0); |
2662 | 2662 |
2663 __ vinsd(V4, 0, V0, 0); | 2663 __ vinsd(V4, 0, V0, 0); |
2664 __ vinsd(V4, 1, V1, 0); | 2664 __ vinsd(V4, 1, V1, 0); |
2665 | 2665 |
2666 __ vdivd(V5, V4, V4); | 2666 __ vdivd(V5, V4, V4); |
2667 | 2667 |
2668 __ vinsd(V0, 0, V5, 0); | 2668 __ vinsd(V0, 0, V5, 0); |
2669 __ vinsd(V1, 0, V5, 1); | 2669 __ vinsd(V1, 0, V5, 1); |
2670 | 2670 |
2671 __ faddd(V0, V0, V1); | 2671 __ faddd(V0, V0, V1); |
2672 __ ret(); | 2672 __ ret(); |
2673 } | 2673 } |
2674 | 2674 |
2675 | 2675 |
2676 ASSEMBLER_TEST_RUN(Vdivd, test) { | 2676 ASSEMBLER_TEST_RUN(Vdivd, test) { |
2677 typedef double (*DoubleReturn)() DART_UNUSED; | 2677 typedef double (*DoubleReturn)() DART_UNUSED; |
2678 EXPECT_EQ(2.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); | 2678 EXPECT_EQ(2.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); |
2679 } | 2679 } |
2680 | 2680 |
2681 | 2681 |
2682 ASSEMBLER_TEST_GENERATE(Vdupd, assembler) { | 2682 ASSEMBLER_TEST_GENERATE(Vdupd, assembler) { |
2683 __ SetupDartSP(kTestStackSpace); | 2683 __ SetupDartSP(kTestStackSpace); |
2684 __ LoadDImmediate(V0, 21.0, kNoPP); | 2684 __ LoadDImmediate(V0, 21.0); |
2685 __ vdupd(V1, V0, 0); | 2685 __ vdupd(V1, V0, 0); |
2686 | 2686 |
2687 const int dword_bytes = 1 << Log2OperandSizeBytes(kDWord); | 2687 const int dword_bytes = 1 << Log2OperandSizeBytes(kDWord); |
2688 const int qword_bytes = 1 << Log2OperandSizeBytes(kQWord); | 2688 const int qword_bytes = 1 << Log2OperandSizeBytes(kQWord); |
2689 __ fstrq(V1, Address(SP, -1 * qword_bytes, Address::PreIndex)); | 2689 __ fstrq(V1, Address(SP, -1 * qword_bytes, Address::PreIndex)); |
2690 | 2690 |
2691 __ fldrd(V2, Address(SP, 1 * dword_bytes, Address::PostIndex)); | 2691 __ fldrd(V2, Address(SP, 1 * dword_bytes, Address::PostIndex)); |
2692 __ fldrd(V3, Address(SP, 1 * dword_bytes, Address::PostIndex)); | 2692 __ fldrd(V3, Address(SP, 1 * dword_bytes, Address::PostIndex)); |
2693 | 2693 |
2694 __ faddd(V0, V2, V3); | 2694 __ faddd(V0, V2, V3); |
2695 __ mov(CSP, SP); | 2695 __ mov(CSP, SP); |
2696 __ ret(); | 2696 __ ret(); |
2697 } | 2697 } |
2698 | 2698 |
2699 | 2699 |
2700 ASSEMBLER_TEST_RUN(Vdupd, test) { | 2700 ASSEMBLER_TEST_RUN(Vdupd, test) { |
2701 typedef double (*DoubleReturn)() DART_UNUSED; | 2701 typedef double (*DoubleReturn)() DART_UNUSED; |
2702 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); | 2702 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); |
2703 } | 2703 } |
2704 | 2704 |
2705 | 2705 |
2706 ASSEMBLER_TEST_GENERATE(Vdups, assembler) { | 2706 ASSEMBLER_TEST_GENERATE(Vdups, assembler) { |
2707 __ SetupDartSP(kTestStackSpace); | 2707 __ SetupDartSP(kTestStackSpace); |
2708 __ LoadDImmediate(V0, 21.0, kNoPP); | 2708 __ LoadDImmediate(V0, 21.0); |
2709 __ fcvtsd(V0, V0); | 2709 __ fcvtsd(V0, V0); |
2710 __ vdups(V1, V0, 0); | 2710 __ vdups(V1, V0, 0); |
2711 | 2711 |
2712 const int sword_bytes = 1 << Log2OperandSizeBytes(kSWord); | 2712 const int sword_bytes = 1 << Log2OperandSizeBytes(kSWord); |
2713 const int qword_bytes = 1 << Log2OperandSizeBytes(kQWord); | 2713 const int qword_bytes = 1 << Log2OperandSizeBytes(kQWord); |
2714 __ fstrq(V1, Address(SP, -1 * qword_bytes, Address::PreIndex)); | 2714 __ fstrq(V1, Address(SP, -1 * qword_bytes, Address::PreIndex)); |
2715 | 2715 |
2716 __ fldrs(V3, Address(SP, 1 * sword_bytes, Address::PostIndex)); | 2716 __ fldrs(V3, Address(SP, 1 * sword_bytes, Address::PostIndex)); |
2717 __ fldrs(V2, Address(SP, 1 * sword_bytes, Address::PostIndex)); | 2717 __ fldrs(V2, Address(SP, 1 * sword_bytes, Address::PostIndex)); |
2718 __ fldrs(V1, Address(SP, 1 * sword_bytes, Address::PostIndex)); | 2718 __ fldrs(V1, Address(SP, 1 * sword_bytes, Address::PostIndex)); |
(...skipping 13 matching lines...) Expand all Loading... |
2732 | 2732 |
2733 | 2733 |
2734 ASSEMBLER_TEST_RUN(Vdups, test) { | 2734 ASSEMBLER_TEST_RUN(Vdups, test) { |
2735 typedef double (*DoubleReturn)() DART_UNUSED; | 2735 typedef double (*DoubleReturn)() DART_UNUSED; |
2736 EXPECT_EQ(84.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); | 2736 EXPECT_EQ(84.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); |
2737 } | 2737 } |
2738 | 2738 |
2739 | 2739 |
2740 ASSEMBLER_TEST_GENERATE(Vinsd, assembler) { | 2740 ASSEMBLER_TEST_GENERATE(Vinsd, assembler) { |
2741 __ SetupDartSP(kTestStackSpace); | 2741 __ SetupDartSP(kTestStackSpace); |
2742 __ LoadDImmediate(V5, 42.0, kNoPP); | 2742 __ LoadDImmediate(V5, 42.0); |
2743 __ vinsd(V1, 1, V5, 0); // V1[1] <- V0[0]. | 2743 __ vinsd(V1, 1, V5, 0); // V1[1] <- V0[0]. |
2744 | 2744 |
2745 const int dword_bytes = 1 << Log2OperandSizeBytes(kDWord); | 2745 const int dword_bytes = 1 << Log2OperandSizeBytes(kDWord); |
2746 const int qword_bytes = 1 << Log2OperandSizeBytes(kQWord); | 2746 const int qword_bytes = 1 << Log2OperandSizeBytes(kQWord); |
2747 __ fstrq(V1, Address(SP, -1 * qword_bytes, Address::PreIndex)); | 2747 __ fstrq(V1, Address(SP, -1 * qword_bytes, Address::PreIndex)); |
2748 | 2748 |
2749 __ fldrd(V2, Address(SP, 1 * dword_bytes, Address::PostIndex)); | 2749 __ fldrd(V2, Address(SP, 1 * dword_bytes, Address::PostIndex)); |
2750 __ fldrd(V3, Address(SP, 1 * dword_bytes, Address::PostIndex)); | 2750 __ fldrd(V3, Address(SP, 1 * dword_bytes, Address::PostIndex)); |
2751 | 2751 |
2752 __ fmovdd(V0, V3); | 2752 __ fmovdd(V0, V3); |
2753 __ mov(CSP, SP); | 2753 __ mov(CSP, SP); |
2754 __ ret(); | 2754 __ ret(); |
2755 } | 2755 } |
2756 | 2756 |
2757 | 2757 |
2758 ASSEMBLER_TEST_RUN(Vinsd, test) { | 2758 ASSEMBLER_TEST_RUN(Vinsd, test) { |
2759 typedef double (*DoubleReturn)() DART_UNUSED; | 2759 typedef double (*DoubleReturn)() DART_UNUSED; |
2760 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); | 2760 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); |
2761 } | 2761 } |
2762 | 2762 |
2763 | 2763 |
2764 ASSEMBLER_TEST_GENERATE(Vinss, assembler) { | 2764 ASSEMBLER_TEST_GENERATE(Vinss, assembler) { |
2765 __ SetupDartSP(kTestStackSpace); | 2765 __ SetupDartSP(kTestStackSpace); |
2766 __ LoadDImmediate(V0, 21.0, kNoPP); | 2766 __ LoadDImmediate(V0, 21.0); |
2767 __ fcvtsd(V0, V0); | 2767 __ fcvtsd(V0, V0); |
2768 __ vinss(V1, 3, V0, 0); | 2768 __ vinss(V1, 3, V0, 0); |
2769 __ vinss(V1, 1, V0, 0); | 2769 __ vinss(V1, 1, V0, 0); |
2770 | 2770 |
2771 const int sword_bytes = 1 << Log2OperandSizeBytes(kSWord); | 2771 const int sword_bytes = 1 << Log2OperandSizeBytes(kSWord); |
2772 const int qword_bytes = 1 << Log2OperandSizeBytes(kQWord); | 2772 const int qword_bytes = 1 << Log2OperandSizeBytes(kQWord); |
2773 __ fstrq(V1, Address(SP, -1 * qword_bytes, Address::PreIndex)); | 2773 __ fstrq(V1, Address(SP, -1 * qword_bytes, Address::PreIndex)); |
2774 | 2774 |
2775 __ fldrs(V3, Address(SP, 1 * sword_bytes, Address::PostIndex)); | 2775 __ fldrs(V3, Address(SP, 1 * sword_bytes, Address::PostIndex)); |
2776 __ fldrs(V2, Address(SP, 1 * sword_bytes, Address::PostIndex)); | 2776 __ fldrs(V2, Address(SP, 1 * sword_bytes, Address::PostIndex)); |
(...skipping 13 matching lines...) Expand all Loading... |
2790 } | 2790 } |
2791 | 2791 |
2792 | 2792 |
2793 ASSEMBLER_TEST_RUN(Vinss, test) { | 2793 ASSEMBLER_TEST_RUN(Vinss, test) { |
2794 typedef double (*DoubleReturn)() DART_UNUSED; | 2794 typedef double (*DoubleReturn)() DART_UNUSED; |
2795 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); | 2795 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); |
2796 } | 2796 } |
2797 | 2797 |
2798 | 2798 |
2799 ASSEMBLER_TEST_GENERATE(Vand, assembler) { | 2799 ASSEMBLER_TEST_GENERATE(Vand, assembler) { |
2800 __ LoadDImmediate(V1, 21.0, kNoPP); | 2800 __ LoadDImmediate(V1, 21.0); |
2801 __ LoadImmediate(R0, 0xffffffff, kNoPP); | 2801 __ LoadImmediate(R0, 0xffffffff); |
2802 | 2802 |
2803 // V0 <- (0, 0xffffffff, 0, 0xffffffff) | 2803 // V0 <- (0, 0xffffffff, 0, 0xffffffff) |
2804 __ fmovdr(V0, R0); | 2804 __ fmovdr(V0, R0); |
2805 __ vinss(V0, 2, V0, 0); | 2805 __ vinss(V0, 2, V0, 0); |
2806 | 2806 |
2807 // V1 <- (21.0, 21.0, 21.0, 21.0) | 2807 // V1 <- (21.0, 21.0, 21.0, 21.0) |
2808 __ fcvtsd(V1, V1); | 2808 __ fcvtsd(V1, V1); |
2809 __ vdups(V1, V1, 0); | 2809 __ vdups(V1, V1, 0); |
2810 | 2810 |
2811 __ vand(V2, V1, V0); | 2811 __ vand(V2, V1, V0); |
(...skipping 15 matching lines...) Expand all Loading... |
2827 } | 2827 } |
2828 | 2828 |
2829 | 2829 |
2830 ASSEMBLER_TEST_RUN(Vand, test) { | 2830 ASSEMBLER_TEST_RUN(Vand, test) { |
2831 typedef double (*DoubleReturn)() DART_UNUSED; | 2831 typedef double (*DoubleReturn)() DART_UNUSED; |
2832 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); | 2832 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); |
2833 } | 2833 } |
2834 | 2834 |
2835 | 2835 |
2836 ASSEMBLER_TEST_GENERATE(Vorr, assembler) { | 2836 ASSEMBLER_TEST_GENERATE(Vorr, assembler) { |
2837 __ LoadDImmediate(V1, 10.5, kNoPP); | 2837 __ LoadDImmediate(V1, 10.5); |
2838 __ fcvtsd(V1, V1); | 2838 __ fcvtsd(V1, V1); |
2839 | 2839 |
2840 // V0 <- (0, 10.5, 0, 10.5) | 2840 // V0 <- (0, 10.5, 0, 10.5) |
2841 __ fmovdd(V0, V1); | 2841 __ fmovdd(V0, V1); |
2842 __ vinss(V0, 2, V0, 0); | 2842 __ vinss(V0, 2, V0, 0); |
2843 | 2843 |
2844 // V1 <- (10.5, 0, 10.5, 0) | 2844 // V1 <- (10.5, 0, 10.5, 0) |
2845 __ veor(V1, V1, V1); | 2845 __ veor(V1, V1, V1); |
2846 __ vinss(V1, 1, V0, 0); | 2846 __ vinss(V1, 1, V0, 0); |
2847 __ vinss(V1, 3, V0, 0); | 2847 __ vinss(V1, 3, V0, 0); |
(...skipping 17 matching lines...) Expand all Loading... |
2865 } | 2865 } |
2866 | 2866 |
2867 | 2867 |
2868 ASSEMBLER_TEST_RUN(Vorr, test) { | 2868 ASSEMBLER_TEST_RUN(Vorr, test) { |
2869 typedef double (*DoubleReturn)() DART_UNUSED; | 2869 typedef double (*DoubleReturn)() DART_UNUSED; |
2870 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); | 2870 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); |
2871 } | 2871 } |
2872 | 2872 |
2873 | 2873 |
2874 ASSEMBLER_TEST_GENERATE(Veor, assembler) { | 2874 ASSEMBLER_TEST_GENERATE(Veor, assembler) { |
2875 __ LoadImmediate(R1, 0xffffffff, kNoPP); | 2875 __ LoadImmediate(R1, 0xffffffff); |
2876 __ LoadImmediate(R2, ~21, kNoPP); | 2876 __ LoadImmediate(R2, ~21); |
2877 | 2877 |
2878 __ vinsw(V1, 0, R1); | 2878 __ vinsw(V1, 0, R1); |
2879 __ vinsw(V1, 1, R2); | 2879 __ vinsw(V1, 1, R2); |
2880 __ vinsw(V1, 2, R1); | 2880 __ vinsw(V1, 2, R1); |
2881 __ vinsw(V1, 3, R2); | 2881 __ vinsw(V1, 3, R2); |
2882 | 2882 |
2883 __ vinsw(V2, 0, R1); | 2883 __ vinsw(V2, 0, R1); |
2884 __ vinsw(V2, 1, R1); | 2884 __ vinsw(V2, 1, R1); |
2885 __ vinsw(V2, 2, R1); | 2885 __ vinsw(V2, 2, R1); |
2886 __ vinsw(V2, 3, R1); | 2886 __ vinsw(V2, 3, R1); |
(...skipping 12 matching lines...) Expand all Loading... |
2899 } | 2899 } |
2900 | 2900 |
2901 | 2901 |
2902 ASSEMBLER_TEST_RUN(Veor, test) { | 2902 ASSEMBLER_TEST_RUN(Veor, test) { |
2903 typedef int64_t (*Int64Return)() DART_UNUSED; | 2903 typedef int64_t (*Int64Return)() DART_UNUSED; |
2904 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); | 2904 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
2905 } | 2905 } |
2906 | 2906 |
2907 | 2907 |
2908 ASSEMBLER_TEST_GENERATE(Vaddw, assembler) { | 2908 ASSEMBLER_TEST_GENERATE(Vaddw, assembler) { |
2909 __ LoadImmediate(R4, 21, kNoPP); | 2909 __ LoadImmediate(R4, 21); |
2910 | 2910 |
2911 __ vdupw(V1, R4); | 2911 __ vdupw(V1, R4); |
2912 __ vdupw(V2, R4); | 2912 __ vdupw(V2, R4); |
2913 | 2913 |
2914 __ vaddw(V0, V1, V2); | 2914 __ vaddw(V0, V1, V2); |
2915 | 2915 |
2916 __ vmovrs(R0, V0, 0); | 2916 __ vmovrs(R0, V0, 0); |
2917 __ vmovrs(R1, V0, 1); | 2917 __ vmovrs(R1, V0, 1); |
2918 __ vmovrs(R2, V0, 2); | 2918 __ vmovrs(R2, V0, 2); |
2919 __ vmovrs(R3, V0, 3); | 2919 __ vmovrs(R3, V0, 3); |
2920 __ add(R0, R0, Operand(R1)); | 2920 __ add(R0, R0, Operand(R1)); |
2921 __ add(R0, R0, Operand(R2)); | 2921 __ add(R0, R0, Operand(R2)); |
2922 __ add(R0, R0, Operand(R3)); | 2922 __ add(R0, R0, Operand(R3)); |
2923 __ ret(); | 2923 __ ret(); |
2924 } | 2924 } |
2925 | 2925 |
2926 | 2926 |
2927 ASSEMBLER_TEST_RUN(Vaddw, test) { | 2927 ASSEMBLER_TEST_RUN(Vaddw, test) { |
2928 typedef int64_t (*Int64Return)() DART_UNUSED; | 2928 typedef int64_t (*Int64Return)() DART_UNUSED; |
2929 EXPECT_EQ(168, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); | 2929 EXPECT_EQ(168, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
2930 } | 2930 } |
2931 | 2931 |
2932 | 2932 |
2933 ASSEMBLER_TEST_GENERATE(Vsubw, assembler) { | 2933 ASSEMBLER_TEST_GENERATE(Vsubw, assembler) { |
2934 __ LoadImmediate(R4, 31, kNoPP); | 2934 __ LoadImmediate(R4, 31); |
2935 __ LoadImmediate(R5, 10, kNoPP); | 2935 __ LoadImmediate(R5, 10); |
2936 | 2936 |
2937 __ vdupw(V1, R4); | 2937 __ vdupw(V1, R4); |
2938 __ vdupw(V2, R5); | 2938 __ vdupw(V2, R5); |
2939 | 2939 |
2940 __ vsubw(V0, V1, V2); | 2940 __ vsubw(V0, V1, V2); |
2941 | 2941 |
2942 __ vmovrs(R0, V0, 0); | 2942 __ vmovrs(R0, V0, 0); |
2943 __ vmovrs(R1, V0, 1); | 2943 __ vmovrs(R1, V0, 1); |
2944 __ vmovrs(R2, V0, 2); | 2944 __ vmovrs(R2, V0, 2); |
2945 __ vmovrs(R3, V0, 3); | 2945 __ vmovrs(R3, V0, 3); |
2946 __ add(R0, R0, Operand(R1)); | 2946 __ add(R0, R0, Operand(R1)); |
2947 __ add(R0, R0, Operand(R2)); | 2947 __ add(R0, R0, Operand(R2)); |
2948 __ add(R0, R0, Operand(R3)); | 2948 __ add(R0, R0, Operand(R3)); |
2949 __ ret(); | 2949 __ ret(); |
2950 } | 2950 } |
2951 | 2951 |
2952 | 2952 |
2953 ASSEMBLER_TEST_RUN(Vsubw, test) { | 2953 ASSEMBLER_TEST_RUN(Vsubw, test) { |
2954 typedef int64_t (*Int64Return)() DART_UNUSED; | 2954 typedef int64_t (*Int64Return)() DART_UNUSED; |
2955 EXPECT_EQ(84, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); | 2955 EXPECT_EQ(84, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
2956 } | 2956 } |
2957 | 2957 |
2958 | 2958 |
2959 ASSEMBLER_TEST_GENERATE(Vaddx, assembler) { | 2959 ASSEMBLER_TEST_GENERATE(Vaddx, assembler) { |
2960 __ LoadImmediate(R4, 21, kNoPP); | 2960 __ LoadImmediate(R4, 21); |
2961 | 2961 |
2962 __ vdupx(V1, R4); | 2962 __ vdupx(V1, R4); |
2963 __ vdupx(V2, R4); | 2963 __ vdupx(V2, R4); |
2964 | 2964 |
2965 __ vaddx(V0, V1, V2); | 2965 __ vaddx(V0, V1, V2); |
2966 | 2966 |
2967 __ vmovrd(R0, V0, 0); | 2967 __ vmovrd(R0, V0, 0); |
2968 __ vmovrd(R1, V0, 1); | 2968 __ vmovrd(R1, V0, 1); |
2969 __ add(R0, R0, Operand(R1)); | 2969 __ add(R0, R0, Operand(R1)); |
2970 __ ret(); | 2970 __ ret(); |
2971 } | 2971 } |
2972 | 2972 |
2973 | 2973 |
2974 ASSEMBLER_TEST_RUN(Vaddx, test) { | 2974 ASSEMBLER_TEST_RUN(Vaddx, test) { |
2975 typedef int64_t (*Int64Return)() DART_UNUSED; | 2975 typedef int64_t (*Int64Return)() DART_UNUSED; |
2976 EXPECT_EQ(84, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); | 2976 EXPECT_EQ(84, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
2977 } | 2977 } |
2978 | 2978 |
2979 | 2979 |
2980 ASSEMBLER_TEST_GENERATE(Vsubx, assembler) { | 2980 ASSEMBLER_TEST_GENERATE(Vsubx, assembler) { |
2981 __ LoadImmediate(R4, 31, kNoPP); | 2981 __ LoadImmediate(R4, 31); |
2982 __ LoadImmediate(R5, 10, kNoPP); | 2982 __ LoadImmediate(R5, 10); |
2983 | 2983 |
2984 __ vdupx(V1, R4); | 2984 __ vdupx(V1, R4); |
2985 __ vdupx(V2, R5); | 2985 __ vdupx(V2, R5); |
2986 | 2986 |
2987 __ vsubx(V0, V1, V2); | 2987 __ vsubx(V0, V1, V2); |
2988 | 2988 |
2989 __ vmovrd(R0, V0, 0); | 2989 __ vmovrd(R0, V0, 0); |
2990 __ vmovrd(R1, V0, 1); | 2990 __ vmovrd(R1, V0, 1); |
2991 __ add(R0, R0, Operand(R1)); | 2991 __ add(R0, R0, Operand(R1)); |
2992 __ ret(); | 2992 __ ret(); |
2993 } | 2993 } |
2994 | 2994 |
2995 | 2995 |
2996 ASSEMBLER_TEST_RUN(Vsubx, test) { | 2996 ASSEMBLER_TEST_RUN(Vsubx, test) { |
2997 typedef int64_t (*Int64Return)() DART_UNUSED; | 2997 typedef int64_t (*Int64Return)() DART_UNUSED; |
2998 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); | 2998 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
2999 } | 2999 } |
3000 | 3000 |
3001 | 3001 |
3002 ASSEMBLER_TEST_GENERATE(Vceqs, assembler) { | 3002 ASSEMBLER_TEST_GENERATE(Vceqs, assembler) { |
3003 __ LoadDImmediate(V0, 42.0, kNoPP); | 3003 __ LoadDImmediate(V0, 42.0); |
3004 __ LoadDImmediate(V1, -42.0, kNoPP); | 3004 __ LoadDImmediate(V1, -42.0); |
3005 | 3005 |
3006 __ fcvtsd(V0, V0); | 3006 __ fcvtsd(V0, V0); |
3007 __ fcvtsd(V1, V1); | 3007 __ fcvtsd(V1, V1); |
3008 | 3008 |
3009 __ vdups(V2, V0, 0); | 3009 __ vdups(V2, V0, 0); |
3010 __ vinss(V3, 0, V0, 0); | 3010 __ vinss(V3, 0, V0, 0); |
3011 __ vinss(V3, 1, V1, 0); | 3011 __ vinss(V3, 1, V1, 0); |
3012 __ vinss(V3, 2, V0, 0); | 3012 __ vinss(V3, 2, V0, 0); |
3013 __ vinss(V3, 3, V1, 0); | 3013 __ vinss(V3, 3, V1, 0); |
3014 | 3014 |
(...skipping 11 matching lines...) Expand all Loading... |
3026 } | 3026 } |
3027 | 3027 |
3028 | 3028 |
3029 ASSEMBLER_TEST_RUN(Vceqs, test) { | 3029 ASSEMBLER_TEST_RUN(Vceqs, test) { |
3030 typedef int64_t (*Int64Return)() DART_UNUSED; | 3030 typedef int64_t (*Int64Return)() DART_UNUSED; |
3031 EXPECT_EQ(0xfffffffe, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); | 3031 EXPECT_EQ(0xfffffffe, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
3032 } | 3032 } |
3033 | 3033 |
3034 | 3034 |
3035 ASSEMBLER_TEST_GENERATE(Vceqd, assembler) { | 3035 ASSEMBLER_TEST_GENERATE(Vceqd, assembler) { |
3036 __ LoadDImmediate(V0, 42.0, kNoPP); | 3036 __ LoadDImmediate(V0, 42.0); |
3037 __ LoadDImmediate(V1, -42.0, kNoPP); | 3037 __ LoadDImmediate(V1, -42.0); |
3038 | 3038 |
3039 __ vdupd(V2, V0, 0); | 3039 __ vdupd(V2, V0, 0); |
3040 __ vinsd(V3, 0, V0, 0); | 3040 __ vinsd(V3, 0, V0, 0); |
3041 __ vinsd(V3, 1, V1, 0); | 3041 __ vinsd(V3, 1, V1, 0); |
3042 | 3042 |
3043 __ vceqd(V4, V2, V3); | 3043 __ vceqd(V4, V2, V3); |
3044 | 3044 |
3045 __ vmovrd(R1, V4, 0); | 3045 __ vmovrd(R1, V4, 0); |
3046 __ vmovrd(R2, V4, 1); | 3046 __ vmovrd(R2, V4, 1); |
3047 | 3047 |
3048 __ add(R0, R1, Operand(R2)); | 3048 __ add(R0, R1, Operand(R2)); |
3049 __ ret(); | 3049 __ ret(); |
3050 } | 3050 } |
3051 | 3051 |
3052 | 3052 |
3053 ASSEMBLER_TEST_RUN(Vceqd, test) { | 3053 ASSEMBLER_TEST_RUN(Vceqd, test) { |
3054 typedef int64_t (*Int64Return)() DART_UNUSED; | 3054 typedef int64_t (*Int64Return)() DART_UNUSED; |
3055 EXPECT_EQ(-1, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); | 3055 EXPECT_EQ(-1, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
3056 } | 3056 } |
3057 | 3057 |
3058 | 3058 |
3059 ASSEMBLER_TEST_GENERATE(Vcgts, assembler) { | 3059 ASSEMBLER_TEST_GENERATE(Vcgts, assembler) { |
3060 __ LoadDImmediate(V0, 42.0, kNoPP); | 3060 __ LoadDImmediate(V0, 42.0); |
3061 __ LoadDImmediate(V1, -42.0, kNoPP); | 3061 __ LoadDImmediate(V1, -42.0); |
3062 | 3062 |
3063 __ fcvtsd(V0, V0); | 3063 __ fcvtsd(V0, V0); |
3064 __ fcvtsd(V1, V1); | 3064 __ fcvtsd(V1, V1); |
3065 | 3065 |
3066 __ vdups(V2, V0, 0); | 3066 __ vdups(V2, V0, 0); |
3067 __ vinss(V3, 0, V0, 0); | 3067 __ vinss(V3, 0, V0, 0); |
3068 __ vinss(V3, 1, V1, 0); | 3068 __ vinss(V3, 1, V1, 0); |
3069 __ vinss(V3, 2, V0, 0); | 3069 __ vinss(V3, 2, V0, 0); |
3070 __ vinss(V3, 3, V1, 0); | 3070 __ vinss(V3, 3, V1, 0); |
3071 | 3071 |
(...skipping 11 matching lines...) Expand all Loading... |
3083 } | 3083 } |
3084 | 3084 |
3085 | 3085 |
3086 ASSEMBLER_TEST_RUN(Vcgts, test) { | 3086 ASSEMBLER_TEST_RUN(Vcgts, test) { |
3087 typedef int64_t (*Int64Return)() DART_UNUSED; | 3087 typedef int64_t (*Int64Return)() DART_UNUSED; |
3088 EXPECT_EQ(0xfffffffe, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); | 3088 EXPECT_EQ(0xfffffffe, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
3089 } | 3089 } |
3090 | 3090 |
3091 | 3091 |
3092 ASSEMBLER_TEST_GENERATE(Vcgtd, assembler) { | 3092 ASSEMBLER_TEST_GENERATE(Vcgtd, assembler) { |
3093 __ LoadDImmediate(V0, 42.0, kNoPP); | 3093 __ LoadDImmediate(V0, 42.0); |
3094 __ LoadDImmediate(V1, -42.0, kNoPP); | 3094 __ LoadDImmediate(V1, -42.0); |
3095 | 3095 |
3096 __ vdupd(V2, V0, 0); | 3096 __ vdupd(V2, V0, 0); |
3097 __ vinsd(V3, 0, V0, 0); | 3097 __ vinsd(V3, 0, V0, 0); |
3098 __ vinsd(V3, 1, V1, 0); | 3098 __ vinsd(V3, 1, V1, 0); |
3099 | 3099 |
3100 __ vcgtd(V4, V2, V3); | 3100 __ vcgtd(V4, V2, V3); |
3101 | 3101 |
3102 __ vmovrd(R1, V4, 0); | 3102 __ vmovrd(R1, V4, 0); |
3103 __ vmovrd(R2, V4, 1); | 3103 __ vmovrd(R2, V4, 1); |
3104 | 3104 |
3105 __ add(R0, R1, Operand(R2)); | 3105 __ add(R0, R1, Operand(R2)); |
3106 __ ret(); | 3106 __ ret(); |
3107 } | 3107 } |
3108 | 3108 |
3109 | 3109 |
3110 ASSEMBLER_TEST_RUN(Vcgtd, test) { | 3110 ASSEMBLER_TEST_RUN(Vcgtd, test) { |
3111 typedef int64_t (*Int64Return)() DART_UNUSED; | 3111 typedef int64_t (*Int64Return)() DART_UNUSED; |
3112 EXPECT_EQ(-1, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); | 3112 EXPECT_EQ(-1, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
3113 } | 3113 } |
3114 | 3114 |
3115 | 3115 |
3116 ASSEMBLER_TEST_GENERATE(Vcges, assembler) { | 3116 ASSEMBLER_TEST_GENERATE(Vcges, assembler) { |
3117 __ LoadDImmediate(V0, 42.0, kNoPP); | 3117 __ LoadDImmediate(V0, 42.0); |
3118 __ LoadDImmediate(V1, 43.0, kNoPP); | 3118 __ LoadDImmediate(V1, 43.0); |
3119 | 3119 |
3120 __ fcvtsd(V0, V0); | 3120 __ fcvtsd(V0, V0); |
3121 __ fcvtsd(V1, V1); | 3121 __ fcvtsd(V1, V1); |
3122 | 3122 |
3123 __ vdups(V2, V0, 0); | 3123 __ vdups(V2, V0, 0); |
3124 __ vinss(V3, 0, V0, 0); | 3124 __ vinss(V3, 0, V0, 0); |
3125 __ vinss(V3, 1, V1, 0); | 3125 __ vinss(V3, 1, V1, 0); |
3126 __ vinss(V3, 2, V0, 0); | 3126 __ vinss(V3, 2, V0, 0); |
3127 __ vinss(V3, 3, V1, 0); | 3127 __ vinss(V3, 3, V1, 0); |
3128 | 3128 |
(...skipping 11 matching lines...) Expand all Loading... |
3140 } | 3140 } |
3141 | 3141 |
3142 | 3142 |
3143 ASSEMBLER_TEST_RUN(Vcges, test) { | 3143 ASSEMBLER_TEST_RUN(Vcges, test) { |
3144 typedef int64_t (*Int64Return)() DART_UNUSED; | 3144 typedef int64_t (*Int64Return)() DART_UNUSED; |
3145 EXPECT_EQ(0xfffffffe, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); | 3145 EXPECT_EQ(0xfffffffe, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
3146 } | 3146 } |
3147 | 3147 |
3148 | 3148 |
3149 ASSEMBLER_TEST_GENERATE(Vcged, assembler) { | 3149 ASSEMBLER_TEST_GENERATE(Vcged, assembler) { |
3150 __ LoadDImmediate(V0, 42.0, kNoPP); | 3150 __ LoadDImmediate(V0, 42.0); |
3151 __ LoadDImmediate(V1, 43.0, kNoPP); | 3151 __ LoadDImmediate(V1, 43.0); |
3152 | 3152 |
3153 __ vdupd(V2, V0, 0); | 3153 __ vdupd(V2, V0, 0); |
3154 __ vinsd(V3, 0, V0, 0); | 3154 __ vinsd(V3, 0, V0, 0); |
3155 __ vinsd(V3, 1, V1, 0); | 3155 __ vinsd(V3, 1, V1, 0); |
3156 | 3156 |
3157 __ vcged(V4, V2, V3); | 3157 __ vcged(V4, V2, V3); |
3158 | 3158 |
3159 __ vmovrd(R1, V4, 0); | 3159 __ vmovrd(R1, V4, 0); |
3160 __ vmovrd(R2, V4, 1); | 3160 __ vmovrd(R2, V4, 1); |
3161 | 3161 |
3162 __ add(R0, R1, Operand(R2)); | 3162 __ add(R0, R1, Operand(R2)); |
3163 __ ret(); | 3163 __ ret(); |
3164 } | 3164 } |
3165 | 3165 |
3166 | 3166 |
3167 ASSEMBLER_TEST_RUN(Vcged, test) { | 3167 ASSEMBLER_TEST_RUN(Vcged, test) { |
3168 typedef int64_t (*Int64Return)() DART_UNUSED; | 3168 typedef int64_t (*Int64Return)() DART_UNUSED; |
3169 EXPECT_EQ(-1, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); | 3169 EXPECT_EQ(-1, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
3170 } | 3170 } |
3171 | 3171 |
3172 | 3172 |
3173 ASSEMBLER_TEST_GENERATE(Vmaxs, assembler) { | 3173 ASSEMBLER_TEST_GENERATE(Vmaxs, assembler) { |
3174 __ LoadDImmediate(V0, 10.5, kNoPP); | 3174 __ LoadDImmediate(V0, 10.5); |
3175 __ LoadDImmediate(V1, 10.0, kNoPP); | 3175 __ LoadDImmediate(V1, 10.0); |
3176 | 3176 |
3177 __ fcvtsd(V0, V0); | 3177 __ fcvtsd(V0, V0); |
3178 __ fcvtsd(V1, V1); | 3178 __ fcvtsd(V1, V1); |
3179 | 3179 |
3180 __ vdups(V2, V0, 0); | 3180 __ vdups(V2, V0, 0); |
3181 __ vinss(V3, 0, V0, 0); | 3181 __ vinss(V3, 0, V0, 0); |
3182 __ vinss(V3, 1, V1, 0); | 3182 __ vinss(V3, 1, V1, 0); |
3183 __ vinss(V3, 2, V0, 0); | 3183 __ vinss(V3, 2, V0, 0); |
3184 __ vinss(V3, 3, V1, 0); | 3184 __ vinss(V3, 3, V1, 0); |
3185 | 3185 |
(...skipping 16 matching lines...) Expand all Loading... |
3202 } | 3202 } |
3203 | 3203 |
3204 | 3204 |
3205 ASSEMBLER_TEST_RUN(Vmaxs, test) { | 3205 ASSEMBLER_TEST_RUN(Vmaxs, test) { |
3206 typedef double (*DoubleReturn)() DART_UNUSED; | 3206 typedef double (*DoubleReturn)() DART_UNUSED; |
3207 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); | 3207 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); |
3208 } | 3208 } |
3209 | 3209 |
3210 | 3210 |
3211 ASSEMBLER_TEST_GENERATE(Vmaxd, assembler) { | 3211 ASSEMBLER_TEST_GENERATE(Vmaxd, assembler) { |
3212 __ LoadDImmediate(V0, 21.0, kNoPP); | 3212 __ LoadDImmediate(V0, 21.0); |
3213 __ LoadDImmediate(V1, 20.5, kNoPP); | 3213 __ LoadDImmediate(V1, 20.5); |
3214 | 3214 |
3215 __ vdupd(V2, V0, 0); | 3215 __ vdupd(V2, V0, 0); |
3216 __ vinsd(V3, 0, V0, 0); | 3216 __ vinsd(V3, 0, V0, 0); |
3217 __ vinsd(V3, 1, V1, 0); | 3217 __ vinsd(V3, 1, V1, 0); |
3218 | 3218 |
3219 __ vmaxd(V4, V2, V3); | 3219 __ vmaxd(V4, V2, V3); |
3220 | 3220 |
3221 __ vinsd(V0, 0, V4, 0); | 3221 __ vinsd(V0, 0, V4, 0); |
3222 __ vinsd(V1, 0, V4, 1); | 3222 __ vinsd(V1, 0, V4, 1); |
3223 | 3223 |
3224 __ faddd(V0, V0, V1); | 3224 __ faddd(V0, V0, V1); |
3225 __ ret(); | 3225 __ ret(); |
3226 } | 3226 } |
3227 | 3227 |
3228 | 3228 |
3229 ASSEMBLER_TEST_RUN(Vmaxd, test) { | 3229 ASSEMBLER_TEST_RUN(Vmaxd, test) { |
3230 typedef double (*DoubleReturn)() DART_UNUSED; | 3230 typedef double (*DoubleReturn)() DART_UNUSED; |
3231 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); | 3231 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); |
3232 } | 3232 } |
3233 | 3233 |
3234 | 3234 |
3235 ASSEMBLER_TEST_GENERATE(Vmins, assembler) { | 3235 ASSEMBLER_TEST_GENERATE(Vmins, assembler) { |
3236 __ LoadDImmediate(V0, 10.5, kNoPP); | 3236 __ LoadDImmediate(V0, 10.5); |
3237 __ LoadDImmediate(V1, 11.0, kNoPP); | 3237 __ LoadDImmediate(V1, 11.0); |
3238 | 3238 |
3239 __ fcvtsd(V0, V0); | 3239 __ fcvtsd(V0, V0); |
3240 __ fcvtsd(V1, V1); | 3240 __ fcvtsd(V1, V1); |
3241 | 3241 |
3242 __ vdups(V2, V0, 0); | 3242 __ vdups(V2, V0, 0); |
3243 __ vinss(V3, 0, V0, 0); | 3243 __ vinss(V3, 0, V0, 0); |
3244 __ vinss(V3, 1, V1, 0); | 3244 __ vinss(V3, 1, V1, 0); |
3245 __ vinss(V3, 2, V0, 0); | 3245 __ vinss(V3, 2, V0, 0); |
3246 __ vinss(V3, 3, V1, 0); | 3246 __ vinss(V3, 3, V1, 0); |
3247 | 3247 |
(...skipping 16 matching lines...) Expand all Loading... |
3264 } | 3264 } |
3265 | 3265 |
3266 | 3266 |
3267 ASSEMBLER_TEST_RUN(Vmins, test) { | 3267 ASSEMBLER_TEST_RUN(Vmins, test) { |
3268 typedef double (*DoubleReturn)() DART_UNUSED; | 3268 typedef double (*DoubleReturn)() DART_UNUSED; |
3269 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); | 3269 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); |
3270 } | 3270 } |
3271 | 3271 |
3272 | 3272 |
3273 ASSEMBLER_TEST_GENERATE(Vmind, assembler) { | 3273 ASSEMBLER_TEST_GENERATE(Vmind, assembler) { |
3274 __ LoadDImmediate(V0, 21.0, kNoPP); | 3274 __ LoadDImmediate(V0, 21.0); |
3275 __ LoadDImmediate(V1, 21.5, kNoPP); | 3275 __ LoadDImmediate(V1, 21.5); |
3276 | 3276 |
3277 __ vdupd(V2, V0, 0); | 3277 __ vdupd(V2, V0, 0); |
3278 __ vinsd(V3, 0, V0, 0); | 3278 __ vinsd(V3, 0, V0, 0); |
3279 __ vinsd(V3, 1, V1, 0); | 3279 __ vinsd(V3, 1, V1, 0); |
3280 | 3280 |
3281 __ vmind(V4, V2, V3); | 3281 __ vmind(V4, V2, V3); |
3282 | 3282 |
3283 __ vinsd(V0, 0, V4, 0); | 3283 __ vinsd(V0, 0, V4, 0); |
3284 __ vinsd(V1, 0, V4, 1); | 3284 __ vinsd(V1, 0, V4, 1); |
3285 | 3285 |
3286 __ faddd(V0, V0, V1); | 3286 __ faddd(V0, V0, V1); |
3287 __ ret(); | 3287 __ ret(); |
3288 } | 3288 } |
3289 | 3289 |
3290 | 3290 |
3291 ASSEMBLER_TEST_RUN(Vmind, test) { | 3291 ASSEMBLER_TEST_RUN(Vmind, test) { |
3292 typedef double (*DoubleReturn)() DART_UNUSED; | 3292 typedef double (*DoubleReturn)() DART_UNUSED; |
3293 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); | 3293 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); |
3294 } | 3294 } |
3295 | 3295 |
3296 | 3296 |
3297 ASSEMBLER_TEST_GENERATE(Vsqrts, assembler) { | 3297 ASSEMBLER_TEST_GENERATE(Vsqrts, assembler) { |
3298 __ LoadDImmediate(V0, 64.0, kNoPP); | 3298 __ LoadDImmediate(V0, 64.0); |
3299 __ LoadDImmediate(V1, 49.0, kNoPP); | 3299 __ LoadDImmediate(V1, 49.0); |
3300 | 3300 |
3301 __ fcvtsd(V0, V0); | 3301 __ fcvtsd(V0, V0); |
3302 __ fcvtsd(V1, V1); | 3302 __ fcvtsd(V1, V1); |
3303 | 3303 |
3304 __ veor(V3, V3, V3); | 3304 __ veor(V3, V3, V3); |
3305 __ vinss(V3, 1, V0, 0); | 3305 __ vinss(V3, 1, V0, 0); |
3306 __ vinss(V3, 3, V1, 0); | 3306 __ vinss(V3, 3, V1, 0); |
3307 | 3307 |
3308 __ vsqrts(V4, V3); | 3308 __ vsqrts(V4, V3); |
3309 | 3309 |
3310 __ vinss(V5, 0, V4, 1); | 3310 __ vinss(V5, 0, V4, 1); |
3311 __ vinss(V6, 0, V4, 3); | 3311 __ vinss(V6, 0, V4, 3); |
3312 | 3312 |
3313 __ fcvtds(V5, V5); | 3313 __ fcvtds(V5, V5); |
3314 __ fcvtds(V6, V6); | 3314 __ fcvtds(V6, V6); |
3315 | 3315 |
3316 __ faddd(V0, V5, V6); | 3316 __ faddd(V0, V5, V6); |
3317 __ ret(); | 3317 __ ret(); |
3318 } | 3318 } |
3319 | 3319 |
3320 | 3320 |
3321 ASSEMBLER_TEST_RUN(Vsqrts, test) { | 3321 ASSEMBLER_TEST_RUN(Vsqrts, test) { |
3322 typedef double (*DoubleReturn)() DART_UNUSED; | 3322 typedef double (*DoubleReturn)() DART_UNUSED; |
3323 EXPECT_EQ(15.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); | 3323 EXPECT_EQ(15.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry())); |
3324 } | 3324 } |
3325 | 3325 |
3326 | 3326 |
3327 ASSEMBLER_TEST_GENERATE(Vsqrtd, assembler) { | 3327 ASSEMBLER_TEST_GENERATE(Vsqrtd, assembler) { |
3328 __ LoadDImmediate(V0, 64.0, kNoPP); | 3328 __ LoadDImmediate(V0, 64.0); |
3329 __ LoadDImmediate(V1, 49.0, kNoPP); | 3329 __ LoadDImmediate(V1, 49.0); |
3330 | 3330 |
3331 __ vinsd(V3, 0, V0, 0); | 3331 __ vinsd(V3, 0, V0, 0); |
3332 __ vinsd(V3, 1, V1, 0); | 3332 __ vinsd(V3, 1, V1, 0); |
3333 | 3333 |
3334 __ vsqrtd(V4, V3); | 3334 __ vsqrtd(V4, V3); |
3335 | 3335 |
3336 __ vinsd(V5, 0, V4, 0); | 3336 __ vinsd(V5, 0, V4, 0); |
3337 __ vinsd(V6, 0, V4, 1); | 3337 __ vinsd(V6, 0, V4, 1); |
3338 | 3338 |
3339 __ faddd(V0, V5, V6); | 3339 __ faddd(V0, V5, V6); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3376 | 3376 |
3377 // result = sign : result_exp<7:0> : estimate<51:29> | 3377 // result = sign : result_exp<7:0> : estimate<51:29> |
3378 int32_t result_bits = | 3378 int32_t result_bits = |
3379 (a_bits & 0x80000000) | ((result_exp & 0xff) << 23) | | 3379 (a_bits & 0x80000000) | ((result_exp & 0xff) << 23) | |
3380 ((bit_cast<uint64_t, double>(estimate) >> 29) & 0x7fffff); | 3380 ((bit_cast<uint64_t, double>(estimate) >> 29) & 0x7fffff); |
3381 return bit_cast<float, int32_t>(result_bits); | 3381 return bit_cast<float, int32_t>(result_bits); |
3382 } | 3382 } |
3383 | 3383 |
3384 | 3384 |
3385 ASSEMBLER_TEST_GENERATE(Vrecpes, assembler) { | 3385 ASSEMBLER_TEST_GENERATE(Vrecpes, assembler) { |
3386 __ LoadDImmediate(V1, 147.0, kNoPP); | 3386 __ LoadDImmediate(V1, 147.0); |
3387 __ fcvtsd(V1, V1); | 3387 __ fcvtsd(V1, V1); |
3388 __ vinss(V2, 0, V1, 0); | 3388 __ vinss(V2, 0, V1, 0); |
3389 __ vinss(V2, 1, V1, 0); | 3389 __ vinss(V2, 1, V1, 0); |
3390 __ vinss(V2, 2, V1, 0); | 3390 __ vinss(V2, 2, V1, 0); |
3391 __ vinss(V2, 3, V1, 0); | 3391 __ vinss(V2, 3, V1, 0); |
3392 __ vrecpes(V0, V2); | 3392 __ vrecpes(V0, V2); |
3393 __ fcvtds(V0, V0); | 3393 __ fcvtds(V0, V0); |
3394 __ ret(); | 3394 __ ret(); |
3395 } | 3395 } |
3396 | 3396 |
3397 | 3397 |
3398 ASSEMBLER_TEST_RUN(Vrecpes, test) { | 3398 ASSEMBLER_TEST_RUN(Vrecpes, test) { |
3399 EXPECT(test != NULL); | 3399 EXPECT(test != NULL); |
3400 typedef double (*DoubleReturn)() DART_UNUSED; | 3400 typedef double (*DoubleReturn)() DART_UNUSED; |
3401 float res = EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry()); | 3401 float res = EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry()); |
3402 EXPECT_FLOAT_EQ(arm_recip_estimate(147.0), res, 0.0001); | 3402 EXPECT_FLOAT_EQ(arm_recip_estimate(147.0), res, 0.0001); |
3403 } | 3403 } |
3404 | 3404 |
3405 | 3405 |
3406 ASSEMBLER_TEST_GENERATE(Vrecpss, assembler) { | 3406 ASSEMBLER_TEST_GENERATE(Vrecpss, assembler) { |
3407 __ LoadDImmediate(V1, 5.0, kNoPP); | 3407 __ LoadDImmediate(V1, 5.0); |
3408 __ LoadDImmediate(V2, 10.0, kNoPP); | 3408 __ LoadDImmediate(V2, 10.0); |
3409 | 3409 |
3410 __ fcvtsd(V1, V1); | 3410 __ fcvtsd(V1, V1); |
3411 __ fcvtsd(V2, V2); | 3411 __ fcvtsd(V2, V2); |
3412 | 3412 |
3413 __ vrecpss(V0, V1, V2); | 3413 __ vrecpss(V0, V1, V2); |
3414 | 3414 |
3415 __ fcvtds(V0, V0); | 3415 __ fcvtds(V0, V0); |
3416 __ ret(); | 3416 __ ret(); |
3417 } | 3417 } |
3418 | 3418 |
3419 | 3419 |
3420 ASSEMBLER_TEST_RUN(Vrecpss, test) { | 3420 ASSEMBLER_TEST_RUN(Vrecpss, test) { |
3421 EXPECT(test != NULL); | 3421 EXPECT(test != NULL); |
3422 typedef double (*DoubleReturn)() DART_UNUSED; | 3422 typedef double (*DoubleReturn)() DART_UNUSED; |
3423 double res = EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry()); | 3423 double res = EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry()); |
3424 EXPECT_FLOAT_EQ(2.0 - 10.0 * 5.0, res, 0.0001); | 3424 EXPECT_FLOAT_EQ(2.0 - 10.0 * 5.0, res, 0.0001); |
3425 } | 3425 } |
3426 | 3426 |
3427 | 3427 |
3428 ASSEMBLER_TEST_GENERATE(VRecps, assembler) { | 3428 ASSEMBLER_TEST_GENERATE(VRecps, assembler) { |
3429 __ LoadDImmediate(V0, 1.0 / 10.5, kNoPP); | 3429 __ LoadDImmediate(V0, 1.0 / 10.5); |
3430 __ fcvtsd(V0, V0); | 3430 __ fcvtsd(V0, V0); |
3431 | 3431 |
3432 __ vdups(V1, V0, 0); | 3432 __ vdups(V1, V0, 0); |
3433 | 3433 |
3434 __ VRecps(V2, V1); | 3434 __ VRecps(V2, V1); |
3435 | 3435 |
3436 __ vinss(V0, 0, V2, 0); | 3436 __ vinss(V0, 0, V2, 0); |
3437 __ vinss(V1, 0, V2, 1); | 3437 __ vinss(V1, 0, V2, 1); |
3438 __ vinss(V2, 0, V2, 2); | 3438 __ vinss(V2, 0, V2, 2); |
3439 __ vinss(V3, 0, V2, 3); | 3439 __ vinss(V3, 0, V2, 3); |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3502 ASSERT((estimate >= 1.0) && (estimate <= (511.0/256.0))); | 3502 ASSERT((estimate >= 1.0) && (estimate <= (511.0/256.0))); |
3503 | 3503 |
3504 // result = 0 : result_exp<7:0> : estimate<51:29> | 3504 // result = 0 : result_exp<7:0> : estimate<51:29> |
3505 int32_t result_bits = ((result_exp & 0xff) << 23) | | 3505 int32_t result_bits = ((result_exp & 0xff) << 23) | |
3506 ((bit_cast<uint64_t, double>(estimate) >> 29) & 0x7fffff); | 3506 ((bit_cast<uint64_t, double>(estimate) >> 29) & 0x7fffff); |
3507 return bit_cast<float, int32_t>(result_bits); | 3507 return bit_cast<float, int32_t>(result_bits); |
3508 } | 3508 } |
3509 | 3509 |
3510 | 3510 |
3511 ASSEMBLER_TEST_GENERATE(Vrsqrtes, assembler) { | 3511 ASSEMBLER_TEST_GENERATE(Vrsqrtes, assembler) { |
3512 __ LoadDImmediate(V1, 147.0, kNoPP); | 3512 __ LoadDImmediate(V1, 147.0); |
3513 __ fcvtsd(V1, V1); | 3513 __ fcvtsd(V1, V1); |
3514 | 3514 |
3515 __ vrsqrtes(V0, V1); | 3515 __ vrsqrtes(V0, V1); |
3516 | 3516 |
3517 __ fcvtds(V0, V0); | 3517 __ fcvtds(V0, V0); |
3518 __ ret(); | 3518 __ ret(); |
3519 } | 3519 } |
3520 | 3520 |
3521 | 3521 |
3522 ASSEMBLER_TEST_RUN(Vrsqrtes, test) { | 3522 ASSEMBLER_TEST_RUN(Vrsqrtes, test) { |
3523 EXPECT(test != NULL); | 3523 EXPECT(test != NULL); |
3524 typedef double (*DoubleReturn)() DART_UNUSED; | 3524 typedef double (*DoubleReturn)() DART_UNUSED; |
3525 double res = EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry()); | 3525 double res = EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry()); |
3526 EXPECT_FLOAT_EQ(arm_reciprocal_sqrt_estimate(147.0), res, 0.0001); | 3526 EXPECT_FLOAT_EQ(arm_reciprocal_sqrt_estimate(147.0), res, 0.0001); |
3527 } | 3527 } |
3528 | 3528 |
3529 | 3529 |
3530 ASSEMBLER_TEST_GENERATE(Vrsqrtss, assembler) { | 3530 ASSEMBLER_TEST_GENERATE(Vrsqrtss, assembler) { |
3531 __ LoadDImmediate(V1, 5.0, kNoPP); | 3531 __ LoadDImmediate(V1, 5.0); |
3532 __ LoadDImmediate(V2, 10.0, kNoPP); | 3532 __ LoadDImmediate(V2, 10.0); |
3533 | 3533 |
3534 __ fcvtsd(V1, V1); | 3534 __ fcvtsd(V1, V1); |
3535 __ fcvtsd(V2, V2); | 3535 __ fcvtsd(V2, V2); |
3536 | 3536 |
3537 __ vrsqrtss(V0, V1, V2); | 3537 __ vrsqrtss(V0, V1, V2); |
3538 | 3538 |
3539 __ fcvtds(V0, V0); | 3539 __ fcvtds(V0, V0); |
3540 __ ret(); | 3540 __ ret(); |
3541 } | 3541 } |
3542 | 3542 |
3543 | 3543 |
3544 ASSEMBLER_TEST_RUN(Vrsqrtss, test) { | 3544 ASSEMBLER_TEST_RUN(Vrsqrtss, test) { |
3545 EXPECT(test != NULL); | 3545 EXPECT(test != NULL); |
3546 typedef double (*DoubleReturn)() DART_UNUSED; | 3546 typedef double (*DoubleReturn)() DART_UNUSED; |
3547 double res = EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry()); | 3547 double res = EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry()); |
3548 EXPECT_FLOAT_EQ((3.0 - 10.0 * 5.0)/2.0, res, 0.0001); | 3548 EXPECT_FLOAT_EQ((3.0 - 10.0 * 5.0)/2.0, res, 0.0001); |
3549 } | 3549 } |
3550 | 3550 |
3551 | 3551 |
3552 ASSEMBLER_TEST_GENERATE(ReciprocalSqrt, assembler) { | 3552 ASSEMBLER_TEST_GENERATE(ReciprocalSqrt, assembler) { |
3553 __ LoadDImmediate(V1, 147000.0, kNoPP); | 3553 __ LoadDImmediate(V1, 147000.0); |
3554 __ fcvtsd(V1, V1); | 3554 __ fcvtsd(V1, V1); |
3555 | 3555 |
3556 __ VRSqrts(V0, V1); | 3556 __ VRSqrts(V0, V1); |
3557 | 3557 |
3558 __ fcvtds(V0, V0); | 3558 __ fcvtds(V0, V0); |
3559 __ ret(); | 3559 __ ret(); |
3560 } | 3560 } |
3561 | 3561 |
3562 | 3562 |
3563 ASSEMBLER_TEST_RUN(ReciprocalSqrt, test) { | 3563 ASSEMBLER_TEST_RUN(ReciprocalSqrt, test) { |
3564 EXPECT(test != NULL); | 3564 EXPECT(test != NULL); |
3565 typedef double (*DoubleReturn)() DART_UNUSED; | 3565 typedef double (*DoubleReturn)() DART_UNUSED; |
3566 double res = EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry()); | 3566 double res = EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry()); |
3567 EXPECT_FLOAT_EQ(1.0/sqrt(147000.0), res, 0.0001); | 3567 EXPECT_FLOAT_EQ(1.0/sqrt(147000.0), res, 0.0001); |
3568 } | 3568 } |
3569 | 3569 |
3570 | 3570 |
3571 // Called from assembler_test.cc. | 3571 // Called from assembler_test.cc. |
3572 // LR: return address. | 3572 // LR: return address. |
3573 // R0: context. | 3573 // R0: context. |
3574 // R1: value. | 3574 // R1: value. |
3575 // R2: growable array. | 3575 // R2: growable array. |
3576 // R3: current thread. | 3576 // R3: current thread. |
3577 ASSEMBLER_TEST_GENERATE(StoreIntoObject, assembler) { | 3577 ASSEMBLER_TEST_GENERATE(StoreIntoObject, assembler) { |
3578 __ SetupDartSP(kTestStackSpace); | 3578 __ SetupDartSP(kTestStackSpace); |
3579 __ TagAndPushPP(); | 3579 __ TagAndPushPP(); |
3580 __ LoadPoolPointer(PP); | 3580 __ LoadPoolPointer(); |
3581 __ Push(THR); | 3581 __ Push(THR); |
3582 __ Push(CTX); | 3582 __ Push(CTX); |
3583 __ Push(LR); | 3583 __ Push(LR); |
3584 __ mov(CTX, R0); | 3584 __ mov(CTX, R0); |
3585 __ mov(THR, R3); | 3585 __ mov(THR, R3); |
3586 __ StoreIntoObject(R2, | 3586 __ StoreIntoObject(R2, |
3587 FieldAddress(R2, GrowableObjectArray::data_offset()), | 3587 FieldAddress(R2, GrowableObjectArray::data_offset()), |
3588 R1); | 3588 R1); |
3589 __ Pop(LR); | 3589 __ Pop(LR); |
3590 __ Pop(CTX); | 3590 __ Pop(CTX); |
3591 __ Pop(THR); | 3591 __ Pop(THR); |
3592 __ PopAndUntagPP(); | 3592 __ PopAndUntagPP(); |
3593 __ mov(CSP, SP); | 3593 __ mov(CSP, SP); |
3594 __ ret(); | 3594 __ ret(); |
3595 } | 3595 } |
3596 | 3596 |
3597 | 3597 |
3598 ASSEMBLER_TEST_GENERATE(ComputeRange, assembler) { | 3598 ASSEMBLER_TEST_GENERATE(ComputeRange, assembler) { |
3599 __ SetupDartSP(kTestStackSpace); | 3599 __ SetupDartSP(kTestStackSpace); |
3600 __ TagAndPushPP(); | 3600 __ TagAndPushPP(); |
3601 __ LoadPoolPointer(PP); | 3601 __ LoadPoolPointer(); |
3602 Label miss, done; | 3602 Label miss, done; |
3603 __ mov(R1, R0); | 3603 __ mov(R1, R0); |
3604 __ ComputeRange(R0, R1, R2, &miss); | 3604 __ ComputeRange(R0, R1, R2, &miss); |
3605 __ b(&done); | 3605 __ b(&done); |
3606 | 3606 |
3607 __ Bind(&miss); | 3607 __ Bind(&miss); |
3608 __ LoadImmediate(R0, -1, kNoPP); | 3608 __ LoadImmediate(R0, -1); |
3609 | 3609 |
3610 __ Bind(&done); | 3610 __ Bind(&done); |
3611 __ PopAndUntagPP(); | 3611 __ PopAndUntagPP(); |
3612 __ mov(CSP, SP); | 3612 __ mov(CSP, SP); |
3613 __ ret(); | 3613 __ ret(); |
3614 } | 3614 } |
3615 | 3615 |
3616 | 3616 |
3617 ASSEMBLER_TEST_RUN(ComputeRange, test) { | 3617 ASSEMBLER_TEST_RUN(ComputeRange, test) { |
3618 typedef intptr_t (*ComputeRange)(intptr_t value) DART_UNUSED; | 3618 typedef intptr_t (*ComputeRange)(intptr_t value) DART_UNUSED; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3651 | 3651 |
3652 EXPECT_EQ(-1, RANGE_OF(Bool::True().raw())); | 3652 EXPECT_EQ(-1, RANGE_OF(Bool::True().raw())); |
3653 | 3653 |
3654 #undef RANGE_OF | 3654 #undef RANGE_OF |
3655 } | 3655 } |
3656 | 3656 |
3657 | 3657 |
3658 } // namespace dart | 3658 } // namespace dart |
3659 | 3659 |
3660 #endif // defined(TARGET_ARCH_ARM64) | 3660 #endif // defined(TARGET_ARCH_ARM64) |
OLD | NEW |