| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 Loading... |
| 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 Loading... |
| 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 Loading... |
| 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 Loading... |
| 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 Loading... |
| 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 CHECK_EQ(0x3344, t.r2); | 515 CHECK_EQ(0x3344, t.r2); |
| 537 CHECK_EQ(0xffffbbcc, t.r3); | 516 CHECK_EQ(0xffffbbcc, t.r3); |
| 538 CHECK_EQ(0x0000bbcc, t.r4); | 517 CHECK_EQ(0x0000bbcc, t.r4); |
| 539 CHECK_EQ(0xffffffcc, t.r5); | 518 CHECK_EQ(0xffffffcc, t.r5); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 591 | 570 |
| 592 // This test-case should have additional tests. | 571 // This test-case should have additional tests. |
| 593 | 572 |
| 594 __ bind(&outa_here); | 573 __ bind(&outa_here); |
| 595 | 574 |
| 596 __ jr(ra); | 575 __ jr(ra); |
| 597 __ nop(); | 576 __ nop(); |
| 598 | 577 |
| 599 CodeDesc desc; | 578 CodeDesc desc; |
| 600 assm.GetCode(&desc); | 579 assm.GetCode(&desc); |
| 601 Object* code = CcTest::heap()->CreateCode( | 580 Handle<Code> code = isolate->factory()->NewCode( |
| 602 desc, | 581 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
| 603 Code::ComputeFlags(Code::STUB), | 582 F3 f = FUNCTION_CAST<F3>(code->entry()); |
| 604 Handle<Code>())->ToObjectChecked(); | |
| 605 CHECK(code->IsCode()); | |
| 606 F3 f = FUNCTION_CAST<F3>(Code::cast(code)->entry()); | |
| 607 t.a = 1.5e14; | 583 t.a = 1.5e14; |
| 608 t.b = 2.75e11; | 584 t.b = 2.75e11; |
| 609 t.c = 2.0; | 585 t.c = 2.0; |
| 610 t.d = -4.0; | 586 t.d = -4.0; |
| 611 t.e = 0.0; | 587 t.e = 0.0; |
| 612 t.f = 0.0; | 588 t.f = 0.0; |
| 613 t.result = 0; | 589 t.result = 0; |
| 614 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); | 590 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); |
| 615 USE(dummy); | 591 USE(dummy); |
| 616 CHECK_EQ(1.5e14, t.a); | 592 CHECK_EQ(1.5e14, t.a); |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 690 __ sw(t4, MemOperand(a0, OFFSET_OF(T, result_rotrv_16)) ); | 666 __ sw(t4, MemOperand(a0, OFFSET_OF(T, result_rotrv_16)) ); |
| 691 __ sw(t5, MemOperand(a0, OFFSET_OF(T, result_rotrv_20)) ); | 667 __ sw(t5, MemOperand(a0, OFFSET_OF(T, result_rotrv_20)) ); |
| 692 __ sw(t6, MemOperand(a0, OFFSET_OF(T, result_rotrv_24)) ); | 668 __ sw(t6, MemOperand(a0, OFFSET_OF(T, result_rotrv_24)) ); |
| 693 __ sw(t7, MemOperand(a0, OFFSET_OF(T, result_rotrv_28)) ); | 669 __ sw(t7, MemOperand(a0, OFFSET_OF(T, result_rotrv_28)) ); |
| 694 | 670 |
| 695 __ jr(ra); | 671 __ jr(ra); |
| 696 __ nop(); | 672 __ nop(); |
| 697 | 673 |
| 698 CodeDesc desc; | 674 CodeDesc desc; |
| 699 assm.GetCode(&desc); | 675 assm.GetCode(&desc); |
| 700 Object* code = CcTest::heap()->CreateCode( | 676 Handle<Code> code = isolate->factory()->NewCode( |
| 701 desc, | 677 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
| 702 Code::ComputeFlags(Code::STUB), | 678 F3 f = FUNCTION_CAST<F3>(code->entry()); |
| 703 Handle<Code>())->ToObjectChecked(); | |
| 704 CHECK(code->IsCode()); | |
| 705 F3 f = FUNCTION_CAST<F3>(Code::cast(code)->entry()); | |
| 706 t.input = 0x12345678; | 679 t.input = 0x12345678; |
| 707 Object* dummy = CALL_GENERATED_CODE(f, &t, 0x0, 0, 0, 0); | 680 Object* dummy = CALL_GENERATED_CODE(f, &t, 0x0, 0, 0, 0); |
| 708 USE(dummy); | 681 USE(dummy); |
| 709 CHECK_EQ(0x81234567, t.result_rotr_4); | 682 CHECK_EQ(0x81234567, t.result_rotr_4); |
| 710 CHECK_EQ(0x78123456, t.result_rotr_8); | 683 CHECK_EQ(0x78123456, t.result_rotr_8); |
| 711 CHECK_EQ(0x67812345, t.result_rotr_12); | 684 CHECK_EQ(0x67812345, t.result_rotr_12); |
| 712 CHECK_EQ(0x56781234, t.result_rotr_16); | 685 CHECK_EQ(0x56781234, t.result_rotr_16); |
| 713 CHECK_EQ(0x45678123, t.result_rotr_20); | 686 CHECK_EQ(0x45678123, t.result_rotr_20); |
| 714 CHECK_EQ(0x34567812, t.result_rotr_24); | 687 CHECK_EQ(0x34567812, t.result_rotr_24); |
| 715 CHECK_EQ(0x23456781, t.result_rotr_28); | 688 CHECK_EQ(0x23456781, t.result_rotr_28); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 738 __ Branch(&exit3, ge, a0, Operand(0x0001FFFF)); | 711 __ Branch(&exit3, ge, a0, Operand(0x0001FFFF)); |
| 739 | 712 |
| 740 __ bind(&exit); | 713 __ bind(&exit); |
| 741 __ bind(&exit2); | 714 __ bind(&exit2); |
| 742 __ bind(&exit3); | 715 __ bind(&exit3); |
| 743 __ jr(ra); | 716 __ jr(ra); |
| 744 __ nop(); | 717 __ nop(); |
| 745 | 718 |
| 746 CodeDesc desc; | 719 CodeDesc desc; |
| 747 assm.GetCode(&desc); | 720 assm.GetCode(&desc); |
| 748 Object* code = CcTest::heap()->CreateCode( | 721 isolate->factory()->NewCode( |
| 749 desc, | 722 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
| 750 Code::ComputeFlags(Code::STUB), | |
| 751 Handle<Code>())->ToObjectChecked(); | |
| 752 CHECK(code->IsCode()); | |
| 753 } | 723 } |
| 754 | 724 |
| 755 | 725 |
| 756 TEST(MIPS10) { | 726 TEST(MIPS10) { |
| 757 // Test conversions between doubles and long integers. | 727 // Test conversions between doubles and long integers. |
| 758 // Test hos the long ints map to FP regs pairs. | 728 // Test hos the long ints map to FP regs pairs. |
| 759 CcTest::InitializeVM(); | 729 CcTest::InitializeVM(); |
| 760 Isolate* isolate = CcTest::i_isolate(); | 730 Isolate* isolate = CcTest::i_isolate(); |
| 761 HandleScope scope(isolate); | 731 HandleScope scope(isolate); |
| 762 | 732 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 792 __ lw(t0, MemOperand(a0, OFFSET_OF(T, b_word))); | 762 __ lw(t0, MemOperand(a0, OFFSET_OF(T, b_word))); |
| 793 __ mtc1(t0, f8); // f8 has a 32-bits word. | 763 __ mtc1(t0, f8); // f8 has a 32-bits word. |
| 794 __ cvt_d_w(f10, f8); | 764 __ cvt_d_w(f10, f8); |
| 795 __ sdc1(f10, MemOperand(a0, OFFSET_OF(T, b))); | 765 __ sdc1(f10, MemOperand(a0, OFFSET_OF(T, b))); |
| 796 | 766 |
| 797 __ jr(ra); | 767 __ jr(ra); |
| 798 __ nop(); | 768 __ nop(); |
| 799 | 769 |
| 800 CodeDesc desc; | 770 CodeDesc desc; |
| 801 assm.GetCode(&desc); | 771 assm.GetCode(&desc); |
| 802 Object* code = CcTest::heap()->CreateCode( | 772 Handle<Code> code = isolate->factory()->NewCode( |
| 803 desc, | 773 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
| 804 Code::ComputeFlags(Code::STUB), | 774 F3 f = FUNCTION_CAST<F3>(code->entry()); |
| 805 Handle<Code>())->ToObjectChecked(); | |
| 806 CHECK(code->IsCode()); | |
| 807 F3 f = FUNCTION_CAST<F3>(Code::cast(code)->entry()); | |
| 808 t.a = 2.147483646e+09; // 0x7FFFFFFE -> 0xFF80000041DFFFFF as double. | 775 t.a = 2.147483646e+09; // 0x7FFFFFFE -> 0xFF80000041DFFFFF as double. |
| 809 t.b_word = 0x0ff00ff0; // 0x0FF00FF0 -> 0x as double. | 776 t.b_word = 0x0ff00ff0; // 0x0FF00FF0 -> 0x as double. |
| 810 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); | 777 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); |
| 811 USE(dummy); | 778 USE(dummy); |
| 812 | 779 |
| 813 CHECK_EQ(0x41DFFFFF, t.dbl_exp); | 780 CHECK_EQ(0x41DFFFFF, t.dbl_exp); |
| 814 CHECK_EQ(0xFF800000, t.dbl_mant); | 781 CHECK_EQ(0xFF800000, t.dbl_mant); |
| 815 CHECK_EQ(0X7FFFFFFE, t.word); | 782 CHECK_EQ(0X7FFFFFFE, t.word); |
| 816 // 0x0FF00FF0 -> 2.6739096+e08 | 783 // 0x0FF00FF0 -> 2.6739096+e08 |
| 817 CHECK_EQ(2.6739096e08, t.b); | 784 CHECK_EQ(2.6739096e08, t.b); |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 923 __ lw(t3, MemOperand(a0, OFFSET_OF(T, mem_init)) ); | 890 __ lw(t3, MemOperand(a0, OFFSET_OF(T, mem_init)) ); |
| 924 __ sw(t3, MemOperand(a0, OFFSET_OF(T, swr_3)) ); | 891 __ sw(t3, MemOperand(a0, OFFSET_OF(T, swr_3)) ); |
| 925 __ lw(t3, MemOperand(a0, OFFSET_OF(T, reg_init)) ); | 892 __ lw(t3, MemOperand(a0, OFFSET_OF(T, reg_init)) ); |
| 926 __ swr(t3, MemOperand(a0, OFFSET_OF(T, swr_3) + 3) ); | 893 __ swr(t3, MemOperand(a0, OFFSET_OF(T, swr_3) + 3) ); |
| 927 | 894 |
| 928 __ jr(ra); | 895 __ jr(ra); |
| 929 __ nop(); | 896 __ nop(); |
| 930 | 897 |
| 931 CodeDesc desc; | 898 CodeDesc desc; |
| 932 assm.GetCode(&desc); | 899 assm.GetCode(&desc); |
| 933 Object* code = CcTest::heap()->CreateCode( | 900 Handle<Code> code = isolate->factory()->NewCode( |
| 934 desc, | 901 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
| 935 Code::ComputeFlags(Code::STUB), | 902 F3 f = FUNCTION_CAST<F3>(code->entry()); |
| 936 Handle<Code>())->ToObjectChecked(); | |
| 937 CHECK(code->IsCode()); | |
| 938 F3 f = FUNCTION_CAST<F3>(Code::cast(code)->entry()); | |
| 939 t.reg_init = 0xaabbccdd; | 903 t.reg_init = 0xaabbccdd; |
| 940 t.mem_init = 0x11223344; | 904 t.mem_init = 0x11223344; |
| 941 | 905 |
| 942 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); | 906 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); |
| 943 USE(dummy); | 907 USE(dummy); |
| 944 | 908 |
| 945 CHECK_EQ(0x44bbccdd, t.lwl_0); | 909 CHECK_EQ(0x44bbccdd, t.lwl_0); |
| 946 CHECK_EQ(0x3344ccdd, t.lwl_1); | 910 CHECK_EQ(0x3344ccdd, t.lwl_1); |
| 947 CHECK_EQ(0x223344dd, t.lwl_2); | 911 CHECK_EQ(0x223344dd, t.lwl_2); |
| 948 CHECK_EQ(0x11223344, t.lwl_3); | 912 CHECK_EQ(0x11223344, t.lwl_3); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1028 __ lw(t2, MemOperand(fp, OFFSET_OF(T, y)) ); | 992 __ lw(t2, MemOperand(fp, OFFSET_OF(T, y)) ); |
| 1029 __ pop(t3); | 993 __ pop(t3); |
| 1030 __ nop(); | 994 __ nop(); |
| 1031 | 995 |
| 1032 __ mov(fp, t6); | 996 __ mov(fp, t6); |
| 1033 __ jr(ra); | 997 __ jr(ra); |
| 1034 __ nop(); | 998 __ nop(); |
| 1035 | 999 |
| 1036 CodeDesc desc; | 1000 CodeDesc desc; |
| 1037 assm.GetCode(&desc); | 1001 assm.GetCode(&desc); |
| 1038 Object* code = CcTest::heap()->CreateCode( | 1002 Handle<Code> code = isolate->factory()->NewCode( |
| 1039 desc, | 1003 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
| 1040 Code::ComputeFlags(Code::STUB), | 1004 F3 f = FUNCTION_CAST<F3>(code->entry()); |
| 1041 Handle<Code>())->ToObjectChecked(); | |
| 1042 CHECK(code->IsCode()); | |
| 1043 F3 f = FUNCTION_CAST<F3>(Code::cast(code)->entry()); | |
| 1044 t.x = 1; | 1005 t.x = 1; |
| 1045 t.y = 2; | 1006 t.y = 2; |
| 1046 t.y1 = 3; | 1007 t.y1 = 3; |
| 1047 t.y2 = 4; | 1008 t.y2 = 4; |
| 1048 t.y3 = 0XBABA; | 1009 t.y3 = 0XBABA; |
| 1049 t.y4 = 0xDEDA; | 1010 t.y4 = 0xDEDA; |
| 1050 | 1011 |
| 1051 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); | 1012 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); |
| 1052 USE(dummy); | 1013 USE(dummy); |
| 1053 | 1014 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1085 __ sdc1(f8, MemOperand(a0, OFFSET_OF(T, cvt_big_out))); | 1046 __ sdc1(f8, MemOperand(a0, OFFSET_OF(T, cvt_big_out))); |
| 1086 | 1047 |
| 1087 __ Trunc_uw_d(f8, f8, f22); | 1048 __ Trunc_uw_d(f8, f8, f22); |
| 1088 __ swc1(f8, MemOperand(a0, OFFSET_OF(T, trunc_big_out))); | 1049 __ swc1(f8, MemOperand(a0, OFFSET_OF(T, trunc_big_out))); |
| 1089 | 1050 |
| 1090 __ jr(ra); | 1051 __ jr(ra); |
| 1091 __ nop(); | 1052 __ nop(); |
| 1092 | 1053 |
| 1093 CodeDesc desc; | 1054 CodeDesc desc; |
| 1094 assm.GetCode(&desc); | 1055 assm.GetCode(&desc); |
| 1095 Object* code = CcTest::heap()->CreateCode( | 1056 Handle<Code> code = isolate->factory()->NewCode( |
| 1096 desc, | 1057 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
| 1097 Code::ComputeFlags(Code::STUB), | 1058 F3 f = FUNCTION_CAST<F3>(code->entry()); |
| 1098 Handle<Code>())->ToObjectChecked(); | |
| 1099 CHECK(code->IsCode()); | |
| 1100 F3 f = FUNCTION_CAST<F3>(Code::cast(code)->entry()); | |
| 1101 | 1059 |
| 1102 t.cvt_big_in = 0xFFFFFFFF; | 1060 t.cvt_big_in = 0xFFFFFFFF; |
| 1103 t.cvt_small_in = 333; | 1061 t.cvt_small_in = 333; |
| 1104 | 1062 |
| 1105 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); | 1063 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); |
| 1106 USE(dummy); | 1064 USE(dummy); |
| 1107 | 1065 |
| 1108 CHECK_EQ(t.cvt_big_out, static_cast<double>(t.cvt_big_in)); | 1066 CHECK_EQ(t.cvt_big_out, static_cast<double>(t.cvt_big_in)); |
| 1109 CHECK_EQ(t.cvt_small_out, static_cast<double>(t.cvt_small_in)); | 1067 CHECK_EQ(t.cvt_small_out, static_cast<double>(t.cvt_small_in)); |
| 1110 | 1068 |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1206 RUN_ROUND_TEST(cvt) | 1164 RUN_ROUND_TEST(cvt) |
| 1207 | 1165 |
| 1208 // Restore FCSR. | 1166 // Restore FCSR. |
| 1209 __ ctc1(a1, FCSR); | 1167 __ ctc1(a1, FCSR); |
| 1210 | 1168 |
| 1211 __ jr(ra); | 1169 __ jr(ra); |
| 1212 __ nop(); | 1170 __ nop(); |
| 1213 | 1171 |
| 1214 CodeDesc desc; | 1172 CodeDesc desc; |
| 1215 assm.GetCode(&desc); | 1173 assm.GetCode(&desc); |
| 1216 Object* code = CcTest::heap()->CreateCode( | 1174 Handle<Code> code = isolate->factory()->NewCode( |
| 1217 desc, | 1175 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
| 1218 Code::ComputeFlags(Code::STUB), | 1176 F3 f = FUNCTION_CAST<F3>(code->entry()); |
| 1219 Handle<Code>())->ToObjectChecked(); | |
| 1220 CHECK(code->IsCode()); | |
| 1221 F3 f = FUNCTION_CAST<F3>(Code::cast(code)->entry()); | |
| 1222 | 1177 |
| 1223 t.round_up_in = 123.51; | 1178 t.round_up_in = 123.51; |
| 1224 t.round_down_in = 123.49; | 1179 t.round_down_in = 123.49; |
| 1225 t.neg_round_up_in = -123.5; | 1180 t.neg_round_up_in = -123.5; |
| 1226 t.neg_round_down_in = -123.49; | 1181 t.neg_round_down_in = -123.49; |
| 1227 t.err1_in = 123.51; | 1182 t.err1_in = 123.51; |
| 1228 t.err2_in = 1; | 1183 t.err2_in = 1; |
| 1229 t.err3_in = static_cast<double>(1) + 0xFFFFFFFF; | 1184 t.err3_in = static_cast<double>(1) + 0xFFFFFFFF; |
| 1230 t.err4_in = NAN; | 1185 t.err4_in = NAN; |
| 1231 | 1186 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 1257 Label target; | 1212 Label target; |
| 1258 __ beq(v0, v1, &target); | 1213 __ beq(v0, v1, &target); |
| 1259 __ nop(); | 1214 __ nop(); |
| 1260 __ bne(v0, v1, &target); | 1215 __ bne(v0, v1, &target); |
| 1261 __ nop(); | 1216 __ nop(); |
| 1262 __ bind(&target); | 1217 __ bind(&target); |
| 1263 __ nop(); | 1218 __ nop(); |
| 1264 } | 1219 } |
| 1265 | 1220 |
| 1266 #undef __ | 1221 #undef __ |
| OLD | NEW |