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

Side by Side Diff: test/cctest/test-assembler-mips.cc

Issue 235153003: Handlify code allocation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comments Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « test/cctest/test-assembler-ia32.cc ('k') | test/cctest/test-assembler-x64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 54
55 MacroAssembler assm(isolate, NULL, 0); 55 MacroAssembler assm(isolate, NULL, 0);
56 56
57 // Addition. 57 // Addition.
58 __ addu(v0, a0, a1); 58 __ addu(v0, a0, a1);
59 __ jr(ra); 59 __ jr(ra);
60 __ nop(); 60 __ nop();
61 61
62 CodeDesc desc; 62 CodeDesc desc;
63 assm.GetCode(&desc); 63 assm.GetCode(&desc);
64 Object* code = CcTest::heap()->CreateCode( 64 Handle<Code> code = isolate->factory()->NewCode(
65 desc, 65 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
66 Code::ComputeFlags(Code::STUB), 66 F2 f = FUNCTION_CAST<F2>(code->entry());
67 Handle<Code>())->ToObjectChecked();
68 CHECK(code->IsCode());
69 F2 f = FUNCTION_CAST<F2>(Code::cast(code)->entry());
70 int res = reinterpret_cast<int>(CALL_GENERATED_CODE(f, 0xab0, 0xc, 0, 0, 0)); 67 int res = reinterpret_cast<int>(CALL_GENERATED_CODE(f, 0xab0, 0xc, 0, 0, 0));
71 ::printf("f() = %d\n", res); 68 ::printf("f() = %d\n", res);
72 CHECK_EQ(0xabc, res); 69 CHECK_EQ(0xabc, res);
73 } 70 }
74 71
75 72
76 TEST(MIPS1) { 73 TEST(MIPS1) {
77 CcTest::InitializeVM(); 74 CcTest::InitializeVM();
78 Isolate* isolate = CcTest::i_isolate(); 75 Isolate* isolate = CcTest::i_isolate();
79 HandleScope scope(isolate); 76 HandleScope scope(isolate);
(...skipping 13 matching lines...) Expand all
93 __ bind(&C); 90 __ bind(&C);
94 __ xori(v1, a1, 0); 91 __ xori(v1, a1, 0);
95 __ Branch(&L, ne, v1, Operand(0)); 92 __ Branch(&L, ne, v1, Operand(0));
96 __ nop(); 93 __ nop();
97 94
98 __ jr(ra); 95 __ jr(ra);
99 __ nop(); 96 __ nop();
100 97
101 CodeDesc desc; 98 CodeDesc desc;
102 assm.GetCode(&desc); 99 assm.GetCode(&desc);
103 Object* code = CcTest::heap()->CreateCode( 100 Handle<Code> code = isolate->factory()->NewCode(
104 desc, 101 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
105 Code::ComputeFlags(Code::STUB), 102 F1 f = FUNCTION_CAST<F1>(code->entry());
106 Handle<Code>())->ToObjectChecked();
107 CHECK(code->IsCode());
108 F1 f = FUNCTION_CAST<F1>(Code::cast(code)->entry());
109 int res = reinterpret_cast<int>(CALL_GENERATED_CODE(f, 50, 0, 0, 0, 0)); 103 int res = reinterpret_cast<int>(CALL_GENERATED_CODE(f, 50, 0, 0, 0, 0));
110 ::printf("f() = %d\n", res); 104 ::printf("f() = %d\n", res);
111 CHECK_EQ(1275, res); 105 CHECK_EQ(1275, res);
112 } 106 }
113 107
114 108
115 TEST(MIPS2) { 109 TEST(MIPS2) {
116 CcTest::InitializeVM(); 110 CcTest::InitializeVM();
117 Isolate* isolate = CcTest::i_isolate(); 111 Isolate* isolate = CcTest::i_isolate();
118 HandleScope scope(isolate); 112 HandleScope scope(isolate);
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 __ bind(&error); 228 __ bind(&error);
235 // Got an error. Return a wrong result. 229 // Got an error. Return a wrong result.
236 __ li(v0, 666); 230 __ li(v0, 666);
237 231
238 __ bind(&exit); 232 __ bind(&exit);
239 __ jr(ra); 233 __ jr(ra);
240 __ nop(); 234 __ nop();
241 235
242 CodeDesc desc; 236 CodeDesc desc;
243 assm.GetCode(&desc); 237 assm.GetCode(&desc);
244 Object* code = CcTest::heap()->CreateCode( 238 Handle<Code> code = isolate->factory()->NewCode(
245 desc, 239 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
246 Code::ComputeFlags(Code::STUB), 240 F2 f = FUNCTION_CAST<F2>(code->entry());
247 Handle<Code>())->ToObjectChecked();
248 CHECK(code->IsCode());
249 F2 f = FUNCTION_CAST<F2>(Code::cast(code)->entry());
250 int res = reinterpret_cast<int>(CALL_GENERATED_CODE(f, 0xab0, 0xc, 0, 0, 0)); 241 int res = reinterpret_cast<int>(CALL_GENERATED_CODE(f, 0xab0, 0xc, 0, 0, 0));
251 ::printf("f() = %d\n", res); 242 ::printf("f() = %d\n", res);
252 CHECK_EQ(0x31415926, res); 243 CHECK_EQ(0x31415926, res);
253 } 244 }
254 245
255 246
256 TEST(MIPS3) { 247 TEST(MIPS3) {
257 // Test floating point instructions. 248 // Test floating point instructions.
258 CcTest::InitializeVM(); 249 CcTest::InitializeVM();
259 Isolate* isolate = CcTest::i_isolate(); 250 Isolate* isolate = CcTest::i_isolate();
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 __ ldc1(f6, MemOperand(a0, OFFSET_OF(T, i)) ); 298 __ ldc1(f6, MemOperand(a0, OFFSET_OF(T, i)) );
308 __ madd_d(f14, f6, f4, f6); 299 __ madd_d(f14, f6, f4, f6);
309 __ sdc1(f14, MemOperand(a0, OFFSET_OF(T, h)) ); 300 __ sdc1(f14, MemOperand(a0, OFFSET_OF(T, h)) );
310 } 301 }
311 302
312 __ jr(ra); 303 __ jr(ra);
313 __ nop(); 304 __ nop();
314 305
315 CodeDesc desc; 306 CodeDesc desc;
316 assm.GetCode(&desc); 307 assm.GetCode(&desc);
317 Object* code = CcTest::heap()->CreateCode( 308 Handle<Code> code = isolate->factory()->NewCode(
318 desc, 309 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
319 Code::ComputeFlags(Code::STUB), 310 F3 f = FUNCTION_CAST<F3>(code->entry());
320 Handle<Code>())->ToObjectChecked();
321 CHECK(code->IsCode());
322 F3 f = FUNCTION_CAST<F3>(Code::cast(code)->entry());
323 t.a = 1.5e14; 311 t.a = 1.5e14;
324 t.b = 2.75e11; 312 t.b = 2.75e11;
325 t.c = 0.0; 313 t.c = 0.0;
326 t.d = 0.0; 314 t.d = 0.0;
327 t.e = 0.0; 315 t.e = 0.0;
328 t.f = 0.0; 316 t.f = 0.0;
329 t.h = 1.5; 317 t.h = 1.5;
330 t.i = 2.75; 318 t.i = 2.75;
331 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); 319 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0);
332 USE(dummy); 320 USE(dummy);
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 363
376 // Store the swapped f4 and f5 back to memory. 364 // Store the swapped f4 and f5 back to memory.
377 __ sdc1(f4, MemOperand(a0, OFFSET_OF(T, a)) ); 365 __ sdc1(f4, MemOperand(a0, OFFSET_OF(T, a)) );
378 __ sdc1(f6, MemOperand(a0, OFFSET_OF(T, c)) ); 366 __ sdc1(f6, MemOperand(a0, OFFSET_OF(T, c)) );
379 367
380 __ jr(ra); 368 __ jr(ra);
381 __ nop(); 369 __ nop();
382 370
383 CodeDesc desc; 371 CodeDesc desc;
384 assm.GetCode(&desc); 372 assm.GetCode(&desc);
385 Object* code = CcTest::heap()->CreateCode( 373 Handle<Code> code = isolate->factory()->NewCode(
386 desc, 374 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
387 Code::ComputeFlags(Code::STUB), 375 F3 f = FUNCTION_CAST<F3>(code->entry());
388 Handle<Code>())->ToObjectChecked();
389 CHECK(code->IsCode());
390 F3 f = FUNCTION_CAST<F3>(Code::cast(code)->entry());
391 t.a = 1.5e22; 376 t.a = 1.5e22;
392 t.b = 2.75e11; 377 t.b = 2.75e11;
393 t.c = 17.17; 378 t.c = 17.17;
394 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); 379 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0);
395 USE(dummy); 380 USE(dummy);
396 381
397 CHECK_EQ(2.75e11, t.a); 382 CHECK_EQ(2.75e11, t.a);
398 CHECK_EQ(2.75e11, t.b); 383 CHECK_EQ(2.75e11, t.b);
399 CHECK_EQ(1.5e22, t.c); 384 CHECK_EQ(1.5e22, t.c);
400 } 385 }
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 // Convert int in original j (t1) to double in b. 426 // Convert int in original j (t1) to double in b.
442 __ mtc1(t1, f14); 427 __ mtc1(t1, f14);
443 __ cvt_d_w(f2, f14); 428 __ cvt_d_w(f2, f14);
444 __ sdc1(f2, MemOperand(a0, OFFSET_OF(T, b)) ); 429 __ sdc1(f2, MemOperand(a0, OFFSET_OF(T, b)) );
445 430
446 __ jr(ra); 431 __ jr(ra);
447 __ nop(); 432 __ nop();
448 433
449 CodeDesc desc; 434 CodeDesc desc;
450 assm.GetCode(&desc); 435 assm.GetCode(&desc);
451 Object* code = CcTest::heap()->CreateCode( 436 Handle<Code> code = isolate->factory()->NewCode(
452 desc, 437 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
453 Code::ComputeFlags(Code::STUB), 438 F3 f = FUNCTION_CAST<F3>(code->entry());
454 Handle<Code>())->ToObjectChecked();
455 CHECK(code->IsCode());
456 F3 f = FUNCTION_CAST<F3>(Code::cast(code)->entry());
457 t.a = 1.5e4; 439 t.a = 1.5e4;
458 t.b = 2.75e8; 440 t.b = 2.75e8;
459 t.i = 12345678; 441 t.i = 12345678;
460 t.j = -100000; 442 t.j = -100000;
461 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); 443 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0);
462 USE(dummy); 444 USE(dummy);
463 445
464 CHECK_EQ(12345678.0, t.a); 446 CHECK_EQ(12345678.0, t.a);
465 CHECK_EQ(-100000.0, t.b); 447 CHECK_EQ(-100000.0, t.b);
466 CHECK_EQ(15000, t.i); 448 CHECK_EQ(15000, t.i);
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 __ ori(t5, t5, 0x3333); 496 __ ori(t5, t5, 0x3333);
515 __ sw(t5, MemOperand(a0, OFFSET_OF(T, r6)) ); 497 __ sw(t5, MemOperand(a0, OFFSET_OF(T, r6)) );
516 __ lhu(t5, MemOperand(a0, OFFSET_OF(T, si)) ); 498 __ lhu(t5, MemOperand(a0, OFFSET_OF(T, si)) );
517 __ sh(t5, MemOperand(a0, OFFSET_OF(T, r6)) ); 499 __ sh(t5, MemOperand(a0, OFFSET_OF(T, r6)) );
518 500
519 __ jr(ra); 501 __ jr(ra);
520 __ nop(); 502 __ nop();
521 503
522 CodeDesc desc; 504 CodeDesc desc;
523 assm.GetCode(&desc); 505 assm.GetCode(&desc);
524 Object* code = CcTest::heap()->CreateCode( 506 Handle<Code> code = isolate->factory()->NewCode(
525 desc, 507 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
526 Code::ComputeFlags(Code::STUB), 508 F3 f = FUNCTION_CAST<F3>(code->entry());
527 Handle<Code>())->ToObjectChecked();
528 CHECK(code->IsCode());
529 F3 f = FUNCTION_CAST<F3>(Code::cast(code)->entry());
530 t.ui = 0x11223344; 509 t.ui = 0x11223344;
531 t.si = 0x99aabbcc; 510 t.si = 0x99aabbcc;
532 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); 511 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0);
533 USE(dummy); 512 USE(dummy);
534 513
535 CHECK_EQ(0x11223344, t.r1); 514 CHECK_EQ(0x11223344, t.r1);
536 #if __BYTE_ORDER == __LITTLE_ENDIAN 515 #if __BYTE_ORDER == __LITTLE_ENDIAN
537 CHECK_EQ(0x3344, t.r2); 516 CHECK_EQ(0x3344, t.r2);
538 CHECK_EQ(0xffffbbcc, t.r3); 517 CHECK_EQ(0xffffbbcc, t.r3);
539 CHECK_EQ(0x0000bbcc, t.r4); 518 CHECK_EQ(0x0000bbcc, t.r4);
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 580
602 // This test-case should have additional tests. 581 // This test-case should have additional tests.
603 582
604 __ bind(&outa_here); 583 __ bind(&outa_here);
605 584
606 __ jr(ra); 585 __ jr(ra);
607 __ nop(); 586 __ nop();
608 587
609 CodeDesc desc; 588 CodeDesc desc;
610 assm.GetCode(&desc); 589 assm.GetCode(&desc);
611 Object* code = CcTest::heap()->CreateCode( 590 Handle<Code> code = isolate->factory()->NewCode(
612 desc, 591 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
613 Code::ComputeFlags(Code::STUB), 592 F3 f = FUNCTION_CAST<F3>(code->entry());
614 Handle<Code>())->ToObjectChecked();
615 CHECK(code->IsCode());
616 F3 f = FUNCTION_CAST<F3>(Code::cast(code)->entry());
617 t.a = 1.5e14; 593 t.a = 1.5e14;
618 t.b = 2.75e11; 594 t.b = 2.75e11;
619 t.c = 2.0; 595 t.c = 2.0;
620 t.d = -4.0; 596 t.d = -4.0;
621 t.e = 0.0; 597 t.e = 0.0;
622 t.f = 0.0; 598 t.f = 0.0;
623 t.result = 0; 599 t.result = 0;
624 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); 600 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0);
625 USE(dummy); 601 USE(dummy);
626 CHECK_EQ(1.5e14, t.a); 602 CHECK_EQ(1.5e14, t.a);
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 __ sw(t4, MemOperand(a0, OFFSET_OF(T, result_rotrv_16)) ); 676 __ sw(t4, MemOperand(a0, OFFSET_OF(T, result_rotrv_16)) );
701 __ sw(t5, MemOperand(a0, OFFSET_OF(T, result_rotrv_20)) ); 677 __ sw(t5, MemOperand(a0, OFFSET_OF(T, result_rotrv_20)) );
702 __ sw(t6, MemOperand(a0, OFFSET_OF(T, result_rotrv_24)) ); 678 __ sw(t6, MemOperand(a0, OFFSET_OF(T, result_rotrv_24)) );
703 __ sw(t7, MemOperand(a0, OFFSET_OF(T, result_rotrv_28)) ); 679 __ sw(t7, MemOperand(a0, OFFSET_OF(T, result_rotrv_28)) );
704 680
705 __ jr(ra); 681 __ jr(ra);
706 __ nop(); 682 __ nop();
707 683
708 CodeDesc desc; 684 CodeDesc desc;
709 assm.GetCode(&desc); 685 assm.GetCode(&desc);
710 Object* code = CcTest::heap()->CreateCode( 686 Handle<Code> code = isolate->factory()->NewCode(
711 desc, 687 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
712 Code::ComputeFlags(Code::STUB), 688 F3 f = FUNCTION_CAST<F3>(code->entry());
713 Handle<Code>())->ToObjectChecked();
714 CHECK(code->IsCode());
715 F3 f = FUNCTION_CAST<F3>(Code::cast(code)->entry());
716 t.input = 0x12345678; 689 t.input = 0x12345678;
717 Object* dummy = CALL_GENERATED_CODE(f, &t, 0x0, 0, 0, 0); 690 Object* dummy = CALL_GENERATED_CODE(f, &t, 0x0, 0, 0, 0);
718 USE(dummy); 691 USE(dummy);
719 CHECK_EQ(0x81234567, t.result_rotr_4); 692 CHECK_EQ(0x81234567, t.result_rotr_4);
720 CHECK_EQ(0x78123456, t.result_rotr_8); 693 CHECK_EQ(0x78123456, t.result_rotr_8);
721 CHECK_EQ(0x67812345, t.result_rotr_12); 694 CHECK_EQ(0x67812345, t.result_rotr_12);
722 CHECK_EQ(0x56781234, t.result_rotr_16); 695 CHECK_EQ(0x56781234, t.result_rotr_16);
723 CHECK_EQ(0x45678123, t.result_rotr_20); 696 CHECK_EQ(0x45678123, t.result_rotr_20);
724 CHECK_EQ(0x34567812, t.result_rotr_24); 697 CHECK_EQ(0x34567812, t.result_rotr_24);
725 CHECK_EQ(0x23456781, t.result_rotr_28); 698 CHECK_EQ(0x23456781, t.result_rotr_28);
(...skipping 22 matching lines...) Expand all
748 __ Branch(&exit3, ge, a0, Operand(0x0001FFFF)); 721 __ Branch(&exit3, ge, a0, Operand(0x0001FFFF));
749 722
750 __ bind(&exit); 723 __ bind(&exit);
751 __ bind(&exit2); 724 __ bind(&exit2);
752 __ bind(&exit3); 725 __ bind(&exit3);
753 __ jr(ra); 726 __ jr(ra);
754 __ nop(); 727 __ nop();
755 728
756 CodeDesc desc; 729 CodeDesc desc;
757 assm.GetCode(&desc); 730 assm.GetCode(&desc);
758 Object* code = CcTest::heap()->CreateCode( 731 isolate->factory()->NewCode(
759 desc, 732 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
760 Code::ComputeFlags(Code::STUB),
761 Handle<Code>())->ToObjectChecked();
762 CHECK(code->IsCode());
763 } 733 }
764 734
765 735
766 TEST(MIPS10) { 736 TEST(MIPS10) {
767 // Test conversions between doubles and long integers. 737 // Test conversions between doubles and long integers.
768 // Test hos the long ints map to FP regs pairs. 738 // Test hos the long ints map to FP regs pairs.
769 CcTest::InitializeVM(); 739 CcTest::InitializeVM();
770 Isolate* isolate = CcTest::i_isolate(); 740 Isolate* isolate = CcTest::i_isolate();
771 HandleScope scope(isolate); 741 HandleScope scope(isolate);
772 742
(...skipping 29 matching lines...) Expand all
802 __ lw(t0, MemOperand(a0, OFFSET_OF(T, b_word))); 772 __ lw(t0, MemOperand(a0, OFFSET_OF(T, b_word)));
803 __ mtc1(t0, f8); // f8 has a 32-bits word. 773 __ mtc1(t0, f8); // f8 has a 32-bits word.
804 __ cvt_d_w(f10, f8); 774 __ cvt_d_w(f10, f8);
805 __ sdc1(f10, MemOperand(a0, OFFSET_OF(T, b))); 775 __ sdc1(f10, MemOperand(a0, OFFSET_OF(T, b)));
806 776
807 __ jr(ra); 777 __ jr(ra);
808 __ nop(); 778 __ nop();
809 779
810 CodeDesc desc; 780 CodeDesc desc;
811 assm.GetCode(&desc); 781 assm.GetCode(&desc);
812 Object* code = CcTest::heap()->CreateCode( 782 Handle<Code> code = isolate->factory()->NewCode(
813 desc, 783 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
814 Code::ComputeFlags(Code::STUB), 784 F3 f = FUNCTION_CAST<F3>(code->entry());
815 Handle<Code>())->ToObjectChecked();
816 CHECK(code->IsCode());
817 F3 f = FUNCTION_CAST<F3>(Code::cast(code)->entry());
818 t.a = 2.147483646e+09; // 0x7FFFFFFE -> 0xFF80000041DFFFFF as double. 785 t.a = 2.147483646e+09; // 0x7FFFFFFE -> 0xFF80000041DFFFFF as double.
819 t.b_word = 0x0ff00ff0; // 0x0FF00FF0 -> 0x as double. 786 t.b_word = 0x0ff00ff0; // 0x0FF00FF0 -> 0x as double.
820 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); 787 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0);
821 USE(dummy); 788 USE(dummy);
822 789
823 CHECK_EQ(0x41DFFFFF, t.dbl_exp); 790 CHECK_EQ(0x41DFFFFF, t.dbl_exp);
824 CHECK_EQ(0xFF800000, t.dbl_mant); 791 CHECK_EQ(0xFF800000, t.dbl_mant);
825 CHECK_EQ(0X7FFFFFFE, t.word); 792 CHECK_EQ(0X7FFFFFFE, t.word);
826 // 0x0FF00FF0 -> 2.6739096+e08 793 // 0x0FF00FF0 -> 2.6739096+e08
827 CHECK_EQ(2.6739096e08, t.b); 794 CHECK_EQ(2.6739096e08, t.b);
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
933 __ lw(t3, MemOperand(a0, OFFSET_OF(T, mem_init)) ); 900 __ lw(t3, MemOperand(a0, OFFSET_OF(T, mem_init)) );
934 __ sw(t3, MemOperand(a0, OFFSET_OF(T, swr_3)) ); 901 __ sw(t3, MemOperand(a0, OFFSET_OF(T, swr_3)) );
935 __ lw(t3, MemOperand(a0, OFFSET_OF(T, reg_init)) ); 902 __ lw(t3, MemOperand(a0, OFFSET_OF(T, reg_init)) );
936 __ swr(t3, MemOperand(a0, OFFSET_OF(T, swr_3) + 3) ); 903 __ swr(t3, MemOperand(a0, OFFSET_OF(T, swr_3) + 3) );
937 904
938 __ jr(ra); 905 __ jr(ra);
939 __ nop(); 906 __ nop();
940 907
941 CodeDesc desc; 908 CodeDesc desc;
942 assm.GetCode(&desc); 909 assm.GetCode(&desc);
943 Object* code = CcTest::heap()->CreateCode( 910 Handle<Code> code = isolate->factory()->NewCode(
944 desc, 911 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
945 Code::ComputeFlags(Code::STUB), 912 F3 f = FUNCTION_CAST<F3>(code->entry());
946 Handle<Code>())->ToObjectChecked();
947 CHECK(code->IsCode());
948 F3 f = FUNCTION_CAST<F3>(Code::cast(code)->entry());
949 t.reg_init = 0xaabbccdd; 913 t.reg_init = 0xaabbccdd;
950 t.mem_init = 0x11223344; 914 t.mem_init = 0x11223344;
951 915
952 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); 916 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0);
953 USE(dummy); 917 USE(dummy);
954 918
955 #if __BYTE_ORDER == __LITTLE_ENDIAN 919 #if __BYTE_ORDER == __LITTLE_ENDIAN
956 CHECK_EQ(0x44bbccdd, t.lwl_0); 920 CHECK_EQ(0x44bbccdd, t.lwl_0);
957 CHECK_EQ(0x3344ccdd, t.lwl_1); 921 CHECK_EQ(0x3344ccdd, t.lwl_1);
958 CHECK_EQ(0x223344dd, t.lwl_2); 922 CHECK_EQ(0x223344dd, t.lwl_2);
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
1062 __ lw(t2, MemOperand(fp, OFFSET_OF(T, y)) ); 1026 __ lw(t2, MemOperand(fp, OFFSET_OF(T, y)) );
1063 __ pop(t3); 1027 __ pop(t3);
1064 __ nop(); 1028 __ nop();
1065 1029
1066 __ mov(fp, t6); 1030 __ mov(fp, t6);
1067 __ jr(ra); 1031 __ jr(ra);
1068 __ nop(); 1032 __ nop();
1069 1033
1070 CodeDesc desc; 1034 CodeDesc desc;
1071 assm.GetCode(&desc); 1035 assm.GetCode(&desc);
1072 Object* code = CcTest::heap()->CreateCode( 1036 Handle<Code> code = isolate->factory()->NewCode(
1073 desc, 1037 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
1074 Code::ComputeFlags(Code::STUB), 1038 F3 f = FUNCTION_CAST<F3>(code->entry());
1075 Handle<Code>())->ToObjectChecked();
1076 CHECK(code->IsCode());
1077 F3 f = FUNCTION_CAST<F3>(Code::cast(code)->entry());
1078 t.x = 1; 1039 t.x = 1;
1079 t.y = 2; 1040 t.y = 2;
1080 t.y1 = 3; 1041 t.y1 = 3;
1081 t.y2 = 4; 1042 t.y2 = 4;
1082 t.y3 = 0XBABA; 1043 t.y3 = 0XBABA;
1083 t.y4 = 0xDEDA; 1044 t.y4 = 0xDEDA;
1084 1045
1085 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); 1046 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0);
1086 USE(dummy); 1047 USE(dummy);
1087 1048
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
1119 __ sdc1(f8, MemOperand(a0, OFFSET_OF(T, cvt_big_out))); 1080 __ sdc1(f8, MemOperand(a0, OFFSET_OF(T, cvt_big_out)));
1120 1081
1121 __ Trunc_uw_d(f8, f8, f22); 1082 __ Trunc_uw_d(f8, f8, f22);
1122 __ swc1(f8, MemOperand(a0, OFFSET_OF(T, trunc_big_out))); 1083 __ swc1(f8, MemOperand(a0, OFFSET_OF(T, trunc_big_out)));
1123 1084
1124 __ jr(ra); 1085 __ jr(ra);
1125 __ nop(); 1086 __ nop();
1126 1087
1127 CodeDesc desc; 1088 CodeDesc desc;
1128 assm.GetCode(&desc); 1089 assm.GetCode(&desc);
1129 Object* code = CcTest::heap()->CreateCode( 1090 Handle<Code> code = isolate->factory()->NewCode(
1130 desc, 1091 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
1131 Code::ComputeFlags(Code::STUB), 1092 F3 f = FUNCTION_CAST<F3>(code->entry());
1132 Handle<Code>())->ToObjectChecked();
1133 CHECK(code->IsCode());
1134 F3 f = FUNCTION_CAST<F3>(Code::cast(code)->entry());
1135 1093
1136 t.cvt_big_in = 0xFFFFFFFF; 1094 t.cvt_big_in = 0xFFFFFFFF;
1137 t.cvt_small_in = 333; 1095 t.cvt_small_in = 333;
1138 1096
1139 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); 1097 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0);
1140 USE(dummy); 1098 USE(dummy);
1141 1099
1142 CHECK_EQ(t.cvt_big_out, static_cast<double>(t.cvt_big_in)); 1100 CHECK_EQ(t.cvt_big_out, static_cast<double>(t.cvt_big_in));
1143 CHECK_EQ(t.cvt_small_out, static_cast<double>(t.cvt_small_in)); 1101 CHECK_EQ(t.cvt_small_out, static_cast<double>(t.cvt_small_in));
1144 1102
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
1240 RUN_ROUND_TEST(cvt) 1198 RUN_ROUND_TEST(cvt)
1241 1199
1242 // Restore FCSR. 1200 // Restore FCSR.
1243 __ ctc1(a1, FCSR); 1201 __ ctc1(a1, FCSR);
1244 1202
1245 __ jr(ra); 1203 __ jr(ra);
1246 __ nop(); 1204 __ nop();
1247 1205
1248 CodeDesc desc; 1206 CodeDesc desc;
1249 assm.GetCode(&desc); 1207 assm.GetCode(&desc);
1250 Object* code = CcTest::heap()->CreateCode( 1208 Handle<Code> code = isolate->factory()->NewCode(
1251 desc, 1209 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
1252 Code::ComputeFlags(Code::STUB), 1210 F3 f = FUNCTION_CAST<F3>(code->entry());
1253 Handle<Code>())->ToObjectChecked();
1254 CHECK(code->IsCode());
1255 F3 f = FUNCTION_CAST<F3>(Code::cast(code)->entry());
1256 1211
1257 t.round_up_in = 123.51; 1212 t.round_up_in = 123.51;
1258 t.round_down_in = 123.49; 1213 t.round_down_in = 123.49;
1259 t.neg_round_up_in = -123.5; 1214 t.neg_round_up_in = -123.5;
1260 t.neg_round_down_in = -123.49; 1215 t.neg_round_down_in = -123.49;
1261 t.err1_in = 123.51; 1216 t.err1_in = 123.51;
1262 t.err2_in = 1; 1217 t.err2_in = 1;
1263 t.err3_in = static_cast<double>(1) + 0xFFFFFFFF; 1218 t.err3_in = static_cast<double>(1) + 0xFFFFFFFF;
1264 t.err4_in = NAN; 1219 t.err4_in = NAN;
1265 1220
(...skipping 25 matching lines...) Expand all
1291 Label target; 1246 Label target;
1292 __ beq(v0, v1, &target); 1247 __ beq(v0, v1, &target);
1293 __ nop(); 1248 __ nop();
1294 __ bne(v0, v1, &target); 1249 __ bne(v0, v1, &target);
1295 __ nop(); 1250 __ nop();
1296 __ bind(&target); 1251 __ bind(&target);
1297 __ nop(); 1252 __ nop();
1298 } 1253 }
1299 1254
1300 #undef __ 1255 #undef __
OLDNEW
« no previous file with comments | « test/cctest/test-assembler-ia32.cc ('k') | test/cctest/test-assembler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698