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

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

Issue 1173343006: Replace OFFSET_OF with offsetof as far as possible. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixed typing chaos on ARM. Created 5 years, 6 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
« no previous file with comments | « test/cctest/test-assembler-mips.cc ('k') | test/cctest/test-assembler-ppc.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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 float fg; 282 float fg;
283 } T; 283 } T;
284 T t; 284 T t;
285 285
286 // Create a function that accepts &t, and loads, manipulates, and stores 286 // Create a function that accepts &t, and loads, manipulates, and stores
287 // the doubles t.a ... t.f. 287 // the doubles t.a ... t.f.
288 MacroAssembler assm(isolate, NULL, 0); 288 MacroAssembler assm(isolate, NULL, 0);
289 Label L, C; 289 Label L, C;
290 290
291 // Double precision floating point instructions. 291 // Double precision floating point instructions.
292 __ ldc1(f4, MemOperand(a0, OFFSET_OF(T, a)) ); 292 __ ldc1(f4, MemOperand(a0, offsetof(T, a)) );
293 __ ldc1(f6, MemOperand(a0, OFFSET_OF(T, b)) ); 293 __ ldc1(f6, MemOperand(a0, offsetof(T, b)) );
294 __ add_d(f8, f4, f6); 294 __ add_d(f8, f4, f6);
295 __ sdc1(f8, MemOperand(a0, OFFSET_OF(T, c)) ); // c = a + b. 295 __ sdc1(f8, MemOperand(a0, offsetof(T, c)) ); // c = a + b.
296 296
297 __ mov_d(f10, f8); // c 297 __ mov_d(f10, f8); // c
298 __ neg_d(f12, f6); // -b 298 __ neg_d(f12, f6); // -b
299 __ sub_d(f10, f10, f12); 299 __ sub_d(f10, f10, f12);
300 __ sdc1(f10, MemOperand(a0, OFFSET_OF(T, d)) ); // d = c - (-b). 300 __ sdc1(f10, MemOperand(a0, offsetof(T, d)) ); // d = c - (-b).
301 301
302 __ sdc1(f4, MemOperand(a0, OFFSET_OF(T, b)) ); // b = a. 302 __ sdc1(f4, MemOperand(a0, offsetof(T, b)) ); // b = a.
303 303
304 __ li(a4, 120); 304 __ li(a4, 120);
305 __ mtc1(a4, f14); 305 __ mtc1(a4, f14);
306 __ cvt_d_w(f14, f14); // f14 = 120.0. 306 __ cvt_d_w(f14, f14); // f14 = 120.0.
307 __ mul_d(f10, f10, f14); 307 __ mul_d(f10, f10, f14);
308 __ sdc1(f10, MemOperand(a0, OFFSET_OF(T, e)) ); // e = d * 120 = 1.8066e16. 308 __ sdc1(f10, MemOperand(a0, offsetof(T, e)) ); // e = d * 120 = 1.8066e16.
309 309
310 __ div_d(f12, f10, f4); 310 __ div_d(f12, f10, f4);
311 __ sdc1(f12, MemOperand(a0, OFFSET_OF(T, f)) ); // f = e / a = 120.44. 311 __ sdc1(f12, MemOperand(a0, offsetof(T, f)) ); // f = e / a = 120.44.
312 312
313 __ sqrt_d(f14, f12); 313 __ sqrt_d(f14, f12);
314 __ sdc1(f14, MemOperand(a0, OFFSET_OF(T, g)) ); 314 __ sdc1(f14, MemOperand(a0, offsetof(T, g)) );
315 // g = sqrt(f) = 10.97451593465515908537 315 // g = sqrt(f) = 10.97451593465515908537
316 316
317 if (kArchVariant == kMips64r2) { 317 if (kArchVariant == kMips64r2) {
318 __ ldc1(f4, MemOperand(a0, OFFSET_OF(T, h)) ); 318 __ ldc1(f4, MemOperand(a0, offsetof(T, h)) );
319 __ ldc1(f6, MemOperand(a0, OFFSET_OF(T, i)) ); 319 __ ldc1(f6, MemOperand(a0, offsetof(T, i)) );
320 __ madd_d(f14, f6, f4, f6); 320 __ madd_d(f14, f6, f4, f6);
321 __ sdc1(f14, MemOperand(a0, OFFSET_OF(T, h)) ); 321 __ sdc1(f14, MemOperand(a0, offsetof(T, h)) );
322 } 322 }
323 323
324 // Single precision floating point instructions. 324 // Single precision floating point instructions.
325 __ lwc1(f4, MemOperand(a0, OFFSET_OF(T, fa)) ); 325 __ lwc1(f4, MemOperand(a0, offsetof(T, fa)) );
326 __ lwc1(f6, MemOperand(a0, OFFSET_OF(T, fb)) ); 326 __ lwc1(f6, MemOperand(a0, offsetof(T, fb)) );
327 __ add_s(f8, f4, f6); 327 __ add_s(f8, f4, f6);
328 __ swc1(f8, MemOperand(a0, OFFSET_OF(T, fc)) ); // fc = fa + fb. 328 __ swc1(f8, MemOperand(a0, offsetof(T, fc)) ); // fc = fa + fb.
329 329
330 __ neg_s(f10, f6); // -fb 330 __ neg_s(f10, f6); // -fb
331 __ sub_s(f10, f8, f10); 331 __ sub_s(f10, f8, f10);
332 __ swc1(f10, MemOperand(a0, OFFSET_OF(T, fd)) ); // fd = fc - (-fb). 332 __ swc1(f10, MemOperand(a0, offsetof(T, fd)) ); // fd = fc - (-fb).
333 333
334 __ swc1(f4, MemOperand(a0, OFFSET_OF(T, fb)) ); // fb = fa. 334 __ swc1(f4, MemOperand(a0, offsetof(T, fb)) ); // fb = fa.
335 335
336 __ li(t0, 120); 336 __ li(t0, 120);
337 __ mtc1(t0, f14); 337 __ mtc1(t0, f14);
338 __ cvt_s_w(f14, f14); // f14 = 120.0. 338 __ cvt_s_w(f14, f14); // f14 = 120.0.
339 __ mul_s(f10, f10, f14); 339 __ mul_s(f10, f10, f14);
340 __ swc1(f10, MemOperand(a0, OFFSET_OF(T, fe)) ); // fe = fd * 120 340 __ swc1(f10, MemOperand(a0, offsetof(T, fe)) ); // fe = fd * 120
341 341
342 __ div_s(f12, f10, f4); 342 __ div_s(f12, f10, f4);
343 __ swc1(f12, MemOperand(a0, OFFSET_OF(T, ff)) ); // ff = fe / fa 343 __ swc1(f12, MemOperand(a0, offsetof(T, ff)) ); // ff = fe / fa
344 344
345 __ sqrt_s(f14, f12); 345 __ sqrt_s(f14, f12);
346 __ swc1(f14, MemOperand(a0, OFFSET_OF(T, fg)) ); 346 __ swc1(f14, MemOperand(a0, offsetof(T, fg)) );
347 347
348 __ jr(ra); 348 __ jr(ra);
349 __ nop(); 349 __ nop();
350 350
351 CodeDesc desc; 351 CodeDesc desc;
352 assm.GetCode(&desc); 352 assm.GetCode(&desc);
353 Handle<Code> code = isolate->factory()->NewCode( 353 Handle<Code> code = isolate->factory()->NewCode(
354 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 354 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
355 F3 f = FUNCTION_CAST<F3>(code->entry()); 355 F3 f = FUNCTION_CAST<F3>(code->entry());
356 // Double test values. 356 // Double test values.
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 double c; 405 double c;
406 double d; 406 double d;
407 int64_t high; 407 int64_t high;
408 int64_t low; 408 int64_t low;
409 } T; 409 } T;
410 T t; 410 T t;
411 411
412 Assembler assm(isolate, NULL, 0); 412 Assembler assm(isolate, NULL, 0);
413 Label L, C; 413 Label L, C;
414 414
415 __ ldc1(f4, MemOperand(a0, OFFSET_OF(T, a))); 415 __ ldc1(f4, MemOperand(a0, offsetof(T, a)));
416 __ ldc1(f5, MemOperand(a0, OFFSET_OF(T, b))); 416 __ ldc1(f5, MemOperand(a0, offsetof(T, b)));
417 417
418 // Swap f4 and f5, by using 3 integer registers, a4-a6, 418 // Swap f4 and f5, by using 3 integer registers, a4-a6,
419 // both two 32-bit chunks, and one 64-bit chunk. 419 // both two 32-bit chunks, and one 64-bit chunk.
420 // mXhc1 is mips32/64-r2 only, not r1, 420 // mXhc1 is mips32/64-r2 only, not r1,
421 // but we will not support r1 in practice. 421 // but we will not support r1 in practice.
422 __ mfc1(a4, f4); 422 __ mfc1(a4, f4);
423 __ mfhc1(a5, f4); 423 __ mfhc1(a5, f4);
424 __ dmfc1(a6, f5); 424 __ dmfc1(a6, f5);
425 425
426 __ mtc1(a4, f5); 426 __ mtc1(a4, f5);
427 __ mthc1(a5, f5); 427 __ mthc1(a5, f5);
428 __ dmtc1(a6, f4); 428 __ dmtc1(a6, f4);
429 429
430 // Store the swapped f4 and f5 back to memory. 430 // Store the swapped f4 and f5 back to memory.
431 __ sdc1(f4, MemOperand(a0, OFFSET_OF(T, a))); 431 __ sdc1(f4, MemOperand(a0, offsetof(T, a)));
432 __ sdc1(f5, MemOperand(a0, OFFSET_OF(T, c))); 432 __ sdc1(f5, MemOperand(a0, offsetof(T, c)));
433 433
434 // Test sign extension of move operations from coprocessor. 434 // Test sign extension of move operations from coprocessor.
435 __ ldc1(f4, MemOperand(a0, OFFSET_OF(T, d))); 435 __ ldc1(f4, MemOperand(a0, offsetof(T, d)));
436 __ mfhc1(a4, f4); 436 __ mfhc1(a4, f4);
437 __ mfc1(a5, f4); 437 __ mfc1(a5, f4);
438 438
439 __ sd(a4, MemOperand(a0, OFFSET_OF(T, high))); 439 __ sd(a4, MemOperand(a0, offsetof(T, high)));
440 __ sd(a5, MemOperand(a0, OFFSET_OF(T, low))); 440 __ sd(a5, MemOperand(a0, offsetof(T, low)));
441 441
442 __ jr(ra); 442 __ jr(ra);
443 __ nop(); 443 __ nop();
444 444
445 CodeDesc desc; 445 CodeDesc desc;
446 assm.GetCode(&desc); 446 assm.GetCode(&desc);
447 Handle<Code> code = isolate->factory()->NewCode( 447 Handle<Code> code = isolate->factory()->NewCode(
448 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 448 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
449 F3 f = FUNCTION_CAST<F3>(code->entry()); 449 F3 f = FUNCTION_CAST<F3>(code->entry());
450 t.a = 1.5e22; 450 t.a = 1.5e22;
(...skipping 22 matching lines...) Expand all
473 double b; 473 double b;
474 int i; 474 int i;
475 int j; 475 int j;
476 } T; 476 } T;
477 T t; 477 T t;
478 478
479 Assembler assm(isolate, NULL, 0); 479 Assembler assm(isolate, NULL, 0);
480 Label L, C; 480 Label L, C;
481 481
482 // Load all structure elements to registers. 482 // Load all structure elements to registers.
483 __ ldc1(f4, MemOperand(a0, OFFSET_OF(T, a)) ); 483 __ ldc1(f4, MemOperand(a0, offsetof(T, a)) );
484 __ ldc1(f6, MemOperand(a0, OFFSET_OF(T, b)) ); 484 __ ldc1(f6, MemOperand(a0, offsetof(T, b)) );
485 __ lw(a4, MemOperand(a0, OFFSET_OF(T, i)) ); 485 __ lw(a4, MemOperand(a0, offsetof(T, i)) );
486 __ lw(a5, MemOperand(a0, OFFSET_OF(T, j)) ); 486 __ lw(a5, MemOperand(a0, offsetof(T, j)) );
487 487
488 // Convert double in f4 to int in element i. 488 // Convert double in f4 to int in element i.
489 __ cvt_w_d(f8, f4); 489 __ cvt_w_d(f8, f4);
490 __ mfc1(a6, f8); 490 __ mfc1(a6, f8);
491 __ sw(a6, MemOperand(a0, OFFSET_OF(T, i)) ); 491 __ sw(a6, MemOperand(a0, offsetof(T, i)) );
492 492
493 // Convert double in f6 to int in element j. 493 // Convert double in f6 to int in element j.
494 __ cvt_w_d(f10, f6); 494 __ cvt_w_d(f10, f6);
495 __ mfc1(a7, f10); 495 __ mfc1(a7, f10);
496 __ sw(a7, MemOperand(a0, OFFSET_OF(T, j)) ); 496 __ sw(a7, MemOperand(a0, offsetof(T, j)) );
497 497
498 // Convert int in original i (a4) to double in a. 498 // Convert int in original i (a4) to double in a.
499 __ mtc1(a4, f12); 499 __ mtc1(a4, f12);
500 __ cvt_d_w(f0, f12); 500 __ cvt_d_w(f0, f12);
501 __ sdc1(f0, MemOperand(a0, OFFSET_OF(T, a)) ); 501 __ sdc1(f0, MemOperand(a0, offsetof(T, a)) );
502 502
503 // Convert int in original j (a5) to double in b. 503 // Convert int in original j (a5) to double in b.
504 __ mtc1(a5, f14); 504 __ mtc1(a5, f14);
505 __ cvt_d_w(f2, f14); 505 __ cvt_d_w(f2, f14);
506 __ sdc1(f2, MemOperand(a0, OFFSET_OF(T, b)) ); 506 __ sdc1(f2, MemOperand(a0, offsetof(T, b)) );
507 507
508 __ jr(ra); 508 __ jr(ra);
509 __ nop(); 509 __ nop();
510 510
511 CodeDesc desc; 511 CodeDesc desc;
512 assm.GetCode(&desc); 512 assm.GetCode(&desc);
513 Handle<Code> code = isolate->factory()->NewCode( 513 Handle<Code> code = isolate->factory()->NewCode(
514 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 514 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
515 F3 f = FUNCTION_CAST<F3>(code->entry()); 515 F3 f = FUNCTION_CAST<F3>(code->entry());
516 t.a = 1.5e4; 516 t.a = 1.5e4;
(...skipping 25 matching lines...) Expand all
542 int32_t r4; 542 int32_t r4;
543 int32_t r5; 543 int32_t r5;
544 int32_t r6; 544 int32_t r6;
545 } T; 545 } T;
546 T t; 546 T t;
547 547
548 Assembler assm(isolate, NULL, 0); 548 Assembler assm(isolate, NULL, 0);
549 Label L, C; 549 Label L, C;
550 550
551 // Basic word load/store. 551 // Basic word load/store.
552 __ lw(a4, MemOperand(a0, OFFSET_OF(T, ui)) ); 552 __ lw(a4, MemOperand(a0, offsetof(T, ui)) );
553 __ sw(a4, MemOperand(a0, OFFSET_OF(T, r1)) ); 553 __ sw(a4, MemOperand(a0, offsetof(T, r1)) );
554 554
555 // lh with positive data. 555 // lh with positive data.
556 __ lh(a5, MemOperand(a0, OFFSET_OF(T, ui)) ); 556 __ lh(a5, MemOperand(a0, offsetof(T, ui)) );
557 __ sw(a5, MemOperand(a0, OFFSET_OF(T, r2)) ); 557 __ sw(a5, MemOperand(a0, offsetof(T, r2)) );
558 558
559 // lh with negative data. 559 // lh with negative data.
560 __ lh(a6, MemOperand(a0, OFFSET_OF(T, si)) ); 560 __ lh(a6, MemOperand(a0, offsetof(T, si)) );
561 __ sw(a6, MemOperand(a0, OFFSET_OF(T, r3)) ); 561 __ sw(a6, MemOperand(a0, offsetof(T, r3)) );
562 562
563 // lhu with negative data. 563 // lhu with negative data.
564 __ lhu(a7, MemOperand(a0, OFFSET_OF(T, si)) ); 564 __ lhu(a7, MemOperand(a0, offsetof(T, si)) );
565 __ sw(a7, MemOperand(a0, OFFSET_OF(T, r4)) ); 565 __ sw(a7, MemOperand(a0, offsetof(T, r4)) );
566 566
567 // lb with negative data. 567 // lb with negative data.
568 __ lb(t0, MemOperand(a0, OFFSET_OF(T, si)) ); 568 __ lb(t0, MemOperand(a0, offsetof(T, si)) );
569 __ sw(t0, MemOperand(a0, OFFSET_OF(T, r5)) ); 569 __ sw(t0, MemOperand(a0, offsetof(T, r5)) );
570 570
571 // sh writes only 1/2 of word. 571 // sh writes only 1/2 of word.
572 __ lui(t1, 0x3333); 572 __ lui(t1, 0x3333);
573 __ ori(t1, t1, 0x3333); 573 __ ori(t1, t1, 0x3333);
574 __ sw(t1, MemOperand(a0, OFFSET_OF(T, r6)) ); 574 __ sw(t1, MemOperand(a0, offsetof(T, r6)) );
575 __ lhu(t1, MemOperand(a0, OFFSET_OF(T, si)) ); 575 __ lhu(t1, MemOperand(a0, offsetof(T, si)) );
576 __ sh(t1, MemOperand(a0, OFFSET_OF(T, r6)) ); 576 __ sh(t1, MemOperand(a0, offsetof(T, r6)) );
577 577
578 __ jr(ra); 578 __ jr(ra);
579 __ nop(); 579 __ nop();
580 580
581 CodeDesc desc; 581 CodeDesc desc;
582 assm.GetCode(&desc); 582 assm.GetCode(&desc);
583 Handle<Code> code = isolate->factory()->NewCode( 583 Handle<Code> code = isolate->factory()->NewCode(
584 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 584 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
585 F3 f = FUNCTION_CAST<F3>(code->entry()); 585 F3 f = FUNCTION_CAST<F3>(code->entry());
586 t.ui = 0x11223344; 586 t.ui = 0x11223344;
(...skipping 25 matching lines...) Expand all
612 double f; 612 double f;
613 int32_t result; 613 int32_t result;
614 } T; 614 } T;
615 T t; 615 T t;
616 616
617 // Create a function that accepts &t, and loads, manipulates, and stores 617 // Create a function that accepts &t, and loads, manipulates, and stores
618 // the doubles t.a ... t.f. 618 // the doubles t.a ... t.f.
619 MacroAssembler assm(isolate, NULL, 0); 619 MacroAssembler assm(isolate, NULL, 0);
620 Label neither_is_nan, less_than, outa_here; 620 Label neither_is_nan, less_than, outa_here;
621 621
622 __ ldc1(f4, MemOperand(a0, OFFSET_OF(T, a)) ); 622 __ ldc1(f4, MemOperand(a0, offsetof(T, a)) );
623 __ ldc1(f6, MemOperand(a0, OFFSET_OF(T, b)) ); 623 __ ldc1(f6, MemOperand(a0, offsetof(T, b)) );
624 if (kArchVariant != kMips64r6) { 624 if (kArchVariant != kMips64r6) {
625 __ c(UN, D, f4, f6); 625 __ c(UN, D, f4, f6);
626 __ bc1f(&neither_is_nan); 626 __ bc1f(&neither_is_nan);
627 } else { 627 } else {
628 __ cmp(UN, L, f2, f4, f6); 628 __ cmp(UN, L, f2, f4, f6);
629 __ bc1eqz(&neither_is_nan, f2); 629 __ bc1eqz(&neither_is_nan, f2);
630 } 630 }
631 __ nop(); 631 __ nop();
632 __ sw(zero_reg, MemOperand(a0, OFFSET_OF(T, result)) ); 632 __ sw(zero_reg, MemOperand(a0, offsetof(T, result)) );
633 __ Branch(&outa_here); 633 __ Branch(&outa_here);
634 634
635 __ bind(&neither_is_nan); 635 __ bind(&neither_is_nan);
636 636
637 if (kArchVariant == kMips64r6) { 637 if (kArchVariant == kMips64r6) {
638 __ cmp(OLT, L, f2, f6, f4); 638 __ cmp(OLT, L, f2, f6, f4);
639 __ bc1nez(&less_than, f2); 639 __ bc1nez(&less_than, f2);
640 } else { 640 } else {
641 __ c(OLT, D, f6, f4, 2); 641 __ c(OLT, D, f6, f4, 2);
642 __ bc1t(&less_than, 2); 642 __ bc1t(&less_than, 2);
643 } 643 }
644 644
645 __ nop(); 645 __ nop();
646 __ sw(zero_reg, MemOperand(a0, OFFSET_OF(T, result)) ); 646 __ sw(zero_reg, MemOperand(a0, offsetof(T, result)) );
647 __ Branch(&outa_here); 647 __ Branch(&outa_here);
648 648
649 __ bind(&less_than); 649 __ bind(&less_than);
650 __ Addu(a4, zero_reg, Operand(1)); 650 __ Addu(a4, zero_reg, Operand(1));
651 __ sw(a4, MemOperand(a0, OFFSET_OF(T, result)) ); // Set true. 651 __ sw(a4, MemOperand(a0, offsetof(T, result)) ); // Set true.
652 652
653 653
654 // This test-case should have additional tests. 654 // This test-case should have additional tests.
655 655
656 __ bind(&outa_here); 656 __ bind(&outa_here);
657 657
658 __ jr(ra); 658 __ jr(ra);
659 __ nop(); 659 __ nop();
660 660
661 CodeDesc desc; 661 CodeDesc desc;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 int32_t result_rotrv_16; 700 int32_t result_rotrv_16;
701 int32_t result_rotrv_20; 701 int32_t result_rotrv_20;
702 int32_t result_rotrv_24; 702 int32_t result_rotrv_24;
703 int32_t result_rotrv_28; 703 int32_t result_rotrv_28;
704 } T; 704 } T;
705 T t; 705 T t;
706 706
707 MacroAssembler assm(isolate, NULL, 0); 707 MacroAssembler assm(isolate, NULL, 0);
708 708
709 // Basic word load. 709 // Basic word load.
710 __ lw(a4, MemOperand(a0, OFFSET_OF(T, input)) ); 710 __ lw(a4, MemOperand(a0, offsetof(T, input)) );
711 711
712 // ROTR instruction (called through the Ror macro). 712 // ROTR instruction (called through the Ror macro).
713 __ Ror(a5, a4, 0x0004); 713 __ Ror(a5, a4, 0x0004);
714 __ Ror(a6, a4, 0x0008); 714 __ Ror(a6, a4, 0x0008);
715 __ Ror(a7, a4, 0x000c); 715 __ Ror(a7, a4, 0x000c);
716 __ Ror(t0, a4, 0x0010); 716 __ Ror(t0, a4, 0x0010);
717 __ Ror(t1, a4, 0x0014); 717 __ Ror(t1, a4, 0x0014);
718 __ Ror(t2, a4, 0x0018); 718 __ Ror(t2, a4, 0x0018);
719 __ Ror(t3, a4, 0x001c); 719 __ Ror(t3, a4, 0x001c);
720 720
721 // Basic word store. 721 // Basic word store.
722 __ sw(a5, MemOperand(a0, OFFSET_OF(T, result_rotr_4)) ); 722 __ sw(a5, MemOperand(a0, offsetof(T, result_rotr_4)) );
723 __ sw(a6, MemOperand(a0, OFFSET_OF(T, result_rotr_8)) ); 723 __ sw(a6, MemOperand(a0, offsetof(T, result_rotr_8)) );
724 __ sw(a7, MemOperand(a0, OFFSET_OF(T, result_rotr_12)) ); 724 __ sw(a7, MemOperand(a0, offsetof(T, result_rotr_12)) );
725 __ sw(t0, MemOperand(a0, OFFSET_OF(T, result_rotr_16)) ); 725 __ sw(t0, MemOperand(a0, offsetof(T, result_rotr_16)) );
726 __ sw(t1, MemOperand(a0, OFFSET_OF(T, result_rotr_20)) ); 726 __ sw(t1, MemOperand(a0, offsetof(T, result_rotr_20)) );
727 __ sw(t2, MemOperand(a0, OFFSET_OF(T, result_rotr_24)) ); 727 __ sw(t2, MemOperand(a0, offsetof(T, result_rotr_24)) );
728 __ sw(t3, MemOperand(a0, OFFSET_OF(T, result_rotr_28)) ); 728 __ sw(t3, MemOperand(a0, offsetof(T, result_rotr_28)) );
729 729
730 // ROTRV instruction (called through the Ror macro). 730 // ROTRV instruction (called through the Ror macro).
731 __ li(t3, 0x0004); 731 __ li(t3, 0x0004);
732 __ Ror(a5, a4, t3); 732 __ Ror(a5, a4, t3);
733 __ li(t3, 0x0008); 733 __ li(t3, 0x0008);
734 __ Ror(a6, a4, t3); 734 __ Ror(a6, a4, t3);
735 __ li(t3, 0x000C); 735 __ li(t3, 0x000C);
736 __ Ror(a7, a4, t3); 736 __ Ror(a7, a4, t3);
737 __ li(t3, 0x0010); 737 __ li(t3, 0x0010);
738 __ Ror(t0, a4, t3); 738 __ Ror(t0, a4, t3);
739 __ li(t3, 0x0014); 739 __ li(t3, 0x0014);
740 __ Ror(t1, a4, t3); 740 __ Ror(t1, a4, t3);
741 __ li(t3, 0x0018); 741 __ li(t3, 0x0018);
742 __ Ror(t2, a4, t3); 742 __ Ror(t2, a4, t3);
743 __ li(t3, 0x001C); 743 __ li(t3, 0x001C);
744 __ Ror(t3, a4, t3); 744 __ Ror(t3, a4, t3);
745 745
746 // Basic word store. 746 // Basic word store.
747 __ sw(a5, MemOperand(a0, OFFSET_OF(T, result_rotrv_4)) ); 747 __ sw(a5, MemOperand(a0, offsetof(T, result_rotrv_4)) );
748 __ sw(a6, MemOperand(a0, OFFSET_OF(T, result_rotrv_8)) ); 748 __ sw(a6, MemOperand(a0, offsetof(T, result_rotrv_8)) );
749 __ sw(a7, MemOperand(a0, OFFSET_OF(T, result_rotrv_12)) ); 749 __ sw(a7, MemOperand(a0, offsetof(T, result_rotrv_12)) );
750 __ sw(t0, MemOperand(a0, OFFSET_OF(T, result_rotrv_16)) ); 750 __ sw(t0, MemOperand(a0, offsetof(T, result_rotrv_16)) );
751 __ sw(t1, MemOperand(a0, OFFSET_OF(T, result_rotrv_20)) ); 751 __ sw(t1, MemOperand(a0, offsetof(T, result_rotrv_20)) );
752 __ sw(t2, MemOperand(a0, OFFSET_OF(T, result_rotrv_24)) ); 752 __ sw(t2, MemOperand(a0, offsetof(T, result_rotrv_24)) );
753 __ sw(t3, MemOperand(a0, OFFSET_OF(T, result_rotrv_28)) ); 753 __ sw(t3, MemOperand(a0, offsetof(T, result_rotrv_28)) );
754 754
755 __ jr(ra); 755 __ jr(ra);
756 __ nop(); 756 __ nop();
757 757
758 CodeDesc desc; 758 CodeDesc desc;
759 assm.GetCode(&desc); 759 assm.GetCode(&desc);
760 Handle<Code> code = isolate->factory()->NewCode( 760 Handle<Code> code = isolate->factory()->NewCode(
761 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 761 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
762 F3 f = FUNCTION_CAST<F3>(code->entry()); 762 F3 f = FUNCTION_CAST<F3>(code->entry());
763 t.input = 0x12345678; 763 t.input = 0x12345678;
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
831 T t; 831 T t;
832 832
833 Assembler assm(isolate, NULL, 0); 833 Assembler assm(isolate, NULL, 0);
834 Label L, C; 834 Label L, C;
835 835
836 if (kArchVariant == kMips64r2) { 836 if (kArchVariant == kMips64r2) {
837 // Rewritten for FR=1 FPU mode: 837 // Rewritten for FR=1 FPU mode:
838 // - 32 FP regs of 64-bits each, no odd/even pairs. 838 // - 32 FP regs of 64-bits each, no odd/even pairs.
839 // - Note that cvt_l_d/cvt_d_l ARE legal in FR=1 mode. 839 // - Note that cvt_l_d/cvt_d_l ARE legal in FR=1 mode.
840 // Load all structure elements to registers. 840 // Load all structure elements to registers.
841 __ ldc1(f0, MemOperand(a0, OFFSET_OF(T, a))); 841 __ ldc1(f0, MemOperand(a0, offsetof(T, a)));
842 842
843 // Save the raw bits of the double. 843 // Save the raw bits of the double.
844 __ mfc1(a4, f0); 844 __ mfc1(a4, f0);
845 __ mfhc1(a5, f0); 845 __ mfhc1(a5, f0);
846 __ sw(a4, MemOperand(a0, OFFSET_OF(T, dbl_mant))); 846 __ sw(a4, MemOperand(a0, offsetof(T, dbl_mant)));
847 __ sw(a5, MemOperand(a0, OFFSET_OF(T, dbl_exp))); 847 __ sw(a5, MemOperand(a0, offsetof(T, dbl_exp)));
848 848
849 // Convert double in f0 to long, save hi/lo parts. 849 // Convert double in f0 to long, save hi/lo parts.
850 __ cvt_l_d(f0, f0); 850 __ cvt_l_d(f0, f0);
851 __ mfc1(a4, f0); // f0 LS 32 bits of long. 851 __ mfc1(a4, f0); // f0 LS 32 bits of long.
852 __ mfhc1(a5, f0); // f0 MS 32 bits of long. 852 __ mfhc1(a5, f0); // f0 MS 32 bits of long.
853 __ sw(a4, MemOperand(a0, OFFSET_OF(T, long_lo))); 853 __ sw(a4, MemOperand(a0, offsetof(T, long_lo)));
854 __ sw(a5, MemOperand(a0, OFFSET_OF(T, long_hi))); 854 __ sw(a5, MemOperand(a0, offsetof(T, long_hi)));
855 855
856 // Combine the high/low ints, convert back to double. 856 // Combine the high/low ints, convert back to double.
857 __ dsll32(a6, a5, 0); // Move a5 to high bits of a6. 857 __ dsll32(a6, a5, 0); // Move a5 to high bits of a6.
858 __ or_(a6, a6, a4); 858 __ or_(a6, a6, a4);
859 __ dmtc1(a6, f1); 859 __ dmtc1(a6, f1);
860 __ cvt_d_l(f1, f1); 860 __ cvt_d_l(f1, f1);
861 __ sdc1(f1, MemOperand(a0, OFFSET_OF(T, a_converted))); 861 __ sdc1(f1, MemOperand(a0, offsetof(T, a_converted)));
862 862
863 863
864 // Convert the b long integers to double b. 864 // Convert the b long integers to double b.
865 __ lw(a4, MemOperand(a0, OFFSET_OF(T, b_long_lo))); 865 __ lw(a4, MemOperand(a0, offsetof(T, b_long_lo)));
866 __ lw(a5, MemOperand(a0, OFFSET_OF(T, b_long_hi))); 866 __ lw(a5, MemOperand(a0, offsetof(T, b_long_hi)));
867 __ mtc1(a4, f8); // f8 LS 32-bits. 867 __ mtc1(a4, f8); // f8 LS 32-bits.
868 __ mthc1(a5, f8); // f8 MS 32-bits. 868 __ mthc1(a5, f8); // f8 MS 32-bits.
869 __ cvt_d_l(f10, f8); 869 __ cvt_d_l(f10, f8);
870 __ sdc1(f10, MemOperand(a0, OFFSET_OF(T, b))); 870 __ sdc1(f10, MemOperand(a0, offsetof(T, b)));
871 871
872 // Convert double b back to long-int. 872 // Convert double b back to long-int.
873 __ ldc1(f31, MemOperand(a0, OFFSET_OF(T, b))); 873 __ ldc1(f31, MemOperand(a0, offsetof(T, b)));
874 __ cvt_l_d(f31, f31); 874 __ cvt_l_d(f31, f31);
875 __ dmfc1(a7, f31); 875 __ dmfc1(a7, f31);
876 __ sd(a7, MemOperand(a0, OFFSET_OF(T, b_long_as_int64))); 876 __ sd(a7, MemOperand(a0, offsetof(T, b_long_as_int64)));
877 877
878 878
879 __ jr(ra); 879 __ jr(ra);
880 __ nop(); 880 __ nop();
881 881
882 CodeDesc desc; 882 CodeDesc desc;
883 assm.GetCode(&desc); 883 assm.GetCode(&desc);
884 Handle<Code> code = isolate->factory()->NewCode( 884 Handle<Code> code = isolate->factory()->NewCode(
885 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 885 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
886 F3 f = FUNCTION_CAST<F3>(code->entry()); 886 F3 f = FUNCTION_CAST<F3>(code->entry());
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
929 int32_t swr_0; 929 int32_t swr_0;
930 int32_t swr_1; 930 int32_t swr_1;
931 int32_t swr_2; 931 int32_t swr_2;
932 int32_t swr_3; 932 int32_t swr_3;
933 } T; 933 } T;
934 T t; 934 T t;
935 935
936 Assembler assm(isolate, NULL, 0); 936 Assembler assm(isolate, NULL, 0);
937 937
938 // Test all combinations of LWL and vAddr. 938 // Test all combinations of LWL and vAddr.
939 __ lw(a4, MemOperand(a0, OFFSET_OF(T, reg_init))); 939 __ lw(a4, MemOperand(a0, offsetof(T, reg_init)));
940 __ lwl(a4, MemOperand(a0, OFFSET_OF(T, mem_init))); 940 __ lwl(a4, MemOperand(a0, offsetof(T, mem_init)));
941 __ sw(a4, MemOperand(a0, OFFSET_OF(T, lwl_0))); 941 __ sw(a4, MemOperand(a0, offsetof(T, lwl_0)));
942 942
943 __ lw(a5, MemOperand(a0, OFFSET_OF(T, reg_init))); 943 __ lw(a5, MemOperand(a0, offsetof(T, reg_init)));
944 __ lwl(a5, MemOperand(a0, OFFSET_OF(T, mem_init) + 1)); 944 __ lwl(a5, MemOperand(a0, offsetof(T, mem_init) + 1));
945 __ sw(a5, MemOperand(a0, OFFSET_OF(T, lwl_1))); 945 __ sw(a5, MemOperand(a0, offsetof(T, lwl_1)));
946 946
947 __ lw(a6, MemOperand(a0, OFFSET_OF(T, reg_init))); 947 __ lw(a6, MemOperand(a0, offsetof(T, reg_init)));
948 __ lwl(a6, MemOperand(a0, OFFSET_OF(T, mem_init) + 2)); 948 __ lwl(a6, MemOperand(a0, offsetof(T, mem_init) + 2));
949 __ sw(a6, MemOperand(a0, OFFSET_OF(T, lwl_2))); 949 __ sw(a6, MemOperand(a0, offsetof(T, lwl_2)));
950 950
951 __ lw(a7, MemOperand(a0, OFFSET_OF(T, reg_init))); 951 __ lw(a7, MemOperand(a0, offsetof(T, reg_init)));
952 __ lwl(a7, MemOperand(a0, OFFSET_OF(T, mem_init) + 3)); 952 __ lwl(a7, MemOperand(a0, offsetof(T, mem_init) + 3));
953 __ sw(a7, MemOperand(a0, OFFSET_OF(T, lwl_3))); 953 __ sw(a7, MemOperand(a0, offsetof(T, lwl_3)));
954 954
955 // Test all combinations of LWR and vAddr. 955 // Test all combinations of LWR and vAddr.
956 __ lw(a4, MemOperand(a0, OFFSET_OF(T, reg_init))); 956 __ lw(a4, MemOperand(a0, offsetof(T, reg_init)));
957 __ lwr(a4, MemOperand(a0, OFFSET_OF(T, mem_init))); 957 __ lwr(a4, MemOperand(a0, offsetof(T, mem_init)));
958 __ sw(a4, MemOperand(a0, OFFSET_OF(T, lwr_0))); 958 __ sw(a4, MemOperand(a0, offsetof(T, lwr_0)));
959 959
960 __ lw(a5, MemOperand(a0, OFFSET_OF(T, reg_init))); 960 __ lw(a5, MemOperand(a0, offsetof(T, reg_init)));
961 __ lwr(a5, MemOperand(a0, OFFSET_OF(T, mem_init) + 1)); 961 __ lwr(a5, MemOperand(a0, offsetof(T, mem_init) + 1));
962 __ sw(a5, MemOperand(a0, OFFSET_OF(T, lwr_1))); 962 __ sw(a5, MemOperand(a0, offsetof(T, lwr_1)));
963 963
964 __ lw(a6, MemOperand(a0, OFFSET_OF(T, reg_init))); 964 __ lw(a6, MemOperand(a0, offsetof(T, reg_init)));
965 __ lwr(a6, MemOperand(a0, OFFSET_OF(T, mem_init) + 2)); 965 __ lwr(a6, MemOperand(a0, offsetof(T, mem_init) + 2));
966 __ sw(a6, MemOperand(a0, OFFSET_OF(T, lwr_2)) ); 966 __ sw(a6, MemOperand(a0, offsetof(T, lwr_2)) );
967 967
968 __ lw(a7, MemOperand(a0, OFFSET_OF(T, reg_init))); 968 __ lw(a7, MemOperand(a0, offsetof(T, reg_init)));
969 __ lwr(a7, MemOperand(a0, OFFSET_OF(T, mem_init) + 3)); 969 __ lwr(a7, MemOperand(a0, offsetof(T, mem_init) + 3));
970 __ sw(a7, MemOperand(a0, OFFSET_OF(T, lwr_3)) ); 970 __ sw(a7, MemOperand(a0, offsetof(T, lwr_3)) );
971 971
972 // Test all combinations of SWL and vAddr. 972 // Test all combinations of SWL and vAddr.
973 __ lw(a4, MemOperand(a0, OFFSET_OF(T, mem_init))); 973 __ lw(a4, MemOperand(a0, offsetof(T, mem_init)));
974 __ sw(a4, MemOperand(a0, OFFSET_OF(T, swl_0))); 974 __ sw(a4, MemOperand(a0, offsetof(T, swl_0)));
975 __ lw(a4, MemOperand(a0, OFFSET_OF(T, reg_init))); 975 __ lw(a4, MemOperand(a0, offsetof(T, reg_init)));
976 __ swl(a4, MemOperand(a0, OFFSET_OF(T, swl_0))); 976 __ swl(a4, MemOperand(a0, offsetof(T, swl_0)));
977 977
978 __ lw(a5, MemOperand(a0, OFFSET_OF(T, mem_init))); 978 __ lw(a5, MemOperand(a0, offsetof(T, mem_init)));
979 __ sw(a5, MemOperand(a0, OFFSET_OF(T, swl_1))); 979 __ sw(a5, MemOperand(a0, offsetof(T, swl_1)));
980 __ lw(a5, MemOperand(a0, OFFSET_OF(T, reg_init))); 980 __ lw(a5, MemOperand(a0, offsetof(T, reg_init)));
981 __ swl(a5, MemOperand(a0, OFFSET_OF(T, swl_1) + 1)); 981 __ swl(a5, MemOperand(a0, offsetof(T, swl_1) + 1));
982 982
983 __ lw(a6, MemOperand(a0, OFFSET_OF(T, mem_init))); 983 __ lw(a6, MemOperand(a0, offsetof(T, mem_init)));
984 __ sw(a6, MemOperand(a0, OFFSET_OF(T, swl_2))); 984 __ sw(a6, MemOperand(a0, offsetof(T, swl_2)));
985 __ lw(a6, MemOperand(a0, OFFSET_OF(T, reg_init))); 985 __ lw(a6, MemOperand(a0, offsetof(T, reg_init)));
986 __ swl(a6, MemOperand(a0, OFFSET_OF(T, swl_2) + 2)); 986 __ swl(a6, MemOperand(a0, offsetof(T, swl_2) + 2));
987 987
988 __ lw(a7, MemOperand(a0, OFFSET_OF(T, mem_init))); 988 __ lw(a7, MemOperand(a0, offsetof(T, mem_init)));
989 __ sw(a7, MemOperand(a0, OFFSET_OF(T, swl_3))); 989 __ sw(a7, MemOperand(a0, offsetof(T, swl_3)));
990 __ lw(a7, MemOperand(a0, OFFSET_OF(T, reg_init))); 990 __ lw(a7, MemOperand(a0, offsetof(T, reg_init)));
991 __ swl(a7, MemOperand(a0, OFFSET_OF(T, swl_3) + 3)); 991 __ swl(a7, MemOperand(a0, offsetof(T, swl_3) + 3));
992 992
993 // Test all combinations of SWR and vAddr. 993 // Test all combinations of SWR and vAddr.
994 __ lw(a4, MemOperand(a0, OFFSET_OF(T, mem_init))); 994 __ lw(a4, MemOperand(a0, offsetof(T, mem_init)));
995 __ sw(a4, MemOperand(a0, OFFSET_OF(T, swr_0))); 995 __ sw(a4, MemOperand(a0, offsetof(T, swr_0)));
996 __ lw(a4, MemOperand(a0, OFFSET_OF(T, reg_init))); 996 __ lw(a4, MemOperand(a0, offsetof(T, reg_init)));
997 __ swr(a4, MemOperand(a0, OFFSET_OF(T, swr_0))); 997 __ swr(a4, MemOperand(a0, offsetof(T, swr_0)));
998 998
999 __ lw(a5, MemOperand(a0, OFFSET_OF(T, mem_init))); 999 __ lw(a5, MemOperand(a0, offsetof(T, mem_init)));
1000 __ sw(a5, MemOperand(a0, OFFSET_OF(T, swr_1))); 1000 __ sw(a5, MemOperand(a0, offsetof(T, swr_1)));
1001 __ lw(a5, MemOperand(a0, OFFSET_OF(T, reg_init))); 1001 __ lw(a5, MemOperand(a0, offsetof(T, reg_init)));
1002 __ swr(a5, MemOperand(a0, OFFSET_OF(T, swr_1) + 1)); 1002 __ swr(a5, MemOperand(a0, offsetof(T, swr_1) + 1));
1003 1003
1004 __ lw(a6, MemOperand(a0, OFFSET_OF(T, mem_init))); 1004 __ lw(a6, MemOperand(a0, offsetof(T, mem_init)));
1005 __ sw(a6, MemOperand(a0, OFFSET_OF(T, swr_2))); 1005 __ sw(a6, MemOperand(a0, offsetof(T, swr_2)));
1006 __ lw(a6, MemOperand(a0, OFFSET_OF(T, reg_init))); 1006 __ lw(a6, MemOperand(a0, offsetof(T, reg_init)));
1007 __ swr(a6, MemOperand(a0, OFFSET_OF(T, swr_2) + 2)); 1007 __ swr(a6, MemOperand(a0, offsetof(T, swr_2) + 2));
1008 1008
1009 __ lw(a7, MemOperand(a0, OFFSET_OF(T, mem_init))); 1009 __ lw(a7, MemOperand(a0, offsetof(T, mem_init)));
1010 __ sw(a7, MemOperand(a0, OFFSET_OF(T, swr_3))); 1010 __ sw(a7, MemOperand(a0, offsetof(T, swr_3)));
1011 __ lw(a7, MemOperand(a0, OFFSET_OF(T, reg_init))); 1011 __ lw(a7, MemOperand(a0, offsetof(T, reg_init)));
1012 __ swr(a7, MemOperand(a0, OFFSET_OF(T, swr_3) + 3)); 1012 __ swr(a7, MemOperand(a0, offsetof(T, swr_3) + 3));
1013 1013
1014 __ jr(ra); 1014 __ jr(ra);
1015 __ nop(); 1015 __ nop();
1016 1016
1017 CodeDesc desc; 1017 CodeDesc desc;
1018 assm.GetCode(&desc); 1018 assm.GetCode(&desc);
1019 Handle<Code> code = isolate->factory()->NewCode( 1019 Handle<Code> code = isolate->factory()->NewCode(
1020 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 1020 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
1021 F3 f = FUNCTION_CAST<F3>(code->entry()); 1021 F3 f = FUNCTION_CAST<F3>(code->entry());
1022 t.reg_init = 0xaabbccdd; 1022 t.reg_init = 0xaabbccdd;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
1060 int32_t y2; 1060 int32_t y2;
1061 int32_t y3; 1061 int32_t y3;
1062 int32_t y4; 1062 int32_t y4;
1063 } T; 1063 } T;
1064 T t; 1064 T t;
1065 1065
1066 MacroAssembler assm(isolate, NULL, 0); 1066 MacroAssembler assm(isolate, NULL, 0);
1067 1067
1068 __ mov(t2, fp); // Save frame pointer. 1068 __ mov(t2, fp); // Save frame pointer.
1069 __ mov(fp, a0); // Access struct T by fp. 1069 __ mov(fp, a0); // Access struct T by fp.
1070 __ lw(a4, MemOperand(a0, OFFSET_OF(T, y))); 1070 __ lw(a4, MemOperand(a0, offsetof(T, y)));
1071 __ lw(a7, MemOperand(a0, OFFSET_OF(T, y4))); 1071 __ lw(a7, MemOperand(a0, offsetof(T, y4)));
1072 1072
1073 __ addu(a5, a4, a7); 1073 __ addu(a5, a4, a7);
1074 __ subu(t0, a4, a7); 1074 __ subu(t0, a4, a7);
1075 __ nop(); 1075 __ nop();
1076 __ push(a4); // These instructions disappear after opt. 1076 __ push(a4); // These instructions disappear after opt.
1077 __ Pop(); 1077 __ Pop();
1078 __ addu(a4, a4, a4); 1078 __ addu(a4, a4, a4);
1079 __ nop(); 1079 __ nop();
1080 __ Pop(); // These instructions disappear after opt. 1080 __ Pop(); // These instructions disappear after opt.
1081 __ push(a7); 1081 __ push(a7);
1082 __ nop(); 1082 __ nop();
1083 __ push(a7); // These instructions disappear after opt. 1083 __ push(a7); // These instructions disappear after opt.
1084 __ pop(a7); 1084 __ pop(a7);
1085 __ nop(); 1085 __ nop();
1086 __ push(a7); 1086 __ push(a7);
1087 __ pop(t0); 1087 __ pop(t0);
1088 __ nop(); 1088 __ nop();
1089 __ sw(a4, MemOperand(fp, OFFSET_OF(T, y))); 1089 __ sw(a4, MemOperand(fp, offsetof(T, y)));
1090 __ lw(a4, MemOperand(fp, OFFSET_OF(T, y))); 1090 __ lw(a4, MemOperand(fp, offsetof(T, y)));
1091 __ nop(); 1091 __ nop();
1092 __ sw(a4, MemOperand(fp, OFFSET_OF(T, y))); 1092 __ sw(a4, MemOperand(fp, offsetof(T, y)));
1093 __ lw(a5, MemOperand(fp, OFFSET_OF(T, y))); 1093 __ lw(a5, MemOperand(fp, offsetof(T, y)));
1094 __ nop(); 1094 __ nop();
1095 __ push(a5); 1095 __ push(a5);
1096 __ lw(a5, MemOperand(fp, OFFSET_OF(T, y))); 1096 __ lw(a5, MemOperand(fp, offsetof(T, y)));
1097 __ pop(a5); 1097 __ pop(a5);
1098 __ nop(); 1098 __ nop();
1099 __ push(a5); 1099 __ push(a5);
1100 __ lw(a6, MemOperand(fp, OFFSET_OF(T, y))); 1100 __ lw(a6, MemOperand(fp, offsetof(T, y)));
1101 __ pop(a5); 1101 __ pop(a5);
1102 __ nop(); 1102 __ nop();
1103 __ push(a5); 1103 __ push(a5);
1104 __ lw(a6, MemOperand(fp, OFFSET_OF(T, y))); 1104 __ lw(a6, MemOperand(fp, offsetof(T, y)));
1105 __ pop(a6); 1105 __ pop(a6);
1106 __ nop(); 1106 __ nop();
1107 __ push(a6); 1107 __ push(a6);
1108 __ lw(a6, MemOperand(fp, OFFSET_OF(T, y))); 1108 __ lw(a6, MemOperand(fp, offsetof(T, y)));
1109 __ pop(a5); 1109 __ pop(a5);
1110 __ nop(); 1110 __ nop();
1111 __ push(a5); 1111 __ push(a5);
1112 __ lw(a6, MemOperand(fp, OFFSET_OF(T, y))); 1112 __ lw(a6, MemOperand(fp, offsetof(T, y)));
1113 __ pop(a7); 1113 __ pop(a7);
1114 __ nop(); 1114 __ nop();
1115 1115
1116 __ mov(fp, t2); 1116 __ mov(fp, t2);
1117 __ jr(ra); 1117 __ jr(ra);
1118 __ nop(); 1118 __ nop();
1119 1119
1120 CodeDesc desc; 1120 CodeDesc desc;
1121 assm.GetCode(&desc); 1121 assm.GetCode(&desc);
1122 Handle<Code> code = isolate->factory()->NewCode( 1122 Handle<Code> code = isolate->factory()->NewCode(
(...skipping 24 matching lines...) Expand all
1147 double cvt_small_out; 1147 double cvt_small_out;
1148 uint32_t trunc_big_out; 1148 uint32_t trunc_big_out;
1149 uint32_t trunc_small_out; 1149 uint32_t trunc_small_out;
1150 uint32_t cvt_big_in; 1150 uint32_t cvt_big_in;
1151 uint32_t cvt_small_in; 1151 uint32_t cvt_small_in;
1152 } T; 1152 } T;
1153 T t; 1153 T t;
1154 1154
1155 MacroAssembler assm(isolate, NULL, 0); 1155 MacroAssembler assm(isolate, NULL, 0);
1156 1156
1157 __ sw(a4, MemOperand(a0, OFFSET_OF(T, cvt_small_in))); 1157 __ sw(a4, MemOperand(a0, offsetof(T, cvt_small_in)));
1158 __ Cvt_d_uw(f10, a4, f22); 1158 __ Cvt_d_uw(f10, a4, f22);
1159 __ sdc1(f10, MemOperand(a0, OFFSET_OF(T, cvt_small_out))); 1159 __ sdc1(f10, MemOperand(a0, offsetof(T, cvt_small_out)));
1160 1160
1161 __ Trunc_uw_d(f10, f10, f22); 1161 __ Trunc_uw_d(f10, f10, f22);
1162 __ swc1(f10, MemOperand(a0, OFFSET_OF(T, trunc_small_out))); 1162 __ swc1(f10, MemOperand(a0, offsetof(T, trunc_small_out)));
1163 1163
1164 __ sw(a4, MemOperand(a0, OFFSET_OF(T, cvt_big_in))); 1164 __ sw(a4, MemOperand(a0, offsetof(T, cvt_big_in)));
1165 __ Cvt_d_uw(f8, a4, f22); 1165 __ Cvt_d_uw(f8, a4, f22);
1166 __ sdc1(f8, MemOperand(a0, OFFSET_OF(T, cvt_big_out))); 1166 __ sdc1(f8, MemOperand(a0, offsetof(T, cvt_big_out)));
1167 1167
1168 __ Trunc_uw_d(f8, f8, f22); 1168 __ Trunc_uw_d(f8, f8, f22);
1169 __ swc1(f8, MemOperand(a0, OFFSET_OF(T, trunc_big_out))); 1169 __ swc1(f8, MemOperand(a0, offsetof(T, trunc_big_out)));
1170 1170
1171 __ jr(ra); 1171 __ jr(ra);
1172 __ nop(); 1172 __ nop();
1173 1173
1174 CodeDesc desc; 1174 CodeDesc desc;
1175 assm.GetCode(&desc); 1175 assm.GetCode(&desc);
1176 Handle<Code> code = isolate->factory()->NewCode( 1176 Handle<Code> code = isolate->factory()->NewCode(
1177 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 1177 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
1178 F3 f = FUNCTION_CAST<F3>(code->entry()); 1178 F3 f = FUNCTION_CAST<F3>(code->entry());
1179 1179
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
1229 1229
1230 #undef ROUND_STRUCT_ELEMENT 1230 #undef ROUND_STRUCT_ELEMENT
1231 1231
1232 MacroAssembler assm(isolate, NULL, 0); 1232 MacroAssembler assm(isolate, NULL, 0);
1233 1233
1234 // Save FCSR. 1234 // Save FCSR.
1235 __ cfc1(a1, FCSR); 1235 __ cfc1(a1, FCSR);
1236 // Disable FPU exceptions. 1236 // Disable FPU exceptions.
1237 __ ctc1(zero_reg, FCSR); 1237 __ ctc1(zero_reg, FCSR);
1238 #define RUN_ROUND_TEST(x) \ 1238 #define RUN_ROUND_TEST(x) \
1239 __ ldc1(f0, MemOperand(a0, OFFSET_OF(T, round_up_in))); \ 1239 __ ldc1(f0, MemOperand(a0, offsetof(T, round_up_in))); \
1240 __ x##_w_d(f0, f0); \ 1240 __ x##_w_d(f0, f0); \
1241 __ swc1(f0, MemOperand(a0, OFFSET_OF(T, x##_up_out))); \ 1241 __ swc1(f0, MemOperand(a0, offsetof(T, x##_up_out))); \
1242 \ 1242 \
1243 __ ldc1(f0, MemOperand(a0, OFFSET_OF(T, round_down_in))); \ 1243 __ ldc1(f0, MemOperand(a0, offsetof(T, round_down_in))); \
1244 __ x##_w_d(f0, f0); \ 1244 __ x##_w_d(f0, f0); \
1245 __ swc1(f0, MemOperand(a0, OFFSET_OF(T, x##_down_out))); \ 1245 __ swc1(f0, MemOperand(a0, offsetof(T, x##_down_out))); \
1246 \ 1246 \
1247 __ ldc1(f0, MemOperand(a0, OFFSET_OF(T, neg_round_up_in))); \ 1247 __ ldc1(f0, MemOperand(a0, offsetof(T, neg_round_up_in))); \
1248 __ x##_w_d(f0, f0); \ 1248 __ x##_w_d(f0, f0); \
1249 __ swc1(f0, MemOperand(a0, OFFSET_OF(T, neg_##x##_up_out))); \ 1249 __ swc1(f0, MemOperand(a0, offsetof(T, neg_##x##_up_out))); \
1250 \ 1250 \
1251 __ ldc1(f0, MemOperand(a0, OFFSET_OF(T, neg_round_down_in))); \ 1251 __ ldc1(f0, MemOperand(a0, offsetof(T, neg_round_down_in))); \
1252 __ x##_w_d(f0, f0); \ 1252 __ x##_w_d(f0, f0); \
1253 __ swc1(f0, MemOperand(a0, OFFSET_OF(T, neg_##x##_down_out))); \ 1253 __ swc1(f0, MemOperand(a0, offsetof(T, neg_##x##_down_out))); \
1254 \ 1254 \
1255 __ ldc1(f0, MemOperand(a0, OFFSET_OF(T, err1_in))); \ 1255 __ ldc1(f0, MemOperand(a0, offsetof(T, err1_in))); \
1256 __ ctc1(zero_reg, FCSR); \ 1256 __ ctc1(zero_reg, FCSR); \
1257 __ x##_w_d(f0, f0); \ 1257 __ x##_w_d(f0, f0); \
1258 __ cfc1(a2, FCSR); \ 1258 __ cfc1(a2, FCSR); \
1259 __ sw(a2, MemOperand(a0, OFFSET_OF(T, x##_err1_out))); \ 1259 __ sw(a2, MemOperand(a0, offsetof(T, x##_err1_out))); \
1260 \ 1260 \
1261 __ ldc1(f0, MemOperand(a0, OFFSET_OF(T, err2_in))); \ 1261 __ ldc1(f0, MemOperand(a0, offsetof(T, err2_in))); \
1262 __ ctc1(zero_reg, FCSR); \ 1262 __ ctc1(zero_reg, FCSR); \
1263 __ x##_w_d(f0, f0); \ 1263 __ x##_w_d(f0, f0); \
1264 __ cfc1(a2, FCSR); \ 1264 __ cfc1(a2, FCSR); \
1265 __ sw(a2, MemOperand(a0, OFFSET_OF(T, x##_err2_out))); \ 1265 __ sw(a2, MemOperand(a0, offsetof(T, x##_err2_out))); \
1266 \ 1266 \
1267 __ ldc1(f0, MemOperand(a0, OFFSET_OF(T, err3_in))); \ 1267 __ ldc1(f0, MemOperand(a0, offsetof(T, err3_in))); \
1268 __ ctc1(zero_reg, FCSR); \ 1268 __ ctc1(zero_reg, FCSR); \
1269 __ x##_w_d(f0, f0); \ 1269 __ x##_w_d(f0, f0); \
1270 __ cfc1(a2, FCSR); \ 1270 __ cfc1(a2, FCSR); \
1271 __ sw(a2, MemOperand(a0, OFFSET_OF(T, x##_err3_out))); \ 1271 __ sw(a2, MemOperand(a0, offsetof(T, x##_err3_out))); \
1272 \ 1272 \
1273 __ ldc1(f0, MemOperand(a0, OFFSET_OF(T, err4_in))); \ 1273 __ ldc1(f0, MemOperand(a0, offsetof(T, err4_in))); \
1274 __ ctc1(zero_reg, FCSR); \ 1274 __ ctc1(zero_reg, FCSR); \
1275 __ x##_w_d(f0, f0); \ 1275 __ x##_w_d(f0, f0); \
1276 __ cfc1(a2, FCSR); \ 1276 __ cfc1(a2, FCSR); \
1277 __ sw(a2, MemOperand(a0, OFFSET_OF(T, x##_err4_out))); \ 1277 __ sw(a2, MemOperand(a0, offsetof(T, x##_err4_out))); \
1278 __ swc1(f0, MemOperand(a0, OFFSET_OF(T, x##_invalid_result))); 1278 __ swc1(f0, MemOperand(a0, offsetof(T, x##_invalid_result)));
1279 1279
1280 RUN_ROUND_TEST(round) 1280 RUN_ROUND_TEST(round)
1281 RUN_ROUND_TEST(floor) 1281 RUN_ROUND_TEST(floor)
1282 RUN_ROUND_TEST(ceil) 1282 RUN_ROUND_TEST(ceil)
1283 RUN_ROUND_TEST(trunc) 1283 RUN_ROUND_TEST(trunc)
1284 RUN_ROUND_TEST(cvt) 1284 RUN_ROUND_TEST(cvt)
1285 1285
1286 // Restore FCSR. 1286 // Restore FCSR.
1287 __ ctc1(a1, FCSR); 1287 __ ctc1(a1, FCSR);
1288 1288
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
1356 int64_t r6; 1356 int64_t r6;
1357 uint32_t ui; 1357 uint32_t ui;
1358 int32_t si; 1358 int32_t si;
1359 } T; 1359 } T;
1360 T t; 1360 T t;
1361 1361
1362 Assembler assm(isolate, NULL, 0); 1362 Assembler assm(isolate, NULL, 0);
1363 Label L, C; 1363 Label L, C;
1364 1364
1365 // Basic 32-bit word load/store, with un-signed data. 1365 // Basic 32-bit word load/store, with un-signed data.
1366 __ lw(a4, MemOperand(a0, OFFSET_OF(T, ui))); 1366 __ lw(a4, MemOperand(a0, offsetof(T, ui)));
1367 __ sw(a4, MemOperand(a0, OFFSET_OF(T, r1))); 1367 __ sw(a4, MemOperand(a0, offsetof(T, r1)));
1368 1368
1369 // Check that the data got zero-extended into 64-bit a4. 1369 // Check that the data got zero-extended into 64-bit a4.
1370 __ sd(a4, MemOperand(a0, OFFSET_OF(T, r2))); 1370 __ sd(a4, MemOperand(a0, offsetof(T, r2)));
1371 1371
1372 // Basic 32-bit word load/store, with SIGNED data. 1372 // Basic 32-bit word load/store, with SIGNED data.
1373 __ lw(a5, MemOperand(a0, OFFSET_OF(T, si))); 1373 __ lw(a5, MemOperand(a0, offsetof(T, si)));
1374 __ sw(a5, MemOperand(a0, OFFSET_OF(T, r3))); 1374 __ sw(a5, MemOperand(a0, offsetof(T, r3)));
1375 1375
1376 // Check that the data got sign-extended into 64-bit a4. 1376 // Check that the data got sign-extended into 64-bit a4.
1377 __ sd(a5, MemOperand(a0, OFFSET_OF(T, r4))); 1377 __ sd(a5, MemOperand(a0, offsetof(T, r4)));
1378 1378
1379 // 32-bit UNSIGNED word load/store, with SIGNED data. 1379 // 32-bit UNSIGNED word load/store, with SIGNED data.
1380 __ lwu(a6, MemOperand(a0, OFFSET_OF(T, si))); 1380 __ lwu(a6, MemOperand(a0, offsetof(T, si)));
1381 __ sw(a6, MemOperand(a0, OFFSET_OF(T, r5))); 1381 __ sw(a6, MemOperand(a0, offsetof(T, r5)));
1382 1382
1383 // Check that the data got zero-extended into 64-bit a4. 1383 // Check that the data got zero-extended into 64-bit a4.
1384 __ sd(a6, MemOperand(a0, OFFSET_OF(T, r6))); 1384 __ sd(a6, MemOperand(a0, offsetof(T, r6)));
1385 1385
1386 // lh with positive data. 1386 // lh with positive data.
1387 __ lh(a5, MemOperand(a0, OFFSET_OF(T, ui))); 1387 __ lh(a5, MemOperand(a0, offsetof(T, ui)));
1388 __ sw(a5, MemOperand(a0, OFFSET_OF(T, r2))); 1388 __ sw(a5, MemOperand(a0, offsetof(T, r2)));
1389 1389
1390 // lh with negative data. 1390 // lh with negative data.
1391 __ lh(a6, MemOperand(a0, OFFSET_OF(T, si))); 1391 __ lh(a6, MemOperand(a0, offsetof(T, si)));
1392 __ sw(a6, MemOperand(a0, OFFSET_OF(T, r3))); 1392 __ sw(a6, MemOperand(a0, offsetof(T, r3)));
1393 1393
1394 // lhu with negative data. 1394 // lhu with negative data.
1395 __ lhu(a7, MemOperand(a0, OFFSET_OF(T, si))); 1395 __ lhu(a7, MemOperand(a0, offsetof(T, si)));
1396 __ sw(a7, MemOperand(a0, OFFSET_OF(T, r4))); 1396 __ sw(a7, MemOperand(a0, offsetof(T, r4)));
1397 1397
1398 // lb with negative data. 1398 // lb with negative data.
1399 __ lb(t0, MemOperand(a0, OFFSET_OF(T, si))); 1399 __ lb(t0, MemOperand(a0, offsetof(T, si)));
1400 __ sw(t0, MemOperand(a0, OFFSET_OF(T, r5))); 1400 __ sw(t0, MemOperand(a0, offsetof(T, r5)));
1401 1401
1402 // // sh writes only 1/2 of word. 1402 // // sh writes only 1/2 of word.
1403 __ lui(t1, 0x3333); 1403 __ lui(t1, 0x3333);
1404 __ ori(t1, t1, 0x3333); 1404 __ ori(t1, t1, 0x3333);
1405 __ sw(t1, MemOperand(a0, OFFSET_OF(T, r6))); 1405 __ sw(t1, MemOperand(a0, offsetof(T, r6)));
1406 __ lhu(t1, MemOperand(a0, OFFSET_OF(T, si))); 1406 __ lhu(t1, MemOperand(a0, offsetof(T, si)));
1407 __ sh(t1, MemOperand(a0, OFFSET_OF(T, r6))); 1407 __ sh(t1, MemOperand(a0, offsetof(T, r6)));
1408 1408
1409 __ jr(ra); 1409 __ jr(ra);
1410 __ nop(); 1410 __ nop();
1411 1411
1412 CodeDesc desc; 1412 CodeDesc desc;
1413 assm.GetCode(&desc); 1413 assm.GetCode(&desc);
1414 Handle<Code> code = isolate->factory()->NewCode( 1414 Handle<Code> code = isolate->factory()->NewCode(
1415 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 1415 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
1416 F3 f = FUNCTION_CAST<F3>(code->entry()); 1416 F3 f = FUNCTION_CAST<F3>(code->entry());
1417 t.ui = 0x44332211; 1417 t.ui = 0x44332211;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
1459 float i; 1459 float i;
1460 float j; 1460 float j;
1461 float k; 1461 float k;
1462 float l; 1462 float l;
1463 } Test; 1463 } Test;
1464 1464
1465 Test test; 1465 Test test;
1466 // Integer part of test. 1466 // Integer part of test.
1467 __ addiu(t1, zero_reg, 1); // t1 = 1 1467 __ addiu(t1, zero_reg, 1); // t1 = 1
1468 __ seleqz(t3, t1, zero_reg); // t3 = 1 1468 __ seleqz(t3, t1, zero_reg); // t3 = 1
1469 __ sw(t3, MemOperand(a0, OFFSET_OF(Test, a))); // a = 1 1469 __ sw(t3, MemOperand(a0, offsetof(Test, a))); // a = 1
1470 __ seleqz(t2, t1, t1); // t2 = 0 1470 __ seleqz(t2, t1, t1); // t2 = 0
1471 __ sw(t2, MemOperand(a0, OFFSET_OF(Test, b))); // b = 0 1471 __ sw(t2, MemOperand(a0, offsetof(Test, b))); // b = 0
1472 __ selnez(t3, t1, zero_reg); // t3 = 1; 1472 __ selnez(t3, t1, zero_reg); // t3 = 1;
1473 __ sw(t3, MemOperand(a0, OFFSET_OF(Test, c))); // c = 0 1473 __ sw(t3, MemOperand(a0, offsetof(Test, c))); // c = 0
1474 __ selnez(t3, t1, t1); // t3 = 1 1474 __ selnez(t3, t1, t1); // t3 = 1
1475 __ sw(t3, MemOperand(a0, OFFSET_OF(Test, d))); // d = 1 1475 __ sw(t3, MemOperand(a0, offsetof(Test, d))); // d = 1
1476 // Floating point part of test. 1476 // Floating point part of test.
1477 __ ldc1(f0, MemOperand(a0, OFFSET_OF(Test, e)) ); // src 1477 __ ldc1(f0, MemOperand(a0, offsetof(Test, e)) ); // src
1478 __ ldc1(f2, MemOperand(a0, OFFSET_OF(Test, f)) ); // test 1478 __ ldc1(f2, MemOperand(a0, offsetof(Test, f)) ); // test
1479 __ lwc1(f8, MemOperand(a0, OFFSET_OF(Test, i)) ); // src 1479 __ lwc1(f8, MemOperand(a0, offsetof(Test, i)) ); // src
1480 __ lwc1(f10, MemOperand(a0, OFFSET_OF(Test, j)) ); // test 1480 __ lwc1(f10, MemOperand(a0, offsetof(Test, j)) ); // test
1481 __ seleqz_d(f4, f0, f2); 1481 __ seleqz_d(f4, f0, f2);
1482 __ selnez_d(f6, f0, f2); 1482 __ selnez_d(f6, f0, f2);
1483 __ seleqz_s(f12, f8, f10); 1483 __ seleqz_s(f12, f8, f10);
1484 __ selnez_s(f14, f8, f10); 1484 __ selnez_s(f14, f8, f10);
1485 __ sdc1(f4, MemOperand(a0, OFFSET_OF(Test, g)) ); // src 1485 __ sdc1(f4, MemOperand(a0, offsetof(Test, g)) ); // src
1486 __ sdc1(f6, MemOperand(a0, OFFSET_OF(Test, h)) ); // src 1486 __ sdc1(f6, MemOperand(a0, offsetof(Test, h)) ); // src
1487 __ swc1(f12, MemOperand(a0, OFFSET_OF(Test, k)) ); // src 1487 __ swc1(f12, MemOperand(a0, offsetof(Test, k)) ); // src
1488 __ swc1(f14, MemOperand(a0, OFFSET_OF(Test, l)) ); // src 1488 __ swc1(f14, MemOperand(a0, offsetof(Test, l)) ); // src
1489 __ jr(ra); 1489 __ jr(ra);
1490 __ nop(); 1490 __ nop();
1491 CodeDesc desc; 1491 CodeDesc desc;
1492 assm.GetCode(&desc); 1492 assm.GetCode(&desc);
1493 Handle<Code> code = isolate->factory()->NewCode( 1493 Handle<Code> code = isolate->factory()->NewCode(
1494 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 1494 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
1495 F3 f = FUNCTION_CAST<F3>(code->entry()); 1495 F3 f = FUNCTION_CAST<F3>(code->entry());
1496 1496
1497 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 1497 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0));
1498 1498
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
1567 double inputsa[tableLength] = {2.0, 3.0, dblNaN, 3.0, dblNaN}; 1567 double inputsa[tableLength] = {2.0, 3.0, dblNaN, 3.0, dblNaN};
1568 double inputsb[tableLength] = {3.0, 2.0, 3.0, dblNaN, dblNaN}; 1568 double inputsb[tableLength] = {3.0, 2.0, 3.0, dblNaN, dblNaN};
1569 double outputsdmin[tableLength] = {2.0, 2.0, 3.0, 3.0, dblNaN}; 1569 double outputsdmin[tableLength] = {2.0, 2.0, 3.0, 3.0, dblNaN};
1570 double outputsdmax[tableLength] = {3.0, 3.0, 3.0, 3.0, dblNaN}; 1570 double outputsdmax[tableLength] = {3.0, 3.0, 3.0, 3.0, dblNaN};
1571 1571
1572 float inputse[tableLength] = {2.0, 3.0, fltNaN, 3.0, fltNaN}; 1572 float inputse[tableLength] = {2.0, 3.0, fltNaN, 3.0, fltNaN};
1573 float inputsf[tableLength] = {3.0, 2.0, 3.0, fltNaN, fltNaN}; 1573 float inputsf[tableLength] = {3.0, 2.0, 3.0, fltNaN, fltNaN};
1574 float outputsfmin[tableLength] = {2.0, 2.0, 3.0, 3.0, fltNaN}; 1574 float outputsfmin[tableLength] = {2.0, 2.0, 3.0, 3.0, fltNaN};
1575 float outputsfmax[tableLength] = {3.0, 3.0, 3.0, 3.0, fltNaN}; 1575 float outputsfmax[tableLength] = {3.0, 3.0, 3.0, 3.0, fltNaN};
1576 1576
1577 __ ldc1(f4, MemOperand(a0, OFFSET_OF(TestFloat, a))); 1577 __ ldc1(f4, MemOperand(a0, offsetof(TestFloat, a)));
1578 __ ldc1(f8, MemOperand(a0, OFFSET_OF(TestFloat, b))); 1578 __ ldc1(f8, MemOperand(a0, offsetof(TestFloat, b)));
1579 __ lwc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, e))); 1579 __ lwc1(f2, MemOperand(a0, offsetof(TestFloat, e)));
1580 __ lwc1(f6, MemOperand(a0, OFFSET_OF(TestFloat, f))); 1580 __ lwc1(f6, MemOperand(a0, offsetof(TestFloat, f)));
1581 __ min_d(f10, f4, f8); 1581 __ min_d(f10, f4, f8);
1582 __ max_d(f12, f4, f8); 1582 __ max_d(f12, f4, f8);
1583 __ min_s(f14, f2, f6); 1583 __ min_s(f14, f2, f6);
1584 __ max_s(f16, f2, f6); 1584 __ max_s(f16, f2, f6);
1585 __ sdc1(f10, MemOperand(a0, OFFSET_OF(TestFloat, c))); 1585 __ sdc1(f10, MemOperand(a0, offsetof(TestFloat, c)));
1586 __ sdc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, d))); 1586 __ sdc1(f12, MemOperand(a0, offsetof(TestFloat, d)));
1587 __ swc1(f14, MemOperand(a0, OFFSET_OF(TestFloat, g))); 1587 __ swc1(f14, MemOperand(a0, offsetof(TestFloat, g)));
1588 __ swc1(f16, MemOperand(a0, OFFSET_OF(TestFloat, h))); 1588 __ swc1(f16, MemOperand(a0, offsetof(TestFloat, h)));
1589 __ jr(ra); 1589 __ jr(ra);
1590 __ nop(); 1590 __ nop();
1591 1591
1592 CodeDesc desc; 1592 CodeDesc desc;
1593 assm.GetCode(&desc); 1593 assm.GetCode(&desc);
1594 Handle<Code> code = isolate->factory()->NewCode( 1594 Handle<Code> code = isolate->factory()->NewCode(
1595 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 1595 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
1596 F3 f = FUNCTION_CAST<F3>(code->entry()); 1596 F3 f = FUNCTION_CAST<F3>(code->entry());
1597 for (int i = 0; i < tableLength; i++) { 1597 for (int i = 0; i < tableLength; i++) {
1598 test.a = inputsa[i]; 1598 test.a = inputsa[i];
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
1689 2.0, 2.0, 2.0, 3.0, 3.0, 3.0, 1689 2.0, 2.0, 2.0, 3.0, 3.0, 3.0,
1690 -3.0, -3.0, -3.0, -4.0, -4.0, -4.0, 1690 -3.0, -3.0, -3.0, -4.0, -4.0, -4.0,
1691 37778931862957161709568.0, 37778931862957161709569.0, 1691 37778931862957161709568.0, 37778931862957161709569.0,
1692 37778931862957161709580.0, 37778931862957161709581.0, 1692 37778931862957161709580.0, 37778931862957161709581.0,
1693 37778931862957161709582.0, 37778931862957161709583.0, 1693 37778931862957161709582.0, 37778931862957161709583.0,
1694 37778931862957161709584.0, 37778931862957161709585.0, 1694 37778931862957161709584.0, 37778931862957161709585.0,
1695 37778931862957161709586.0, 37778931862957161709587.0}; 1695 37778931862957161709586.0, 37778931862957161709587.0};
1696 int fcsr_inputs[4] = 1696 int fcsr_inputs[4] =
1697 {kRoundToNearest, kRoundToZero, kRoundToPlusInf, kRoundToMinusInf}; 1697 {kRoundToNearest, kRoundToZero, kRoundToPlusInf, kRoundToMinusInf};
1698 double* outputs[4] = {outputs_RN, outputs_RZ, outputs_RP, outputs_RM}; 1698 double* outputs[4] = {outputs_RN, outputs_RZ, outputs_RP, outputs_RM};
1699 __ ldc1(f4, MemOperand(a0, OFFSET_OF(TestFloat, a)) ); 1699 __ ldc1(f4, MemOperand(a0, offsetof(TestFloat, a)) );
1700 __ lw(t0, MemOperand(a0, OFFSET_OF(TestFloat, fcsr)) ); 1700 __ lw(t0, MemOperand(a0, offsetof(TestFloat, fcsr)) );
1701 __ ctc1(t0, FCSR); 1701 __ ctc1(t0, FCSR);
1702 __ rint_d(f8, f4); 1702 __ rint_d(f8, f4);
1703 __ sdc1(f8, MemOperand(a0, OFFSET_OF(TestFloat, b)) ); 1703 __ sdc1(f8, MemOperand(a0, offsetof(TestFloat, b)) );
1704 __ jr(ra); 1704 __ jr(ra);
1705 __ nop(); 1705 __ nop();
1706 1706
1707 CodeDesc desc; 1707 CodeDesc desc;
1708 assm.GetCode(&desc); 1708 assm.GetCode(&desc);
1709 Handle<Code> code = isolate->factory()->NewCode( 1709 Handle<Code> code = isolate->factory()->NewCode(
1710 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 1710 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
1711 F3 f = FUNCTION_CAST<F3>(code->entry()); 1711 F3 f = FUNCTION_CAST<F3>(code->entry());
1712 1712
1713 for (int j = 0; j < 4; j++) { 1713 for (int j = 0; j < 4; j++) {
(...skipping 18 matching lines...) Expand all
1732 typedef struct test { 1732 typedef struct test {
1733 double dd; 1733 double dd;
1734 double ds; 1734 double ds;
1735 double dt; 1735 double dt;
1736 float fd; 1736 float fd;
1737 float fs; 1737 float fs;
1738 float ft; 1738 float ft;
1739 } Test; 1739 } Test;
1740 1740
1741 Test test; 1741 Test test;
1742 __ ldc1(f0, MemOperand(a0, OFFSET_OF(Test, dd)) ); // test 1742 __ ldc1(f0, MemOperand(a0, offsetof(Test, dd)) ); // test
1743 __ ldc1(f2, MemOperand(a0, OFFSET_OF(Test, ds)) ); // src1 1743 __ ldc1(f2, MemOperand(a0, offsetof(Test, ds)) ); // src1
1744 __ ldc1(f4, MemOperand(a0, OFFSET_OF(Test, dt)) ); // src2 1744 __ ldc1(f4, MemOperand(a0, offsetof(Test, dt)) ); // src2
1745 __ lwc1(f6, MemOperand(a0, OFFSET_OF(Test, fd)) ); // test 1745 __ lwc1(f6, MemOperand(a0, offsetof(Test, fd)) ); // test
1746 __ lwc1(f8, MemOperand(a0, OFFSET_OF(Test, fs)) ); // src1 1746 __ lwc1(f8, MemOperand(a0, offsetof(Test, fs)) ); // src1
1747 __ lwc1(f10, MemOperand(a0, OFFSET_OF(Test, ft)) ); // src2 1747 __ lwc1(f10, MemOperand(a0, offsetof(Test, ft)) ); // src2
1748 __ sel_d(f0, f2, f4); 1748 __ sel_d(f0, f2, f4);
1749 __ sel_s(f6, f8, f10); 1749 __ sel_s(f6, f8, f10);
1750 __ sdc1(f0, MemOperand(a0, OFFSET_OF(Test, dd)) ); 1750 __ sdc1(f0, MemOperand(a0, offsetof(Test, dd)) );
1751 __ swc1(f6, MemOperand(a0, OFFSET_OF(Test, fd)) ); 1751 __ swc1(f6, MemOperand(a0, offsetof(Test, fd)) );
1752 __ jr(ra); 1752 __ jr(ra);
1753 __ nop(); 1753 __ nop();
1754 CodeDesc desc; 1754 CodeDesc desc;
1755 assm.GetCode(&desc); 1755 assm.GetCode(&desc);
1756 Handle<Code> code = isolate->factory()->NewCode( 1756 Handle<Code> code = isolate->factory()->NewCode(
1757 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 1757 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
1758 F3 f = FUNCTION_CAST<F3>(code->entry()); 1758 F3 f = FUNCTION_CAST<F3>(code->entry());
1759 1759
1760 const int test_size = 3; 1760 const int test_size = 3;
1761 const int input_size = 5; 1761 const int input_size = 5;
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
1866 2.0, 2.0, 2.0, 3.0, 3.0, 3.0, 1866 2.0, 2.0, 2.0, 3.0, 3.0, 3.0,
1867 -3.0, -3.0, -3.0, -4.0, -4.0, -4.0, 1867 -3.0, -3.0, -3.0, -4.0, -4.0, -4.0,
1868 37778931862957161709568.0, 37778931862957161709569.0, 1868 37778931862957161709568.0, 37778931862957161709569.0,
1869 37778931862957161709580.0, 37778931862957161709581.0, 1869 37778931862957161709580.0, 37778931862957161709581.0,
1870 37778931862957161709582.0, 37778931862957161709583.0, 1870 37778931862957161709582.0, 37778931862957161709583.0,
1871 37778931862957161709584.0, 37778931862957161709585.0, 1871 37778931862957161709584.0, 37778931862957161709585.0,
1872 37778931862957161709586.0, 37778931862957161709587.0}; 1872 37778931862957161709586.0, 37778931862957161709587.0};
1873 int fcsr_inputs[4] = 1873 int fcsr_inputs[4] =
1874 {kRoundToNearest, kRoundToZero, kRoundToPlusInf, kRoundToMinusInf}; 1874 {kRoundToNearest, kRoundToZero, kRoundToPlusInf, kRoundToMinusInf};
1875 float* outputs[4] = {outputs_RN, outputs_RZ, outputs_RP, outputs_RM}; 1875 float* outputs[4] = {outputs_RN, outputs_RZ, outputs_RP, outputs_RM};
1876 __ lwc1(f4, MemOperand(a0, OFFSET_OF(TestFloat, a)) ); 1876 __ lwc1(f4, MemOperand(a0, offsetof(TestFloat, a)) );
1877 __ lw(t0, MemOperand(a0, OFFSET_OF(TestFloat, fcsr)) ); 1877 __ lw(t0, MemOperand(a0, offsetof(TestFloat, fcsr)) );
1878 __ cfc1(t1, FCSR); 1878 __ cfc1(t1, FCSR);
1879 __ ctc1(t0, FCSR); 1879 __ ctc1(t0, FCSR);
1880 __ rint_s(f8, f4); 1880 __ rint_s(f8, f4);
1881 __ swc1(f8, MemOperand(a0, OFFSET_OF(TestFloat, b)) ); 1881 __ swc1(f8, MemOperand(a0, offsetof(TestFloat, b)) );
1882 __ ctc1(t1, FCSR); 1882 __ ctc1(t1, FCSR);
1883 __ jr(ra); 1883 __ jr(ra);
1884 __ nop(); 1884 __ nop();
1885 1885
1886 CodeDesc desc; 1886 CodeDesc desc;
1887 assm.GetCode(&desc); 1887 assm.GetCode(&desc);
1888 Handle<Code> code = isolate->factory()->NewCode( 1888 Handle<Code> code = isolate->factory()->NewCode(
1889 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 1889 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
1890 F3 f = FUNCTION_CAST<F3>(code->entry()); 1890 F3 f = FUNCTION_CAST<F3>(code->entry());
1891 1891
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
1963 9.8, -8.9, 9.8, 1963 9.8, -8.9, 9.8,
1964 -9.8, -8.9, -9.8 1964 -9.8, -8.9, -9.8
1965 }; 1965 };
1966 float resf1[tableLength] = { 1966 float resf1[tableLength] = {
1967 5.3, 5.3, 6.1, 1967 5.3, 5.3, 6.1,
1968 -10.0, 9.8, 9.8, 1968 -10.0, 9.8, 9.8,
1969 -10.0, 9.8, 9.8, 1969 -10.0, 9.8, 9.8,
1970 -10.0, -11.2, -9.8 1970 -10.0, -11.2, -9.8
1971 }; 1971 };
1972 1972
1973 __ ldc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, a)) ); 1973 __ ldc1(f2, MemOperand(a0, offsetof(TestFloat, a)) );
1974 __ ldc1(f4, MemOperand(a0, OFFSET_OF(TestFloat, b)) ); 1974 __ ldc1(f4, MemOperand(a0, offsetof(TestFloat, b)) );
1975 __ lwc1(f8, MemOperand(a0, OFFSET_OF(TestFloat, c)) ); 1975 __ lwc1(f8, MemOperand(a0, offsetof(TestFloat, c)) );
1976 __ lwc1(f10, MemOperand(a0, OFFSET_OF(TestFloat, d)) ); 1976 __ lwc1(f10, MemOperand(a0, offsetof(TestFloat, d)) );
1977 __ mina_d(f6, f2, f4); 1977 __ mina_d(f6, f2, f4);
1978 __ mina_s(f12, f8, f10); 1978 __ mina_s(f12, f8, f10);
1979 __ maxa_d(f14, f2, f4); 1979 __ maxa_d(f14, f2, f4);
1980 __ maxa_s(f16, f8, f10); 1980 __ maxa_s(f16, f8, f10);
1981 __ swc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, resf)) ); 1981 __ swc1(f12, MemOperand(a0, offsetof(TestFloat, resf)) );
1982 __ sdc1(f6, MemOperand(a0, OFFSET_OF(TestFloat, resd)) ); 1982 __ sdc1(f6, MemOperand(a0, offsetof(TestFloat, resd)) );
1983 __ swc1(f16, MemOperand(a0, OFFSET_OF(TestFloat, resf1)) ); 1983 __ swc1(f16, MemOperand(a0, offsetof(TestFloat, resf1)) );
1984 __ sdc1(f14, MemOperand(a0, OFFSET_OF(TestFloat, resd1)) ); 1984 __ sdc1(f14, MemOperand(a0, offsetof(TestFloat, resd1)) );
1985 __ jr(ra); 1985 __ jr(ra);
1986 __ nop(); 1986 __ nop();
1987 1987
1988 CodeDesc desc; 1988 CodeDesc desc;
1989 assm.GetCode(&desc); 1989 assm.GetCode(&desc);
1990 Handle<Code> code = isolate->factory()->NewCode( 1990 Handle<Code> code = isolate->factory()->NewCode(
1991 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 1991 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
1992 F3 f = FUNCTION_CAST<F3>(code->entry()); 1992 F3 f = FUNCTION_CAST<F3>(code->entry());
1993 for (int i = 0; i < tableLength; i++) { 1993 for (int i = 0; i < tableLength; i++) {
1994 test.a = inputsa[i]; 1994 test.a = inputsa[i];
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
2035 2147483648.0, 2035 2147483648.0,
2036 std::numeric_limits<float>::quiet_NaN(), 2036 std::numeric_limits<float>::quiet_NaN(),
2037 std::numeric_limits<float>::infinity() 2037 std::numeric_limits<float>::infinity()
2038 }; 2038 };
2039 double outputs[tableLength] = { 2039 double outputs[tableLength] = {
2040 2.0, 2.0, 2.0, 3.0, 3.0, 3.0, 2040 2.0, 2.0, 2.0, 3.0, 3.0, 3.0,
2041 -2.0, -2.0, -2.0, -3.0, -3.0, -3.0, 2041 -2.0, -2.0, -2.0, -3.0, -3.0, -3.0,
2042 2147483648.0, dFPU64InvalidResult, 2042 2147483648.0, dFPU64InvalidResult,
2043 dFPU64InvalidResult}; 2043 dFPU64InvalidResult};
2044 2044
2045 __ ldc1(f4, MemOperand(a0, OFFSET_OF(Test, a)) ); 2045 __ ldc1(f4, MemOperand(a0, offsetof(Test, a)) );
2046 __ lwc1(f6, MemOperand(a0, OFFSET_OF(Test, b)) ); 2046 __ lwc1(f6, MemOperand(a0, offsetof(Test, b)) );
2047 __ trunc_l_d(f8, f4); 2047 __ trunc_l_d(f8, f4);
2048 __ trunc_l_s(f10, f6); 2048 __ trunc_l_s(f10, f6);
2049 __ sdc1(f8, MemOperand(a0, OFFSET_OF(Test, c)) ); 2049 __ sdc1(f8, MemOperand(a0, offsetof(Test, c)) );
2050 __ sdc1(f10, MemOperand(a0, OFFSET_OF(Test, d)) ); 2050 __ sdc1(f10, MemOperand(a0, offsetof(Test, d)) );
2051 __ jr(ra); 2051 __ jr(ra);
2052 __ nop(); 2052 __ nop();
2053 Test test; 2053 Test test;
2054 CodeDesc desc; 2054 CodeDesc desc;
2055 assm.GetCode(&desc); 2055 assm.GetCode(&desc);
2056 Handle<Code> code = isolate->factory()->NewCode( 2056 Handle<Code> code = isolate->factory()->NewCode(
2057 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 2057 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
2058 F3 f = FUNCTION_CAST<F3>(code->entry()); 2058 F3 f = FUNCTION_CAST<F3>(code->entry());
2059 for (int i = 0; i < tableLength; i++) { 2059 for (int i = 0; i < tableLength; i++) {
2060 test.a = inputs_D[i]; 2060 test.a = inputs_D[i];
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
2097 4.8, 4.8, -4.8, -0.29 2097 4.8, 4.8, -4.8, -0.29
2098 }; 2098 };
2099 2099
2100 float outputs_S[tableLength] = { 2100 float outputs_S[tableLength] = {
2101 4.8, 4.8, -4.8, -0.29 2101 4.8, 4.8, -4.8, -0.29
2102 }; 2102 };
2103 double outputs_D[tableLength] = { 2103 double outputs_D[tableLength] = {
2104 5.3, -5.3, 5.3, -2.9 2104 5.3, -5.3, 5.3, -2.9
2105 }; 2105 };
2106 2106
2107 __ ldc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, a)) ); 2107 __ ldc1(f2, MemOperand(a0, offsetof(TestFloat, a)) );
2108 __ lwc1(f6, MemOperand(a0, OFFSET_OF(TestFloat, c)) ); 2108 __ lwc1(f6, MemOperand(a0, offsetof(TestFloat, c)) );
2109 __ lw(t0, MemOperand(a0, OFFSET_OF(TestFloat, rt)) ); 2109 __ lw(t0, MemOperand(a0, offsetof(TestFloat, rt)) );
2110 __ li(t1, 0x0); 2110 __ li(t1, 0x0);
2111 __ mtc1(t1, f12); 2111 __ mtc1(t1, f12);
2112 __ mtc1(t1, f10); 2112 __ mtc1(t1, f10);
2113 __ mtc1(t1, f16); 2113 __ mtc1(t1, f16);
2114 __ mtc1(t1, f14); 2114 __ mtc1(t1, f14);
2115 __ sdc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, bold)) ); 2115 __ sdc1(f12, MemOperand(a0, offsetof(TestFloat, bold)) );
2116 __ swc1(f10, MemOperand(a0, OFFSET_OF(TestFloat, dold)) ); 2116 __ swc1(f10, MemOperand(a0, offsetof(TestFloat, dold)) );
2117 __ sdc1(f16, MemOperand(a0, OFFSET_OF(TestFloat, bold1)) ); 2117 __ sdc1(f16, MemOperand(a0, offsetof(TestFloat, bold1)) );
2118 __ swc1(f14, MemOperand(a0, OFFSET_OF(TestFloat, dold1)) ); 2118 __ swc1(f14, MemOperand(a0, offsetof(TestFloat, dold1)) );
2119 __ movz_s(f10, f6, t0); 2119 __ movz_s(f10, f6, t0);
2120 __ movz_d(f12, f2, t0); 2120 __ movz_d(f12, f2, t0);
2121 __ movn_s(f14, f6, t0); 2121 __ movn_s(f14, f6, t0);
2122 __ movn_d(f16, f2, t0); 2122 __ movn_d(f16, f2, t0);
2123 __ swc1(f10, MemOperand(a0, OFFSET_OF(TestFloat, d)) ); 2123 __ swc1(f10, MemOperand(a0, offsetof(TestFloat, d)) );
2124 __ sdc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, b)) ); 2124 __ sdc1(f12, MemOperand(a0, offsetof(TestFloat, b)) );
2125 __ swc1(f14, MemOperand(a0, OFFSET_OF(TestFloat, d1)) ); 2125 __ swc1(f14, MemOperand(a0, offsetof(TestFloat, d1)) );
2126 __ sdc1(f16, MemOperand(a0, OFFSET_OF(TestFloat, b1)) ); 2126 __ sdc1(f16, MemOperand(a0, offsetof(TestFloat, b1)) );
2127 __ jr(ra); 2127 __ jr(ra);
2128 __ nop(); 2128 __ nop();
2129 2129
2130 CodeDesc desc; 2130 CodeDesc desc;
2131 assm.GetCode(&desc); 2131 assm.GetCode(&desc);
2132 Handle<Code> code = isolate->factory()->NewCode( 2132 Handle<Code> code = isolate->factory()->NewCode(
2133 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 2133 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
2134 F3 f = FUNCTION_CAST<F3>(code->entry()); 2134 F3 f = FUNCTION_CAST<F3>(code->entry());
2135 for (int i = 0; i < tableLength; i++) { 2135 for (int i = 0; i < tableLength; i++) {
2136 test.a = inputs_D[i]; 2136 test.a = inputs_D[i];
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
2196 2196
2197 for (int j = 0; j< 8; j++) { 2197 for (int j = 0; j< 8; j++) {
2198 test.cc = condition_flags[j]; 2198 test.cc = condition_flags[j];
2199 if (test.cc == 0) { 2199 if (test.cc == 0) {
2200 test.fcsr = 1 << 23; 2200 test.fcsr = 1 << 23;
2201 } else { 2201 } else {
2202 test.fcsr = 1 << (24+condition_flags[j]); 2202 test.fcsr = 1 << (24+condition_flags[j]);
2203 } 2203 }
2204 HandleScope scope(isolate); 2204 HandleScope scope(isolate);
2205 MacroAssembler assm(isolate, NULL, 0); 2205 MacroAssembler assm(isolate, NULL, 0);
2206 __ ldc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, srcd)) ); 2206 __ ldc1(f2, MemOperand(a0, offsetof(TestFloat, srcd)) );
2207 __ lwc1(f4, MemOperand(a0, OFFSET_OF(TestFloat, srcf)) ); 2207 __ lwc1(f4, MemOperand(a0, offsetof(TestFloat, srcf)) );
2208 __ lw(t1, MemOperand(a0, OFFSET_OF(TestFloat, fcsr)) ); 2208 __ lw(t1, MemOperand(a0, offsetof(TestFloat, fcsr)) );
2209 __ cfc1(t0, FCSR); 2209 __ cfc1(t0, FCSR);
2210 __ ctc1(t1, FCSR); 2210 __ ctc1(t1, FCSR);
2211 __ li(t2, 0x0); 2211 __ li(t2, 0x0);
2212 __ mtc1(t2, f12); 2212 __ mtc1(t2, f12);
2213 __ mtc1(t2, f10); 2213 __ mtc1(t2, f10);
2214 __ sdc1(f10, MemOperand(a0, OFFSET_OF(TestFloat, dstdold)) ); 2214 __ sdc1(f10, MemOperand(a0, offsetof(TestFloat, dstdold)) );
2215 __ swc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, dstfold)) ); 2215 __ swc1(f12, MemOperand(a0, offsetof(TestFloat, dstfold)) );
2216 __ movt_s(f12, f4, test.cc); 2216 __ movt_s(f12, f4, test.cc);
2217 __ movt_d(f10, f2, test.cc); 2217 __ movt_d(f10, f2, test.cc);
2218 __ swc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, dstf)) ); 2218 __ swc1(f12, MemOperand(a0, offsetof(TestFloat, dstf)) );
2219 __ sdc1(f10, MemOperand(a0, OFFSET_OF(TestFloat, dstd)) ); 2219 __ sdc1(f10, MemOperand(a0, offsetof(TestFloat, dstd)) );
2220 __ sdc1(f10, MemOperand(a0, OFFSET_OF(TestFloat, dstdold1)) ); 2220 __ sdc1(f10, MemOperand(a0, offsetof(TestFloat, dstdold1)) );
2221 __ swc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, dstfold1)) ); 2221 __ swc1(f12, MemOperand(a0, offsetof(TestFloat, dstfold1)) );
2222 __ movf_s(f12, f4, test.cc); 2222 __ movf_s(f12, f4, test.cc);
2223 __ movf_d(f10, f2, test.cc); 2223 __ movf_d(f10, f2, test.cc);
2224 __ swc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, dstf1)) ); 2224 __ swc1(f12, MemOperand(a0, offsetof(TestFloat, dstf1)) );
2225 __ sdc1(f10, MemOperand(a0, OFFSET_OF(TestFloat, dstd1)) ); 2225 __ sdc1(f10, MemOperand(a0, offsetof(TestFloat, dstd1)) );
2226 __ ctc1(t0, FCSR); 2226 __ ctc1(t0, FCSR);
2227 __ jr(ra); 2227 __ jr(ra);
2228 __ nop(); 2228 __ nop();
2229 2229
2230 CodeDesc desc; 2230 CodeDesc desc;
2231 assm.GetCode(&desc); 2231 assm.GetCode(&desc);
2232 Handle<Code> code = isolate->factory()->NewCode( 2232 Handle<Code> code = isolate->factory()->NewCode(
2233 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 2233 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
2234 F3 f = FUNCTION_CAST<F3>(code->entry()); 2234 F3 f = FUNCTION_CAST<F3>(code->entry());
2235 2235
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
2296 double outputs_RM[tableLength] = { 2296 double outputs_RM[tableLength] = {
2297 2.0, 2.0, 2.0, 3.0, 3.0, 3.0, 2297 2.0, 2.0, 2.0, 3.0, 3.0, 3.0,
2298 -3.0, -3.0, -3.0, -4.0, -4.0, -4.0, 2298 -3.0, -3.0, -3.0, -4.0, -4.0, -4.0,
2299 2147483637.0, 2147483638.0, 2147483639.0, 2299 2147483637.0, 2147483638.0, 2147483639.0,
2300 2147483640.0, 2147483641.0, 2147483642.0, 2300 2147483640.0, 2147483641.0, 2147483642.0,
2301 2147483643.0, 2147483644.0, 2147483645.0, 2301 2147483643.0, 2147483644.0, 2147483645.0,
2302 2147483646.0, 2147483647.0, kFPUInvalidResult}; 2302 2147483646.0, 2147483647.0, kFPUInvalidResult};
2303 int fcsr_inputs[4] = 2303 int fcsr_inputs[4] =
2304 {kRoundToNearest, kRoundToZero, kRoundToPlusInf, kRoundToMinusInf}; 2304 {kRoundToNearest, kRoundToZero, kRoundToPlusInf, kRoundToMinusInf};
2305 double* outputs[4] = {outputs_RN, outputs_RZ, outputs_RP, outputs_RM}; 2305 double* outputs[4] = {outputs_RN, outputs_RZ, outputs_RP, outputs_RM};
2306 __ ldc1(f4, MemOperand(a0, OFFSET_OF(Test, a)) ); 2306 __ ldc1(f4, MemOperand(a0, offsetof(Test, a)) );
2307 __ lw(t0, MemOperand(a0, OFFSET_OF(Test, fcsr)) ); 2307 __ lw(t0, MemOperand(a0, offsetof(Test, fcsr)) );
2308 __ cfc1(t1, FCSR); 2308 __ cfc1(t1, FCSR);
2309 __ ctc1(t0, FCSR); 2309 __ ctc1(t0, FCSR);
2310 __ cvt_w_d(f8, f4); 2310 __ cvt_w_d(f8, f4);
2311 __ swc1(f8, MemOperand(a0, OFFSET_OF(Test, b)) ); 2311 __ swc1(f8, MemOperand(a0, offsetof(Test, b)) );
2312 __ ctc1(t1, FCSR); 2312 __ ctc1(t1, FCSR);
2313 __ jr(ra); 2313 __ jr(ra);
2314 __ nop(); 2314 __ nop();
2315 Test test; 2315 Test test;
2316 CodeDesc desc; 2316 CodeDesc desc;
2317 assm.GetCode(&desc); 2317 assm.GetCode(&desc);
2318 Handle<Code> code = isolate->factory()->NewCode( 2318 Handle<Code> code = isolate->factory()->NewCode(
2319 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 2319 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
2320 F3 f = FUNCTION_CAST<F3>(code->entry()); 2320 F3 f = FUNCTION_CAST<F3>(code->entry());
2321 for (int j = 0; j < 4; j++) { 2321 for (int j = 0; j < 4; j++) {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
2355 2147483648.0, 2355 2147483648.0,
2356 std::numeric_limits<float>::quiet_NaN(), 2356 std::numeric_limits<float>::quiet_NaN(),
2357 std::numeric_limits<float>::infinity() 2357 std::numeric_limits<float>::infinity()
2358 }; 2358 };
2359 double outputs[tableLength] = { 2359 double outputs[tableLength] = {
2360 2.0, 2.0, 2.0, 3.0, 3.0, 3.0, 2360 2.0, 2.0, 2.0, 3.0, 3.0, 3.0,
2361 -2.0, -2.0, -2.0, -3.0, -3.0, -3.0, 2361 -2.0, -2.0, -2.0, -3.0, -3.0, -3.0,
2362 kFPUInvalidResult, kFPUInvalidResult, 2362 kFPUInvalidResult, kFPUInvalidResult,
2363 kFPUInvalidResult}; 2363 kFPUInvalidResult};
2364 2364
2365 __ ldc1(f4, MemOperand(a0, OFFSET_OF(Test, a)) ); 2365 __ ldc1(f4, MemOperand(a0, offsetof(Test, a)) );
2366 __ lwc1(f6, MemOperand(a0, OFFSET_OF(Test, b)) ); 2366 __ lwc1(f6, MemOperand(a0, offsetof(Test, b)) );
2367 __ trunc_w_d(f8, f4); 2367 __ trunc_w_d(f8, f4);
2368 __ trunc_w_s(f10, f6); 2368 __ trunc_w_s(f10, f6);
2369 __ swc1(f8, MemOperand(a0, OFFSET_OF(Test, c)) ); 2369 __ swc1(f8, MemOperand(a0, offsetof(Test, c)) );
2370 __ swc1(f10, MemOperand(a0, OFFSET_OF(Test, d)) ); 2370 __ swc1(f10, MemOperand(a0, offsetof(Test, d)) );
2371 __ jr(ra); 2371 __ jr(ra);
2372 __ nop(); 2372 __ nop();
2373 Test test; 2373 Test test;
2374 CodeDesc desc; 2374 CodeDesc desc;
2375 assm.GetCode(&desc); 2375 assm.GetCode(&desc);
2376 Handle<Code> code = isolate->factory()->NewCode( 2376 Handle<Code> code = isolate->factory()->NewCode(
2377 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 2377 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
2378 F3 f = FUNCTION_CAST<F3>(code->entry()); 2378 F3 f = FUNCTION_CAST<F3>(code->entry());
2379 for (int i = 0; i < tableLength; i++) { 2379 for (int i = 0; i < tableLength; i++) {
2380 test.a = inputs_D[i]; 2380 test.a = inputs_D[i];
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
2412 2147483648.0, 2412 2147483648.0,
2413 std::numeric_limits<float>::quiet_NaN(), 2413 std::numeric_limits<float>::quiet_NaN(),
2414 std::numeric_limits<float>::infinity() 2414 std::numeric_limits<float>::infinity()
2415 }; 2415 };
2416 double outputs[tableLength] = { 2416 double outputs[tableLength] = {
2417 2.0, 3.0, 2.0, 3.0, 4.0, 4.0, 2417 2.0, 3.0, 2.0, 3.0, 4.0, 4.0,
2418 -2.0, -3.0, -2.0, -3.0, -4.0, -4.0, 2418 -2.0, -3.0, -2.0, -3.0, -4.0, -4.0,
2419 kFPUInvalidResult, kFPUInvalidResult, 2419 kFPUInvalidResult, kFPUInvalidResult,
2420 kFPUInvalidResult}; 2420 kFPUInvalidResult};
2421 2421
2422 __ ldc1(f4, MemOperand(a0, OFFSET_OF(Test, a)) ); 2422 __ ldc1(f4, MemOperand(a0, offsetof(Test, a)) );
2423 __ lwc1(f6, MemOperand(a0, OFFSET_OF(Test, b)) ); 2423 __ lwc1(f6, MemOperand(a0, offsetof(Test, b)) );
2424 __ round_w_d(f8, f4); 2424 __ round_w_d(f8, f4);
2425 __ round_w_s(f10, f6); 2425 __ round_w_s(f10, f6);
2426 __ swc1(f8, MemOperand(a0, OFFSET_OF(Test, c)) ); 2426 __ swc1(f8, MemOperand(a0, offsetof(Test, c)) );
2427 __ swc1(f10, MemOperand(a0, OFFSET_OF(Test, d)) ); 2427 __ swc1(f10, MemOperand(a0, offsetof(Test, d)) );
2428 __ jr(ra); 2428 __ jr(ra);
2429 __ nop(); 2429 __ nop();
2430 Test test; 2430 Test test;
2431 CodeDesc desc; 2431 CodeDesc desc;
2432 assm.GetCode(&desc); 2432 assm.GetCode(&desc);
2433 Handle<Code> code = isolate->factory()->NewCode( 2433 Handle<Code> code = isolate->factory()->NewCode(
2434 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 2434 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
2435 F3 f = FUNCTION_CAST<F3>(code->entry()); 2435 F3 f = FUNCTION_CAST<F3>(code->entry());
2436 for (int i = 0; i < tableLength; i++) { 2436 for (int i = 0; i < tableLength; i++) {
2437 test.a = inputs_D[i]; 2437 test.a = inputs_D[i];
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
2469 2147483648.0, 2469 2147483648.0,
2470 std::numeric_limits<float>::quiet_NaN(), 2470 std::numeric_limits<float>::quiet_NaN(),
2471 std::numeric_limits<float>::infinity() 2471 std::numeric_limits<float>::infinity()
2472 }; 2472 };
2473 double outputs[tableLength] = { 2473 double outputs[tableLength] = {
2474 2.0, 3.0, 2.0, 3.0, 4.0, 4.0, 2474 2.0, 3.0, 2.0, 3.0, 4.0, 4.0,
2475 -2.0, -3.0, -2.0, -3.0, -4.0, -4.0, 2475 -2.0, -3.0, -2.0, -3.0, -4.0, -4.0,
2476 2147483648.0, dFPU64InvalidResult, 2476 2147483648.0, dFPU64InvalidResult,
2477 dFPU64InvalidResult}; 2477 dFPU64InvalidResult};
2478 2478
2479 __ ldc1(f4, MemOperand(a0, OFFSET_OF(Test, a)) ); 2479 __ ldc1(f4, MemOperand(a0, offsetof(Test, a)) );
2480 __ lwc1(f6, MemOperand(a0, OFFSET_OF(Test, b)) ); 2480 __ lwc1(f6, MemOperand(a0, offsetof(Test, b)) );
2481 __ round_l_d(f8, f4); 2481 __ round_l_d(f8, f4);
2482 __ round_l_s(f10, f6); 2482 __ round_l_s(f10, f6);
2483 __ sdc1(f8, MemOperand(a0, OFFSET_OF(Test, c)) ); 2483 __ sdc1(f8, MemOperand(a0, offsetof(Test, c)) );
2484 __ sdc1(f10, MemOperand(a0, OFFSET_OF(Test, d)) ); 2484 __ sdc1(f10, MemOperand(a0, offsetof(Test, d)) );
2485 __ jr(ra); 2485 __ jr(ra);
2486 __ nop(); 2486 __ nop();
2487 Test test; 2487 Test test;
2488 CodeDesc desc; 2488 CodeDesc desc;
2489 assm.GetCode(&desc); 2489 assm.GetCode(&desc);
2490 Handle<Code> code = isolate->factory()->NewCode( 2490 Handle<Code> code = isolate->factory()->NewCode(
2491 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 2491 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
2492 F3 f = FUNCTION_CAST<F3>(code->entry()); 2492 F3 f = FUNCTION_CAST<F3>(code->entry());
2493 for (int i = 0; i < tableLength; i++) { 2493 for (int i = 0; i < tableLength; i++) {
2494 test.a = inputs_D[i]; 2494 test.a = inputs_D[i];
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
2535 5.3, 4.8, 2.9, -5.3, -4.8, -2.9 2535 5.3, 4.8, 2.9, -5.3, -4.8, -2.9
2536 }; 2536 };
2537 float inputft_S[tableLength] = { 2537 float inputft_S[tableLength] = {
2538 4.8, 5.3, 2.9, 4.8, 5.3, 2.9, 2538 4.8, 5.3, 2.9, 4.8, 5.3, 2.9,
2539 -4.8, -5.3, -2.9, -4.8, -5.3, -2.9 2539 -4.8, -5.3, -2.9, -4.8, -5.3, -2.9
2540 }; 2540 };
2541 float outputs_S[tableLength] = { 2541 float outputs_S[tableLength] = {
2542 0.5, -0.5, 0.0, -10.1, -10.1, -5.8, 2542 0.5, -0.5, 0.0, -10.1, -10.1, -5.8,
2543 10.1, 10.1, 5.8, -0.5, 0.5, 0.0 2543 10.1, 10.1, 5.8, -0.5, 0.5, 0.0
2544 }; 2544 };
2545 __ lwc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, a)) ); 2545 __ lwc1(f2, MemOperand(a0, offsetof(TestFloat, a)) );
2546 __ lwc1(f4, MemOperand(a0, OFFSET_OF(TestFloat, b)) ); 2546 __ lwc1(f4, MemOperand(a0, offsetof(TestFloat, b)) );
2547 __ ldc1(f8, MemOperand(a0, OFFSET_OF(TestFloat, c)) ); 2547 __ ldc1(f8, MemOperand(a0, offsetof(TestFloat, c)) );
2548 __ ldc1(f10, MemOperand(a0, OFFSET_OF(TestFloat, d)) ); 2548 __ ldc1(f10, MemOperand(a0, offsetof(TestFloat, d)) );
2549 __ sub_s(f6, f2, f4); 2549 __ sub_s(f6, f2, f4);
2550 __ sub_d(f12, f8, f10); 2550 __ sub_d(f12, f8, f10);
2551 __ swc1(f6, MemOperand(a0, OFFSET_OF(TestFloat, resultS)) ); 2551 __ swc1(f6, MemOperand(a0, offsetof(TestFloat, resultS)) );
2552 __ sdc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, resultD)) ); 2552 __ sdc1(f12, MemOperand(a0, offsetof(TestFloat, resultD)) );
2553 __ jr(ra); 2553 __ jr(ra);
2554 __ nop(); 2554 __ nop();
2555 2555
2556 CodeDesc desc; 2556 CodeDesc desc;
2557 assm.GetCode(&desc); 2557 assm.GetCode(&desc);
2558 Handle<Code> code = isolate->factory()->NewCode( 2558 Handle<Code> code = isolate->factory()->NewCode(
2559 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 2559 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
2560 F3 f = FUNCTION_CAST<F3>(code->entry()); 2560 F3 f = FUNCTION_CAST<F3>(code->entry());
2561 for (int i = 0; i < tableLength; i++) { 2561 for (int i = 0; i < tableLength; i++) {
2562 test.a = inputfs_S[i]; 2562 test.a = inputfs_S[i];
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
2602 }; 2602 };
2603 float inputs_S[tableLength] = { 2603 float inputs_S[tableLength] = {
2604 0.0, 4.0, 2.0, 4e-28 2604 0.0, 4.0, 2.0, 4e-28
2605 }; 2605 };
2606 2606
2607 float outputs_S[tableLength] = { 2607 float outputs_S[tableLength] = {
2608 0.0, 2.0, sqrt2_s, 2e-14 2608 0.0, 2.0, sqrt2_s, 2e-14
2609 }; 2609 };
2610 2610
2611 2611
2612 __ lwc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, a)) ); 2612 __ lwc1(f2, MemOperand(a0, offsetof(TestFloat, a)) );
2613 __ ldc1(f8, MemOperand(a0, OFFSET_OF(TestFloat, c)) ); 2613 __ ldc1(f8, MemOperand(a0, offsetof(TestFloat, c)) );
2614 __ sqrt_s(f6, f2); 2614 __ sqrt_s(f6, f2);
2615 __ sqrt_d(f12, f8); 2615 __ sqrt_d(f12, f8);
2616 __ rsqrt_d(f14, f8); 2616 __ rsqrt_d(f14, f8);
2617 __ rsqrt_s(f16, f2); 2617 __ rsqrt_s(f16, f2);
2618 __ recip_d(f18, f8); 2618 __ recip_d(f18, f8);
2619 __ recip_s(f20, f2); 2619 __ recip_s(f20, f2);
2620 __ swc1(f6, MemOperand(a0, OFFSET_OF(TestFloat, resultS)) ); 2620 __ swc1(f6, MemOperand(a0, offsetof(TestFloat, resultS)) );
2621 __ sdc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, resultD)) ); 2621 __ sdc1(f12, MemOperand(a0, offsetof(TestFloat, resultD)) );
2622 __ swc1(f16, MemOperand(a0, OFFSET_OF(TestFloat, resultS1)) ); 2622 __ swc1(f16, MemOperand(a0, offsetof(TestFloat, resultS1)) );
2623 __ sdc1(f14, MemOperand(a0, OFFSET_OF(TestFloat, resultD1)) ); 2623 __ sdc1(f14, MemOperand(a0, offsetof(TestFloat, resultD1)) );
2624 __ swc1(f20, MemOperand(a0, OFFSET_OF(TestFloat, resultS2)) ); 2624 __ swc1(f20, MemOperand(a0, offsetof(TestFloat, resultS2)) );
2625 __ sdc1(f18, MemOperand(a0, OFFSET_OF(TestFloat, resultD2)) ); 2625 __ sdc1(f18, MemOperand(a0, offsetof(TestFloat, resultD2)) );
2626 __ jr(ra); 2626 __ jr(ra);
2627 __ nop(); 2627 __ nop();
2628 2628
2629 CodeDesc desc; 2629 CodeDesc desc;
2630 assm.GetCode(&desc); 2630 assm.GetCode(&desc);
2631 Handle<Code> code = isolate->factory()->NewCode( 2631 Handle<Code> code = isolate->factory()->NewCode(
2632 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 2632 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
2633 F3 f = FUNCTION_CAST<F3>(code->entry()); 2633 F3 f = FUNCTION_CAST<F3>(code->entry());
2634 2634
2635 for (int i = 0; i < tableLength; i++) { 2635 for (int i = 0; i < tableLength; i++) {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
2688 double outputs_D[tableLength] = { 2688 double outputs_D[tableLength] = {
2689 -4.0, 2.0 2689 -4.0, 2.0
2690 }; 2690 };
2691 float inputs_S[tableLength] = { 2691 float inputs_S[tableLength] = {
2692 4.0, -2.0 2692 4.0, -2.0
2693 }; 2693 };
2694 2694
2695 float outputs_S[tableLength] = { 2695 float outputs_S[tableLength] = {
2696 -4.0, 2.0 2696 -4.0, 2.0
2697 }; 2697 };
2698 __ lwc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, a)) ); 2698 __ lwc1(f2, MemOperand(a0, offsetof(TestFloat, a)) );
2699 __ ldc1(f8, MemOperand(a0, OFFSET_OF(TestFloat, c)) ); 2699 __ ldc1(f8, MemOperand(a0, offsetof(TestFloat, c)) );
2700 __ neg_s(f6, f2); 2700 __ neg_s(f6, f2);
2701 __ neg_d(f12, f8); 2701 __ neg_d(f12, f8);
2702 __ swc1(f6, MemOperand(a0, OFFSET_OF(TestFloat, resultS)) ); 2702 __ swc1(f6, MemOperand(a0, offsetof(TestFloat, resultS)) );
2703 __ sdc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, resultD)) ); 2703 __ sdc1(f12, MemOperand(a0, offsetof(TestFloat, resultD)) );
2704 __ jr(ra); 2704 __ jr(ra);
2705 __ nop(); 2705 __ nop();
2706 2706
2707 CodeDesc desc; 2707 CodeDesc desc;
2708 assm.GetCode(&desc); 2708 assm.GetCode(&desc);
2709 Handle<Code> code = isolate->factory()->NewCode( 2709 Handle<Code> code = isolate->factory()->NewCode(
2710 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 2710 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
2711 F3 f = FUNCTION_CAST<F3>(code->entry()); 2711 F3 f = FUNCTION_CAST<F3>(code->entry());
2712 for (int i = 0; i < tableLength; i++) { 2712 for (int i = 0; i < tableLength; i++) {
2713 test.a = inputs_S[i]; 2713 test.a = inputs_S[i];
(...skipping 30 matching lines...) Expand all
2744 4.8, 4.8, -4.8, -0.29 2744 4.8, 4.8, -4.8, -0.29
2745 }; 2745 };
2746 2746
2747 float inputfs_S[tableLength] = { 2747 float inputfs_S[tableLength] = {
2748 5.3, -5.3, 5.3, -2.9 2748 5.3, -5.3, 5.3, -2.9
2749 }; 2749 };
2750 float inputft_S[tableLength] = { 2750 float inputft_S[tableLength] = {
2751 4.8, 4.8, -4.8, -0.29 2751 4.8, 4.8, -4.8, -0.29
2752 }; 2752 };
2753 2753
2754 __ lwc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, a)) ); 2754 __ lwc1(f2, MemOperand(a0, offsetof(TestFloat, a)) );
2755 __ lwc1(f4, MemOperand(a0, OFFSET_OF(TestFloat, b)) ); 2755 __ lwc1(f4, MemOperand(a0, offsetof(TestFloat, b)) );
2756 __ ldc1(f6, MemOperand(a0, OFFSET_OF(TestFloat, c)) ); 2756 __ ldc1(f6, MemOperand(a0, offsetof(TestFloat, c)) );
2757 __ ldc1(f8, MemOperand(a0, OFFSET_OF(TestFloat, d)) ); 2757 __ ldc1(f8, MemOperand(a0, offsetof(TestFloat, d)) );
2758 __ mul_s(f10, f2, f4); 2758 __ mul_s(f10, f2, f4);
2759 __ mul_d(f12, f6, f8); 2759 __ mul_d(f12, f6, f8);
2760 __ swc1(f10, MemOperand(a0, OFFSET_OF(TestFloat, resultS)) ); 2760 __ swc1(f10, MemOperand(a0, offsetof(TestFloat, resultS)) );
2761 __ sdc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, resultD)) ); 2761 __ sdc1(f12, MemOperand(a0, offsetof(TestFloat, resultD)) );
2762 __ jr(ra); 2762 __ jr(ra);
2763 __ nop(); 2763 __ nop();
2764 2764
2765 CodeDesc desc; 2765 CodeDesc desc;
2766 assm.GetCode(&desc); 2766 assm.GetCode(&desc);
2767 Handle<Code> code = isolate->factory()->NewCode( 2767 Handle<Code> code = isolate->factory()->NewCode(
2768 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 2768 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
2769 F3 f = FUNCTION_CAST<F3>(code->entry()); 2769 F3 f = FUNCTION_CAST<F3>(code->entry());
2770 for (int i = 0; i < tableLength; i++) { 2770 for (int i = 0; i < tableLength; i++) {
2771 test.a = inputfs_S[i]; 2771 test.a = inputfs_S[i];
(...skipping 29 matching lines...) Expand all
2801 4.8, 4.8, -4.8, -0.29 2801 4.8, 4.8, -4.8, -0.29
2802 }; 2802 };
2803 2803
2804 float outputs_S[tableLength] = { 2804 float outputs_S[tableLength] = {
2805 4.8, 4.8, -4.8, -0.29 2805 4.8, 4.8, -4.8, -0.29
2806 }; 2806 };
2807 double outputs_D[tableLength] = { 2807 double outputs_D[tableLength] = {
2808 5.3, -5.3, 5.3, -2.9 2808 5.3, -5.3, 5.3, -2.9
2809 }; 2809 };
2810 2810
2811 __ ldc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, a)) ); 2811 __ ldc1(f2, MemOperand(a0, offsetof(TestFloat, a)) );
2812 __ lwc1(f6, MemOperand(a0, OFFSET_OF(TestFloat, c)) ); 2812 __ lwc1(f6, MemOperand(a0, offsetof(TestFloat, c)) );
2813 __ mov_s(f18, f6); 2813 __ mov_s(f18, f6);
2814 __ mov_d(f20, f2); 2814 __ mov_d(f20, f2);
2815 __ swc1(f18, MemOperand(a0, OFFSET_OF(TestFloat, d)) ); 2815 __ swc1(f18, MemOperand(a0, offsetof(TestFloat, d)) );
2816 __ sdc1(f20, MemOperand(a0, OFFSET_OF(TestFloat, b)) ); 2816 __ sdc1(f20, MemOperand(a0, offsetof(TestFloat, b)) );
2817 __ jr(ra); 2817 __ jr(ra);
2818 __ nop(); 2818 __ nop();
2819 2819
2820 CodeDesc desc; 2820 CodeDesc desc;
2821 assm.GetCode(&desc); 2821 assm.GetCode(&desc);
2822 Handle<Code> code = isolate->factory()->NewCode( 2822 Handle<Code> code = isolate->factory()->NewCode(
2823 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 2823 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
2824 F3 f = FUNCTION_CAST<F3>(code->entry()); 2824 F3 f = FUNCTION_CAST<F3>(code->entry());
2825 for (int i = 0; i < tableLength; i++) { 2825 for (int i = 0; i < tableLength; i++) {
2826 test.a = inputs_D[i]; 2826 test.a = inputs_D[i];
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
2859 2147483648.0, 2859 2147483648.0,
2860 std::numeric_limits<float>::quiet_NaN(), 2860 std::numeric_limits<float>::quiet_NaN(),
2861 std::numeric_limits<float>::infinity() 2861 std::numeric_limits<float>::infinity()
2862 }; 2862 };
2863 double outputs[tableLength] = { 2863 double outputs[tableLength] = {
2864 2.0, 2.0, 2.0, 3.0, 3.0, 3.0, 2864 2.0, 2.0, 2.0, 3.0, 3.0, 3.0,
2865 -3.0, -3.0, -3.0, -4.0, -4.0, -4.0, 2865 -3.0, -3.0, -3.0, -4.0, -4.0, -4.0,
2866 kFPUInvalidResult, kFPUInvalidResult, 2866 kFPUInvalidResult, kFPUInvalidResult,
2867 kFPUInvalidResult}; 2867 kFPUInvalidResult};
2868 2868
2869 __ ldc1(f4, MemOperand(a0, OFFSET_OF(Test, a)) ); 2869 __ ldc1(f4, MemOperand(a0, offsetof(Test, a)) );
2870 __ lwc1(f6, MemOperand(a0, OFFSET_OF(Test, b)) ); 2870 __ lwc1(f6, MemOperand(a0, offsetof(Test, b)) );
2871 __ floor_w_d(f8, f4); 2871 __ floor_w_d(f8, f4);
2872 __ floor_w_s(f10, f6); 2872 __ floor_w_s(f10, f6);
2873 __ swc1(f8, MemOperand(a0, OFFSET_OF(Test, c)) ); 2873 __ swc1(f8, MemOperand(a0, offsetof(Test, c)) );
2874 __ swc1(f10, MemOperand(a0, OFFSET_OF(Test, d)) ); 2874 __ swc1(f10, MemOperand(a0, offsetof(Test, d)) );
2875 __ jr(ra); 2875 __ jr(ra);
2876 __ nop(); 2876 __ nop();
2877 Test test; 2877 Test test;
2878 CodeDesc desc; 2878 CodeDesc desc;
2879 assm.GetCode(&desc); 2879 assm.GetCode(&desc);
2880 Handle<Code> code = isolate->factory()->NewCode( 2880 Handle<Code> code = isolate->factory()->NewCode(
2881 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 2881 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
2882 F3 f = FUNCTION_CAST<F3>(code->entry()); 2882 F3 f = FUNCTION_CAST<F3>(code->entry());
2883 for (int i = 0; i < tableLength; i++) { 2883 for (int i = 0; i < tableLength; i++) {
2884 test.a = inputs_D[i]; 2884 test.a = inputs_D[i];
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
2916 2147483648.0, 2916 2147483648.0,
2917 std::numeric_limits<float>::quiet_NaN(), 2917 std::numeric_limits<float>::quiet_NaN(),
2918 std::numeric_limits<float>::infinity() 2918 std::numeric_limits<float>::infinity()
2919 }; 2919 };
2920 double outputs[tableLength] = { 2920 double outputs[tableLength] = {
2921 2.0, 2.0, 2.0, 3.0, 3.0, 3.0, 2921 2.0, 2.0, 2.0, 3.0, 3.0, 3.0,
2922 -3.0, -3.0, -3.0, -4.0, -4.0, -4.0, 2922 -3.0, -3.0, -3.0, -4.0, -4.0, -4.0,
2923 2147483648.0, dFPU64InvalidResult, 2923 2147483648.0, dFPU64InvalidResult,
2924 dFPU64InvalidResult}; 2924 dFPU64InvalidResult};
2925 2925
2926 __ ldc1(f4, MemOperand(a0, OFFSET_OF(Test, a)) ); 2926 __ ldc1(f4, MemOperand(a0, offsetof(Test, a)) );
2927 __ lwc1(f6, MemOperand(a0, OFFSET_OF(Test, b)) ); 2927 __ lwc1(f6, MemOperand(a0, offsetof(Test, b)) );
2928 __ floor_l_d(f8, f4); 2928 __ floor_l_d(f8, f4);
2929 __ floor_l_s(f10, f6); 2929 __ floor_l_s(f10, f6);
2930 __ sdc1(f8, MemOperand(a0, OFFSET_OF(Test, c)) ); 2930 __ sdc1(f8, MemOperand(a0, offsetof(Test, c)) );
2931 __ sdc1(f10, MemOperand(a0, OFFSET_OF(Test, d)) ); 2931 __ sdc1(f10, MemOperand(a0, offsetof(Test, d)) );
2932 __ jr(ra); 2932 __ jr(ra);
2933 __ nop(); 2933 __ nop();
2934 Test test; 2934 Test test;
2935 CodeDesc desc; 2935 CodeDesc desc;
2936 assm.GetCode(&desc); 2936 assm.GetCode(&desc);
2937 Handle<Code> code = isolate->factory()->NewCode( 2937 Handle<Code> code = isolate->factory()->NewCode(
2938 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 2938 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
2939 F3 f = FUNCTION_CAST<F3>(code->entry()); 2939 F3 f = FUNCTION_CAST<F3>(code->entry());
2940 for (int i = 0; i < tableLength; i++) { 2940 for (int i = 0; i < tableLength; i++) {
2941 test.a = inputs_D[i]; 2941 test.a = inputs_D[i];
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
2973 2147483648.0, 2973 2147483648.0,
2974 std::numeric_limits<float>::quiet_NaN(), 2974 std::numeric_limits<float>::quiet_NaN(),
2975 std::numeric_limits<float>::infinity() 2975 std::numeric_limits<float>::infinity()
2976 }; 2976 };
2977 double outputs[tableLength] = { 2977 double outputs[tableLength] = {
2978 3.0, 3.0, 3.0, 4.0, 4.0, 4.0, 2978 3.0, 3.0, 3.0, 4.0, 4.0, 4.0,
2979 -2.0, -2.0, -2.0, -3.0, -3.0, -3.0, 2979 -2.0, -2.0, -2.0, -3.0, -3.0, -3.0,
2980 kFPUInvalidResult, kFPUInvalidResult, 2980 kFPUInvalidResult, kFPUInvalidResult,
2981 kFPUInvalidResult}; 2981 kFPUInvalidResult};
2982 2982
2983 __ ldc1(f4, MemOperand(a0, OFFSET_OF(Test, a)) ); 2983 __ ldc1(f4, MemOperand(a0, offsetof(Test, a)) );
2984 __ lwc1(f6, MemOperand(a0, OFFSET_OF(Test, b)) ); 2984 __ lwc1(f6, MemOperand(a0, offsetof(Test, b)) );
2985 __ ceil_w_d(f8, f4); 2985 __ ceil_w_d(f8, f4);
2986 __ ceil_w_s(f10, f6); 2986 __ ceil_w_s(f10, f6);
2987 __ swc1(f8, MemOperand(a0, OFFSET_OF(Test, c)) ); 2987 __ swc1(f8, MemOperand(a0, offsetof(Test, c)) );
2988 __ swc1(f10, MemOperand(a0, OFFSET_OF(Test, d)) ); 2988 __ swc1(f10, MemOperand(a0, offsetof(Test, d)) );
2989 __ jr(ra); 2989 __ jr(ra);
2990 __ nop(); 2990 __ nop();
2991 Test test; 2991 Test test;
2992 CodeDesc desc; 2992 CodeDesc desc;
2993 assm.GetCode(&desc); 2993 assm.GetCode(&desc);
2994 Handle<Code> code = isolate->factory()->NewCode( 2994 Handle<Code> code = isolate->factory()->NewCode(
2995 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 2995 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
2996 F3 f = FUNCTION_CAST<F3>(code->entry()); 2996 F3 f = FUNCTION_CAST<F3>(code->entry());
2997 for (int i = 0; i < tableLength; i++) { 2997 for (int i = 0; i < tableLength; i++) {
2998 test.a = inputs_D[i]; 2998 test.a = inputs_D[i];
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
3030 2147483648.0, 3030 2147483648.0,
3031 std::numeric_limits<float>::quiet_NaN(), 3031 std::numeric_limits<float>::quiet_NaN(),
3032 std::numeric_limits<float>::infinity() 3032 std::numeric_limits<float>::infinity()
3033 }; 3033 };
3034 double outputs[tableLength] = { 3034 double outputs[tableLength] = {
3035 3.0, 3.0, 3.0, 4.0, 4.0, 4.0, 3035 3.0, 3.0, 3.0, 4.0, 4.0, 4.0,
3036 -2.0, -2.0, -2.0, -3.0, -3.0, -3.0, 3036 -2.0, -2.0, -2.0, -3.0, -3.0, -3.0,
3037 2147483648.0, dFPU64InvalidResult, 3037 2147483648.0, dFPU64InvalidResult,
3038 dFPU64InvalidResult}; 3038 dFPU64InvalidResult};
3039 3039
3040 __ ldc1(f4, MemOperand(a0, OFFSET_OF(Test, a)) ); 3040 __ ldc1(f4, MemOperand(a0, offsetof(Test, a)) );
3041 __ lwc1(f6, MemOperand(a0, OFFSET_OF(Test, b)) ); 3041 __ lwc1(f6, MemOperand(a0, offsetof(Test, b)) );
3042 __ ceil_l_d(f8, f4); 3042 __ ceil_l_d(f8, f4);
3043 __ ceil_l_s(f10, f6); 3043 __ ceil_l_s(f10, f6);
3044 __ sdc1(f8, MemOperand(a0, OFFSET_OF(Test, c)) ); 3044 __ sdc1(f8, MemOperand(a0, offsetof(Test, c)) );
3045 __ sdc1(f10, MemOperand(a0, OFFSET_OF(Test, d)) ); 3045 __ sdc1(f10, MemOperand(a0, offsetof(Test, d)) );
3046 __ jr(ra); 3046 __ jr(ra);
3047 __ nop(); 3047 __ nop();
3048 Test test; 3048 Test test;
3049 CodeDesc desc; 3049 CodeDesc desc;
3050 assm.GetCode(&desc); 3050 assm.GetCode(&desc);
3051 Handle<Code> code = isolate->factory()->NewCode( 3051 Handle<Code> code = isolate->factory()->NewCode(
3052 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 3052 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
3053 F3 f = FUNCTION_CAST<F3>(code->entry()); 3053 F3 f = FUNCTION_CAST<F3>(code->entry());
3054 for (int i = 0; i < tableLength; i++) { 3054 for (int i = 0; i < tableLength; i++) {
3055 test.a = inputs_D[i]; 3055 test.a = inputs_D[i];
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
3298 int64_t r2; 3298 int64_t r2;
3299 int64_t r3; 3299 int64_t r3;
3300 int64_t r4; 3300 int64_t r4;
3301 int64_t r5; 3301 int64_t r5;
3302 int64_t r6; 3302 int64_t r6;
3303 } T; 3303 } T;
3304 T t; 3304 T t;
3305 3305
3306 Assembler assm(isolate, NULL, 0); 3306 Assembler assm(isolate, NULL, 0);
3307 3307
3308 __ ld(a4, MemOperand(a0, OFFSET_OF(T, r1))); 3308 __ ld(a4, MemOperand(a0, offsetof(T, r1)));
3309 __ nop(); 3309 __ nop();
3310 __ bitswap(a6, a4); 3310 __ bitswap(a6, a4);
3311 __ sd(a6, MemOperand(a0, OFFSET_OF(T, r1))); 3311 __ sd(a6, MemOperand(a0, offsetof(T, r1)));
3312 3312
3313 __ ld(a4, MemOperand(a0, OFFSET_OF(T, r2))); 3313 __ ld(a4, MemOperand(a0, offsetof(T, r2)));
3314 __ nop(); 3314 __ nop();
3315 __ bitswap(a6, a4); 3315 __ bitswap(a6, a4);
3316 __ sd(a6, MemOperand(a0, OFFSET_OF(T, r2))); 3316 __ sd(a6, MemOperand(a0, offsetof(T, r2)));
3317 3317
3318 __ ld(a4, MemOperand(a0, OFFSET_OF(T, r3))); 3318 __ ld(a4, MemOperand(a0, offsetof(T, r3)));
3319 __ nop(); 3319 __ nop();
3320 __ bitswap(a6, a4); 3320 __ bitswap(a6, a4);
3321 __ sd(a6, MemOperand(a0, OFFSET_OF(T, r3))); 3321 __ sd(a6, MemOperand(a0, offsetof(T, r3)));
3322 3322
3323 __ ld(a4, MemOperand(a0, OFFSET_OF(T, r4))); 3323 __ ld(a4, MemOperand(a0, offsetof(T, r4)));
3324 __ nop(); 3324 __ nop();
3325 __ bitswap(a6, a4); 3325 __ bitswap(a6, a4);
3326 __ sd(a6, MemOperand(a0, OFFSET_OF(T, r4))); 3326 __ sd(a6, MemOperand(a0, offsetof(T, r4)));
3327 3327
3328 __ ld(a4, MemOperand(a0, OFFSET_OF(T, r5))); 3328 __ ld(a4, MemOperand(a0, offsetof(T, r5)));
3329 __ nop(); 3329 __ nop();
3330 __ dbitswap(a6, a4); 3330 __ dbitswap(a6, a4);
3331 __ sd(a6, MemOperand(a0, OFFSET_OF(T, r5))); 3331 __ sd(a6, MemOperand(a0, offsetof(T, r5)));
3332 3332
3333 __ ld(a4, MemOperand(a0, OFFSET_OF(T, r6))); 3333 __ ld(a4, MemOperand(a0, offsetof(T, r6)));
3334 __ nop(); 3334 __ nop();
3335 __ dbitswap(a6, a4); 3335 __ dbitswap(a6, a4);
3336 __ sd(a6, MemOperand(a0, OFFSET_OF(T, r6))); 3336 __ sd(a6, MemOperand(a0, offsetof(T, r6)));
3337 3337
3338 __ jr(ra); 3338 __ jr(ra);
3339 __ nop(); 3339 __ nop();
3340 3340
3341 CodeDesc desc; 3341 CodeDesc desc;
3342 assm.GetCode(&desc); 3342 assm.GetCode(&desc);
3343 Handle<Code> code = isolate->factory()->NewCode( 3343 Handle<Code> code = isolate->factory()->NewCode(
3344 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 3344 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
3345 F3 f = FUNCTION_CAST<F3>(code->entry()); 3345 F3 f = FUNCTION_CAST<F3>(code->entry());
3346 t.r1 = 0x00102100781A15C3; 3346 t.r1 = 0x00102100781A15C3;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
3389 float fPosInf; 3389 float fPosInf;
3390 float fPosNorm; 3390 float fPosNorm;
3391 float fPosSubnorm; 3391 float fPosSubnorm;
3392 float fPosZero; } T; 3392 float fPosZero; } T;
3393 T t; 3393 T t;
3394 3394
3395 // Create a function that accepts &t, and loads, manipulates, and stores 3395 // Create a function that accepts &t, and loads, manipulates, and stores
3396 // the doubles t.a ... t.f. 3396 // the doubles t.a ... t.f.
3397 MacroAssembler assm(isolate, NULL, 0); 3397 MacroAssembler assm(isolate, NULL, 0);
3398 3398
3399 __ ldc1(f4, MemOperand(a0, OFFSET_OF(T, dSignalingNan))); 3399 __ ldc1(f4, MemOperand(a0, offsetof(T, dSignalingNan)));
3400 __ class_d(f6, f4); 3400 __ class_d(f6, f4);
3401 __ sdc1(f6, MemOperand(a0, OFFSET_OF(T, dSignalingNan))); 3401 __ sdc1(f6, MemOperand(a0, offsetof(T, dSignalingNan)));
3402 3402
3403 __ ldc1(f4, MemOperand(a0, OFFSET_OF(T, dQuietNan))); 3403 __ ldc1(f4, MemOperand(a0, offsetof(T, dQuietNan)));
3404 __ class_d(f6, f4); 3404 __ class_d(f6, f4);
3405 __ sdc1(f6, MemOperand(a0, OFFSET_OF(T, dQuietNan))); 3405 __ sdc1(f6, MemOperand(a0, offsetof(T, dQuietNan)));
3406 3406
3407 __ ldc1(f4, MemOperand(a0, OFFSET_OF(T, dNegInf))); 3407 __ ldc1(f4, MemOperand(a0, offsetof(T, dNegInf)));
3408 __ class_d(f6, f4); 3408 __ class_d(f6, f4);
3409 __ sdc1(f6, MemOperand(a0, OFFSET_OF(T, dNegInf))); 3409 __ sdc1(f6, MemOperand(a0, offsetof(T, dNegInf)));
3410 3410
3411 __ ldc1(f4, MemOperand(a0, OFFSET_OF(T, dNegNorm))); 3411 __ ldc1(f4, MemOperand(a0, offsetof(T, dNegNorm)));
3412 __ class_d(f6, f4); 3412 __ class_d(f6, f4);
3413 __ sdc1(f6, MemOperand(a0, OFFSET_OF(T, dNegNorm))); 3413 __ sdc1(f6, MemOperand(a0, offsetof(T, dNegNorm)));
3414 3414
3415 __ ldc1(f4, MemOperand(a0, OFFSET_OF(T, dNegSubnorm))); 3415 __ ldc1(f4, MemOperand(a0, offsetof(T, dNegSubnorm)));
3416 __ class_d(f6, f4); 3416 __ class_d(f6, f4);
3417 __ sdc1(f6, MemOperand(a0, OFFSET_OF(T, dNegSubnorm))); 3417 __ sdc1(f6, MemOperand(a0, offsetof(T, dNegSubnorm)));
3418 3418
3419 __ ldc1(f4, MemOperand(a0, OFFSET_OF(T, dNegZero))); 3419 __ ldc1(f4, MemOperand(a0, offsetof(T, dNegZero)));
3420 __ class_d(f6, f4); 3420 __ class_d(f6, f4);
3421 __ sdc1(f6, MemOperand(a0, OFFSET_OF(T, dNegZero))); 3421 __ sdc1(f6, MemOperand(a0, offsetof(T, dNegZero)));
3422 3422
3423 __ ldc1(f4, MemOperand(a0, OFFSET_OF(T, dPosInf))); 3423 __ ldc1(f4, MemOperand(a0, offsetof(T, dPosInf)));
3424 __ class_d(f6, f4); 3424 __ class_d(f6, f4);
3425 __ sdc1(f6, MemOperand(a0, OFFSET_OF(T, dPosInf))); 3425 __ sdc1(f6, MemOperand(a0, offsetof(T, dPosInf)));
3426 3426
3427 __ ldc1(f4, MemOperand(a0, OFFSET_OF(T, dPosNorm))); 3427 __ ldc1(f4, MemOperand(a0, offsetof(T, dPosNorm)));
3428 __ class_d(f6, f4); 3428 __ class_d(f6, f4);
3429 __ sdc1(f6, MemOperand(a0, OFFSET_OF(T, dPosNorm))); 3429 __ sdc1(f6, MemOperand(a0, offsetof(T, dPosNorm)));
3430 3430
3431 __ ldc1(f4, MemOperand(a0, OFFSET_OF(T, dPosSubnorm))); 3431 __ ldc1(f4, MemOperand(a0, offsetof(T, dPosSubnorm)));
3432 __ class_d(f6, f4); 3432 __ class_d(f6, f4);
3433 __ sdc1(f6, MemOperand(a0, OFFSET_OF(T, dPosSubnorm))); 3433 __ sdc1(f6, MemOperand(a0, offsetof(T, dPosSubnorm)));
3434 3434
3435 __ ldc1(f4, MemOperand(a0, OFFSET_OF(T, dPosZero))); 3435 __ ldc1(f4, MemOperand(a0, offsetof(T, dPosZero)));
3436 __ class_d(f6, f4); 3436 __ class_d(f6, f4);
3437 __ sdc1(f6, MemOperand(a0, OFFSET_OF(T, dPosZero))); 3437 __ sdc1(f6, MemOperand(a0, offsetof(T, dPosZero)));
3438 3438
3439 // Testing instruction CLASS.S 3439 // Testing instruction CLASS.S
3440 __ lwc1(f4, MemOperand(a0, OFFSET_OF(T, fSignalingNan))); 3440 __ lwc1(f4, MemOperand(a0, offsetof(T, fSignalingNan)));
3441 __ class_s(f6, f4); 3441 __ class_s(f6, f4);
3442 __ swc1(f6, MemOperand(a0, OFFSET_OF(T, fSignalingNan))); 3442 __ swc1(f6, MemOperand(a0, offsetof(T, fSignalingNan)));
3443 3443
3444 __ lwc1(f4, MemOperand(a0, OFFSET_OF(T, fQuietNan))); 3444 __ lwc1(f4, MemOperand(a0, offsetof(T, fQuietNan)));
3445 __ class_s(f6, f4); 3445 __ class_s(f6, f4);
3446 __ swc1(f6, MemOperand(a0, OFFSET_OF(T, fQuietNan))); 3446 __ swc1(f6, MemOperand(a0, offsetof(T, fQuietNan)));
3447 3447
3448 __ lwc1(f4, MemOperand(a0, OFFSET_OF(T, fNegInf))); 3448 __ lwc1(f4, MemOperand(a0, offsetof(T, fNegInf)));
3449 __ class_s(f6, f4); 3449 __ class_s(f6, f4);
3450 __ swc1(f6, MemOperand(a0, OFFSET_OF(T, fNegInf))); 3450 __ swc1(f6, MemOperand(a0, offsetof(T, fNegInf)));
3451 3451
3452 __ lwc1(f4, MemOperand(a0, OFFSET_OF(T, fNegNorm))); 3452 __ lwc1(f4, MemOperand(a0, offsetof(T, fNegNorm)));
3453 __ class_s(f6, f4); 3453 __ class_s(f6, f4);
3454 __ swc1(f6, MemOperand(a0, OFFSET_OF(T, fNegNorm))); 3454 __ swc1(f6, MemOperand(a0, offsetof(T, fNegNorm)));
3455 3455
3456 __ lwc1(f4, MemOperand(a0, OFFSET_OF(T, fNegSubnorm))); 3456 __ lwc1(f4, MemOperand(a0, offsetof(T, fNegSubnorm)));
3457 __ class_s(f6, f4); 3457 __ class_s(f6, f4);
3458 __ swc1(f6, MemOperand(a0, OFFSET_OF(T, fNegSubnorm))); 3458 __ swc1(f6, MemOperand(a0, offsetof(T, fNegSubnorm)));
3459 3459
3460 __ lwc1(f4, MemOperand(a0, OFFSET_OF(T, fNegZero))); 3460 __ lwc1(f4, MemOperand(a0, offsetof(T, fNegZero)));
3461 __ class_s(f6, f4); 3461 __ class_s(f6, f4);
3462 __ swc1(f6, MemOperand(a0, OFFSET_OF(T, fNegZero))); 3462 __ swc1(f6, MemOperand(a0, offsetof(T, fNegZero)));
3463 3463
3464 __ lwc1(f4, MemOperand(a0, OFFSET_OF(T, fPosInf))); 3464 __ lwc1(f4, MemOperand(a0, offsetof(T, fPosInf)));
3465 __ class_s(f6, f4); 3465 __ class_s(f6, f4);
3466 __ swc1(f6, MemOperand(a0, OFFSET_OF(T, fPosInf))); 3466 __ swc1(f6, MemOperand(a0, offsetof(T, fPosInf)));
3467 3467
3468 __ lwc1(f4, MemOperand(a0, OFFSET_OF(T, fPosNorm))); 3468 __ lwc1(f4, MemOperand(a0, offsetof(T, fPosNorm)));
3469 __ class_s(f6, f4); 3469 __ class_s(f6, f4);
3470 __ swc1(f6, MemOperand(a0, OFFSET_OF(T, fPosNorm))); 3470 __ swc1(f6, MemOperand(a0, offsetof(T, fPosNorm)));
3471 3471
3472 __ lwc1(f4, MemOperand(a0, OFFSET_OF(T, fPosSubnorm))); 3472 __ lwc1(f4, MemOperand(a0, offsetof(T, fPosSubnorm)));
3473 __ class_s(f6, f4); 3473 __ class_s(f6, f4);
3474 __ swc1(f6, MemOperand(a0, OFFSET_OF(T, fPosSubnorm))); 3474 __ swc1(f6, MemOperand(a0, offsetof(T, fPosSubnorm)));
3475 3475
3476 __ lwc1(f4, MemOperand(a0, OFFSET_OF(T, fPosZero))); 3476 __ lwc1(f4, MemOperand(a0, offsetof(T, fPosZero)));
3477 __ class_s(f6, f4); 3477 __ class_s(f6, f4);
3478 __ swc1(f6, MemOperand(a0, OFFSET_OF(T, fPosZero))); 3478 __ swc1(f6, MemOperand(a0, offsetof(T, fPosZero)));
3479 3479
3480 __ jr(ra); 3480 __ jr(ra);
3481 __ nop(); 3481 __ nop();
3482 3482
3483 CodeDesc desc; 3483 CodeDesc desc;
3484 assm.GetCode(&desc); 3484 assm.GetCode(&desc);
3485 Handle<Code> code = isolate->factory()->NewCode( 3485 Handle<Code> code = isolate->factory()->NewCode(
3486 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 3486 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
3487 F3 f = FUNCTION_CAST<F3>(code->entry()); 3487 F3 f = FUNCTION_CAST<F3>(code->entry());
3488 3488
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
3545 int64_t fir; 3545 int64_t fir;
3546 double a; 3546 double a;
3547 float b; 3547 float b;
3548 double fcsr; 3548 double fcsr;
3549 } TestFloat; 3549 } TestFloat;
3550 3550
3551 TestFloat test; 3551 TestFloat test;
3552 3552
3553 // Save FIR. 3553 // Save FIR.
3554 __ cfc1(a1, FCSR); 3554 __ cfc1(a1, FCSR);
3555 __ sd(a1, MemOperand(a0, OFFSET_OF(TestFloat, fcsr))); 3555 __ sd(a1, MemOperand(a0, offsetof(TestFloat, fcsr)));
3556 // Disable FPU exceptions. 3556 // Disable FPU exceptions.
3557 __ ctc1(zero_reg, FCSR); 3557 __ ctc1(zero_reg, FCSR);
3558 3558
3559 __ ldc1(f4, MemOperand(a0, OFFSET_OF(TestFloat, a))); 3559 __ ldc1(f4, MemOperand(a0, offsetof(TestFloat, a)));
3560 __ abs_d(f10, f4); 3560 __ abs_d(f10, f4);
3561 __ sdc1(f10, MemOperand(a0, OFFSET_OF(TestFloat, a))); 3561 __ sdc1(f10, MemOperand(a0, offsetof(TestFloat, a)));
3562 3562
3563 __ lwc1(f4, MemOperand(a0, OFFSET_OF(TestFloat, b))); 3563 __ lwc1(f4, MemOperand(a0, offsetof(TestFloat, b)));
3564 __ abs_s(f10, f4); 3564 __ abs_s(f10, f4);
3565 __ swc1(f10, MemOperand(a0, OFFSET_OF(TestFloat, b))); 3565 __ swc1(f10, MemOperand(a0, offsetof(TestFloat, b)));
3566 3566
3567 // Restore FCSR. 3567 // Restore FCSR.
3568 __ ctc1(a1, FCSR); 3568 __ ctc1(a1, FCSR);
3569 3569
3570 __ jr(ra); 3570 __ jr(ra);
3571 __ nop(); 3571 __ nop();
3572 3572
3573 CodeDesc desc; 3573 CodeDesc desc;
3574 assm.GetCode(&desc); 3574 assm.GetCode(&desc);
3575 Handle<Code> code = isolate->factory()->NewCode( 3575 Handle<Code> code = isolate->factory()->NewCode(
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
3643 double a; 3643 double a;
3644 double b; 3644 double b;
3645 double c; 3645 double c;
3646 float fa; 3646 float fa;
3647 float fb; 3647 float fb;
3648 float fc; 3648 float fc;
3649 } TestFloat; 3649 } TestFloat;
3650 3650
3651 TestFloat test; 3651 TestFloat test;
3652 3652
3653 __ ldc1(f4, MemOperand(a0, OFFSET_OF(TestFloat, a))); 3653 __ ldc1(f4, MemOperand(a0, offsetof(TestFloat, a)));
3654 __ ldc1(f8, MemOperand(a0, OFFSET_OF(TestFloat, b))); 3654 __ ldc1(f8, MemOperand(a0, offsetof(TestFloat, b)));
3655 __ add_d(f10, f8, f4); 3655 __ add_d(f10, f8, f4);
3656 __ sdc1(f10, MemOperand(a0, OFFSET_OF(TestFloat, c))); 3656 __ sdc1(f10, MemOperand(a0, offsetof(TestFloat, c)));
3657 3657
3658 __ lwc1(f4, MemOperand(a0, OFFSET_OF(TestFloat, fa))); 3658 __ lwc1(f4, MemOperand(a0, offsetof(TestFloat, fa)));
3659 __ lwc1(f8, MemOperand(a0, OFFSET_OF(TestFloat, fb))); 3659 __ lwc1(f8, MemOperand(a0, offsetof(TestFloat, fb)));
3660 __ add_s(f10, f8, f4); 3660 __ add_s(f10, f8, f4);
3661 __ swc1(f10, MemOperand(a0, OFFSET_OF(TestFloat, fc))); 3661 __ swc1(f10, MemOperand(a0, offsetof(TestFloat, fc)));
3662 3662
3663 __ jr(ra); 3663 __ jr(ra);
3664 __ nop(); 3664 __ nop();
3665 3665
3666 CodeDesc desc; 3666 CodeDesc desc;
3667 assm.GetCode(&desc); 3667 assm.GetCode(&desc);
3668 Handle<Code> code = isolate->factory()->NewCode( 3668 Handle<Code> code = isolate->factory()->NewCode(
3669 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 3669 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
3670 F3 f = FUNCTION_CAST<F3>(code->entry()); 3670 F3 f = FUNCTION_CAST<F3>(code->entry());
3671 test.a = 2.0; 3671 test.a = 2.0;
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
3729 uint32_t fOlt; 3729 uint32_t fOlt;
3730 uint32_t fUlt; 3730 uint32_t fUlt;
3731 uint32_t fOle; 3731 uint32_t fOle;
3732 uint32_t fUle; 3732 uint32_t fUle;
3733 } TestFloat; 3733 } TestFloat;
3734 3734
3735 TestFloat test; 3735 TestFloat test;
3736 3736
3737 __ li(t1, 1); 3737 __ li(t1, 1);
3738 3738
3739 __ ldc1(f4, MemOperand(a0, OFFSET_OF(TestFloat, dOp1))); 3739 __ ldc1(f4, MemOperand(a0, offsetof(TestFloat, dOp1)));
3740 __ ldc1(f6, MemOperand(a0, OFFSET_OF(TestFloat, dOp2))); 3740 __ ldc1(f6, MemOperand(a0, offsetof(TestFloat, dOp2)));
3741 3741
3742 __ lwc1(f14, MemOperand(a0, OFFSET_OF(TestFloat, fOp1))); 3742 __ lwc1(f14, MemOperand(a0, offsetof(TestFloat, fOp1)));
3743 __ lwc1(f16, MemOperand(a0, OFFSET_OF(TestFloat, fOp2))); 3743 __ lwc1(f16, MemOperand(a0, offsetof(TestFloat, fOp2)));
3744 3744
3745 __ mov(t2, zero_reg); 3745 __ mov(t2, zero_reg);
3746 __ mov(t3, zero_reg); 3746 __ mov(t3, zero_reg);
3747 __ c_d(F, f4, f6, 0); 3747 __ c_d(F, f4, f6, 0);
3748 __ c_s(F, f14, f16, 2); 3748 __ c_s(F, f14, f16, 2);
3749 __ movt(t2, t1, 0); 3749 __ movt(t2, t1, 0);
3750 __ movt(t3, t1, 2); 3750 __ movt(t3, t1, 2);
3751 __ sw(t2, MemOperand(a0, OFFSET_OF(TestFloat, dF)) ); 3751 __ sw(t2, MemOperand(a0, offsetof(TestFloat, dF)) );
3752 __ sw(t3, MemOperand(a0, OFFSET_OF(TestFloat, fF)) ); 3752 __ sw(t3, MemOperand(a0, offsetof(TestFloat, fF)) );
3753 3753
3754 __ mov(t2, zero_reg); 3754 __ mov(t2, zero_reg);
3755 __ mov(t3, zero_reg); 3755 __ mov(t3, zero_reg);
3756 __ c_d(UN, f4, f6, 2); 3756 __ c_d(UN, f4, f6, 2);
3757 __ c_s(UN, f14, f16, 4); 3757 __ c_s(UN, f14, f16, 4);
3758 __ movt(t2, t1, 2); 3758 __ movt(t2, t1, 2);
3759 __ movt(t3, t1, 4); 3759 __ movt(t3, t1, 4);
3760 __ sw(t2, MemOperand(a0, OFFSET_OF(TestFloat, dUn)) ); 3760 __ sw(t2, MemOperand(a0, offsetof(TestFloat, dUn)) );
3761 __ sw(t3, MemOperand(a0, OFFSET_OF(TestFloat, fUn)) ); 3761 __ sw(t3, MemOperand(a0, offsetof(TestFloat, fUn)) );
3762 3762
3763 __ mov(t2, zero_reg); 3763 __ mov(t2, zero_reg);
3764 __ mov(t3, zero_reg); 3764 __ mov(t3, zero_reg);
3765 __ c_d(EQ, f4, f6, 4); 3765 __ c_d(EQ, f4, f6, 4);
3766 __ c_s(EQ, f14, f16, 6); 3766 __ c_s(EQ, f14, f16, 6);
3767 __ movt(t2, t1, 4); 3767 __ movt(t2, t1, 4);
3768 __ movt(t3, t1, 6); 3768 __ movt(t3, t1, 6);
3769 __ sw(t2, MemOperand(a0, OFFSET_OF(TestFloat, dEq)) ); 3769 __ sw(t2, MemOperand(a0, offsetof(TestFloat, dEq)) );
3770 __ sw(t3, MemOperand(a0, OFFSET_OF(TestFloat, fEq)) ); 3770 __ sw(t3, MemOperand(a0, offsetof(TestFloat, fEq)) );
3771 3771
3772 __ mov(t2, zero_reg); 3772 __ mov(t2, zero_reg);
3773 __ mov(t3, zero_reg); 3773 __ mov(t3, zero_reg);
3774 __ c_d(UEQ, f4, f6, 6); 3774 __ c_d(UEQ, f4, f6, 6);
3775 __ c_s(UEQ, f14, f16, 0); 3775 __ c_s(UEQ, f14, f16, 0);
3776 __ movt(t2, t1, 6); 3776 __ movt(t2, t1, 6);
3777 __ movt(t3, t1, 0); 3777 __ movt(t3, t1, 0);
3778 __ sw(t2, MemOperand(a0, OFFSET_OF(TestFloat, dUeq)) ); 3778 __ sw(t2, MemOperand(a0, offsetof(TestFloat, dUeq)) );
3779 __ sw(t3, MemOperand(a0, OFFSET_OF(TestFloat, fUeq)) ); 3779 __ sw(t3, MemOperand(a0, offsetof(TestFloat, fUeq)) );
3780 3780
3781 __ mov(t2, zero_reg); 3781 __ mov(t2, zero_reg);
3782 __ mov(t3, zero_reg); 3782 __ mov(t3, zero_reg);
3783 __ c_d(OLT, f4, f6, 0); 3783 __ c_d(OLT, f4, f6, 0);
3784 __ c_s(OLT, f14, f16, 2); 3784 __ c_s(OLT, f14, f16, 2);
3785 __ movt(t2, t1, 0); 3785 __ movt(t2, t1, 0);
3786 __ movt(t3, t1, 2); 3786 __ movt(t3, t1, 2);
3787 __ sw(t2, MemOperand(a0, OFFSET_OF(TestFloat, dOlt)) ); 3787 __ sw(t2, MemOperand(a0, offsetof(TestFloat, dOlt)) );
3788 __ sw(t3, MemOperand(a0, OFFSET_OF(TestFloat, fOlt)) ); 3788 __ sw(t3, MemOperand(a0, offsetof(TestFloat, fOlt)) );
3789 3789
3790 __ mov(t2, zero_reg); 3790 __ mov(t2, zero_reg);
3791 __ mov(t3, zero_reg); 3791 __ mov(t3, zero_reg);
3792 __ c_d(ULT, f4, f6, 2); 3792 __ c_d(ULT, f4, f6, 2);
3793 __ c_s(ULT, f14, f16, 4); 3793 __ c_s(ULT, f14, f16, 4);
3794 __ movt(t2, t1, 2); 3794 __ movt(t2, t1, 2);
3795 __ movt(t3, t1, 4); 3795 __ movt(t3, t1, 4);
3796 __ sw(t2, MemOperand(a0, OFFSET_OF(TestFloat, dUlt)) ); 3796 __ sw(t2, MemOperand(a0, offsetof(TestFloat, dUlt)) );
3797 __ sw(t3, MemOperand(a0, OFFSET_OF(TestFloat, fUlt)) ); 3797 __ sw(t3, MemOperand(a0, offsetof(TestFloat, fUlt)) );
3798 3798
3799 __ mov(t2, zero_reg); 3799 __ mov(t2, zero_reg);
3800 __ mov(t3, zero_reg); 3800 __ mov(t3, zero_reg);
3801 __ c_d(OLE, f4, f6, 4); 3801 __ c_d(OLE, f4, f6, 4);
3802 __ c_s(OLE, f14, f16, 6); 3802 __ c_s(OLE, f14, f16, 6);
3803 __ movt(t2, t1, 4); 3803 __ movt(t2, t1, 4);
3804 __ movt(t3, t1, 6); 3804 __ movt(t3, t1, 6);
3805 __ sw(t2, MemOperand(a0, OFFSET_OF(TestFloat, dOle)) ); 3805 __ sw(t2, MemOperand(a0, offsetof(TestFloat, dOle)) );
3806 __ sw(t3, MemOperand(a0, OFFSET_OF(TestFloat, fOle)) ); 3806 __ sw(t3, MemOperand(a0, offsetof(TestFloat, fOle)) );
3807 3807
3808 __ mov(t2, zero_reg); 3808 __ mov(t2, zero_reg);
3809 __ mov(t3, zero_reg); 3809 __ mov(t3, zero_reg);
3810 __ c_d(ULE, f4, f6, 6); 3810 __ c_d(ULE, f4, f6, 6);
3811 __ c_s(ULE, f14, f16, 0); 3811 __ c_s(ULE, f14, f16, 0);
3812 __ movt(t2, t1, 6); 3812 __ movt(t2, t1, 6);
3813 __ movt(t3, t1, 0); 3813 __ movt(t3, t1, 0);
3814 __ sw(t2, MemOperand(a0, OFFSET_OF(TestFloat, dUle)) ); 3814 __ sw(t2, MemOperand(a0, offsetof(TestFloat, dUle)) );
3815 __ sw(t3, MemOperand(a0, OFFSET_OF(TestFloat, fUle)) ); 3815 __ sw(t3, MemOperand(a0, offsetof(TestFloat, fUle)) );
3816 3816
3817 __ jr(ra); 3817 __ jr(ra);
3818 __ nop(); 3818 __ nop();
3819 3819
3820 CodeDesc desc; 3820 CodeDesc desc;
3821 assm.GetCode(&desc); 3821 assm.GetCode(&desc);
3822 Handle<Code> code = isolate->factory()->NewCode( 3822 Handle<Code> code = isolate->factory()->NewCode(
3823 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 3823 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
3824 F3 f = FUNCTION_CAST<F3>(code->entry()); 3824 F3 f = FUNCTION_CAST<F3>(code->entry());
3825 test.dOp1 = 2.0; 3825 test.dOp1 = 2.0;
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
3946 float fUle; 3946 float fUle;
3947 float fOr; 3947 float fOr;
3948 float fUne; 3948 float fUne;
3949 float fNe; 3949 float fNe;
3950 } TestFloat; 3950 } TestFloat;
3951 3951
3952 TestFloat test; 3952 TestFloat test;
3953 3953
3954 __ li(t1, 1); 3954 __ li(t1, 1);
3955 3955
3956 __ ldc1(f4, MemOperand(a0, OFFSET_OF(TestFloat, dOp1))); 3956 __ ldc1(f4, MemOperand(a0, offsetof(TestFloat, dOp1)));
3957 __ ldc1(f6, MemOperand(a0, OFFSET_OF(TestFloat, dOp2))); 3957 __ ldc1(f6, MemOperand(a0, offsetof(TestFloat, dOp2)));
3958 3958
3959 __ lwc1(f14, MemOperand(a0, OFFSET_OF(TestFloat, fOp1))); 3959 __ lwc1(f14, MemOperand(a0, offsetof(TestFloat, fOp1)));
3960 __ lwc1(f16, MemOperand(a0, OFFSET_OF(TestFloat, fOp2))); 3960 __ lwc1(f16, MemOperand(a0, offsetof(TestFloat, fOp2)));
3961 3961
3962 __ cmp_d(F, f2, f4, f6); 3962 __ cmp_d(F, f2, f4, f6);
3963 __ cmp_s(F, f12, f14, f16); 3963 __ cmp_s(F, f12, f14, f16);
3964 __ sdc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, dF)) ); 3964 __ sdc1(f2, MemOperand(a0, offsetof(TestFloat, dF)) );
3965 __ swc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, fF)) ); 3965 __ swc1(f12, MemOperand(a0, offsetof(TestFloat, fF)) );
3966 3966
3967 __ cmp_d(UN, f2, f4, f6); 3967 __ cmp_d(UN, f2, f4, f6);
3968 __ cmp_s(UN, f12, f14, f16); 3968 __ cmp_s(UN, f12, f14, f16);
3969 __ sdc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, dUn)) ); 3969 __ sdc1(f2, MemOperand(a0, offsetof(TestFloat, dUn)) );
3970 __ swc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, fUn)) ); 3970 __ swc1(f12, MemOperand(a0, offsetof(TestFloat, fUn)) );
3971 3971
3972 __ cmp_d(EQ, f2, f4, f6); 3972 __ cmp_d(EQ, f2, f4, f6);
3973 __ cmp_s(EQ, f12, f14, f16); 3973 __ cmp_s(EQ, f12, f14, f16);
3974 __ sdc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, dEq)) ); 3974 __ sdc1(f2, MemOperand(a0, offsetof(TestFloat, dEq)) );
3975 __ swc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, fEq)) ); 3975 __ swc1(f12, MemOperand(a0, offsetof(TestFloat, fEq)) );
3976 3976
3977 __ cmp_d(UEQ, f2, f4, f6); 3977 __ cmp_d(UEQ, f2, f4, f6);
3978 __ cmp_s(UEQ, f12, f14, f16); 3978 __ cmp_s(UEQ, f12, f14, f16);
3979 __ sdc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, dUeq)) ); 3979 __ sdc1(f2, MemOperand(a0, offsetof(TestFloat, dUeq)) );
3980 __ swc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, fUeq)) ); 3980 __ swc1(f12, MemOperand(a0, offsetof(TestFloat, fUeq)) );
3981 3981
3982 __ cmp_d(LT, f2, f4, f6); 3982 __ cmp_d(LT, f2, f4, f6);
3983 __ cmp_s(LT, f12, f14, f16); 3983 __ cmp_s(LT, f12, f14, f16);
3984 __ sdc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, dOlt)) ); 3984 __ sdc1(f2, MemOperand(a0, offsetof(TestFloat, dOlt)) );
3985 __ swc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, fOlt)) ); 3985 __ swc1(f12, MemOperand(a0, offsetof(TestFloat, fOlt)) );
3986 3986
3987 __ cmp_d(ULT, f2, f4, f6); 3987 __ cmp_d(ULT, f2, f4, f6);
3988 __ cmp_s(ULT, f12, f14, f16); 3988 __ cmp_s(ULT, f12, f14, f16);
3989 __ sdc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, dUlt)) ); 3989 __ sdc1(f2, MemOperand(a0, offsetof(TestFloat, dUlt)) );
3990 __ swc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, fUlt)) ); 3990 __ swc1(f12, MemOperand(a0, offsetof(TestFloat, fUlt)) );
3991 3991
3992 __ cmp_d(LE, f2, f4, f6); 3992 __ cmp_d(LE, f2, f4, f6);
3993 __ cmp_s(LE, f12, f14, f16); 3993 __ cmp_s(LE, f12, f14, f16);
3994 __ sdc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, dOle)) ); 3994 __ sdc1(f2, MemOperand(a0, offsetof(TestFloat, dOle)) );
3995 __ swc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, fOle)) ); 3995 __ swc1(f12, MemOperand(a0, offsetof(TestFloat, fOle)) );
3996 3996
3997 __ cmp_d(ULE, f2, f4, f6); 3997 __ cmp_d(ULE, f2, f4, f6);
3998 __ cmp_s(ULE, f12, f14, f16); 3998 __ cmp_s(ULE, f12, f14, f16);
3999 __ sdc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, dUle)) ); 3999 __ sdc1(f2, MemOperand(a0, offsetof(TestFloat, dUle)) );
4000 __ swc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, fUle)) ); 4000 __ swc1(f12, MemOperand(a0, offsetof(TestFloat, fUle)) );
4001 4001
4002 __ cmp_d(ORD, f2, f4, f6); 4002 __ cmp_d(ORD, f2, f4, f6);
4003 __ cmp_s(ORD, f12, f14, f16); 4003 __ cmp_s(ORD, f12, f14, f16);
4004 __ sdc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, dOr)) ); 4004 __ sdc1(f2, MemOperand(a0, offsetof(TestFloat, dOr)) );
4005 __ swc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, fOr)) ); 4005 __ swc1(f12, MemOperand(a0, offsetof(TestFloat, fOr)) );
4006 4006
4007 __ cmp_d(UNE, f2, f4, f6); 4007 __ cmp_d(UNE, f2, f4, f6);
4008 __ cmp_s(UNE, f12, f14, f16); 4008 __ cmp_s(UNE, f12, f14, f16);
4009 __ sdc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, dUne)) ); 4009 __ sdc1(f2, MemOperand(a0, offsetof(TestFloat, dUne)) );
4010 __ swc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, fUne)) ); 4010 __ swc1(f12, MemOperand(a0, offsetof(TestFloat, fUne)) );
4011 4011
4012 __ cmp_d(NE, f2, f4, f6); 4012 __ cmp_d(NE, f2, f4, f6);
4013 __ cmp_s(NE, f12, f14, f16); 4013 __ cmp_s(NE, f12, f14, f16);
4014 __ sdc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, dNe)) ); 4014 __ sdc1(f2, MemOperand(a0, offsetof(TestFloat, dNe)) );
4015 __ swc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, fNe)) ); 4015 __ swc1(f12, MemOperand(a0, offsetof(TestFloat, fNe)) );
4016 4016
4017 __ jr(ra); 4017 __ jr(ra);
4018 __ nop(); 4018 __ nop();
4019 4019
4020 CodeDesc desc; 4020 CodeDesc desc;
4021 assm.GetCode(&desc); 4021 assm.GetCode(&desc);
4022 Handle<Code> code = isolate->factory()->NewCode( 4022 Handle<Code> code = isolate->factory()->NewCode(
4023 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 4023 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
4024 F3 f = FUNCTION_CAST<F3>(code->entry()); 4024 F3 f = FUNCTION_CAST<F3>(code->entry());
4025 uint64_t dTrue = 0xFFFFFFFFFFFFFFFF; 4025 uint64_t dTrue = 0xFFFFFFFFFFFFFFFF;
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
4163 } TestFloat; 4163 } TestFloat;
4164 4164
4165 TestFloat test; 4165 TestFloat test;
4166 4166
4167 // Save FCSR. 4167 // Save FCSR.
4168 __ cfc1(a1, FCSR); 4168 __ cfc1(a1, FCSR);
4169 // Disable FPU exceptions. 4169 // Disable FPU exceptions.
4170 __ ctc1(zero_reg, FCSR); 4170 __ ctc1(zero_reg, FCSR);
4171 4171
4172 #define GENERATE_CVT_TEST(x, y, z) \ 4172 #define GENERATE_CVT_TEST(x, y, z) \
4173 __ y##c1(f0, MemOperand(a0, OFFSET_OF(TestFloat, x##_in))); \ 4173 __ y##c1(f0, MemOperand(a0, offsetof(TestFloat, x##_in))); \
4174 __ x(f0, f0); \ 4174 __ x(f0, f0); \
4175 __ nop(); \ 4175 __ nop(); \
4176 __ z##c1(f0, MemOperand(a0, OFFSET_OF(TestFloat, x##_out))); 4176 __ z##c1(f0, MemOperand(a0, offsetof(TestFloat, x##_out)));
4177 4177
4178 GENERATE_CVT_TEST(cvt_d_s, lw, sd) 4178 GENERATE_CVT_TEST(cvt_d_s, lw, sd)
4179 GENERATE_CVT_TEST(cvt_d_w, lw, sd) 4179 GENERATE_CVT_TEST(cvt_d_w, lw, sd)
4180 GENERATE_CVT_TEST(cvt_d_l, ld, sd) 4180 GENERATE_CVT_TEST(cvt_d_l, ld, sd)
4181 4181
4182 GENERATE_CVT_TEST(cvt_l_s, lw, sd) 4182 GENERATE_CVT_TEST(cvt_l_s, lw, sd)
4183 GENERATE_CVT_TEST(cvt_l_d, ld, sd) 4183 GENERATE_CVT_TEST(cvt_l_d, ld, sd)
4184 4184
4185 GENERATE_CVT_TEST(cvt_s_d, ld, sw) 4185 GENERATE_CVT_TEST(cvt_s_d, ld, sw)
4186 GENERATE_CVT_TEST(cvt_s_w, lw, sw) 4186 GENERATE_CVT_TEST(cvt_s_w, lw, sw)
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
4343 float fRes; 4343 float fRes;
4344 } Test; 4344 } Test;
4345 4345
4346 Test test; 4346 Test test;
4347 4347
4348 // Save FCSR. 4348 // Save FCSR.
4349 __ cfc1(a1, FCSR); 4349 __ cfc1(a1, FCSR);
4350 // Disable FPU exceptions. 4350 // Disable FPU exceptions.
4351 __ ctc1(zero_reg, FCSR); 4351 __ ctc1(zero_reg, FCSR);
4352 4352
4353 __ ldc1(f4, MemOperand(a0, OFFSET_OF(Test, dOp1)) ); 4353 __ ldc1(f4, MemOperand(a0, offsetof(Test, dOp1)) );
4354 __ ldc1(f2, MemOperand(a0, OFFSET_OF(Test, dOp2)) ); 4354 __ ldc1(f2, MemOperand(a0, offsetof(Test, dOp2)) );
4355 __ nop(); 4355 __ nop();
4356 __ div_d(f6, f4, f2); 4356 __ div_d(f6, f4, f2);
4357 __ sdc1(f6, MemOperand(a0, OFFSET_OF(Test, dRes)) ); 4357 __ sdc1(f6, MemOperand(a0, offsetof(Test, dRes)) );
4358 4358
4359 __ lwc1(f4, MemOperand(a0, OFFSET_OF(Test, fOp1)) ); 4359 __ lwc1(f4, MemOperand(a0, offsetof(Test, fOp1)) );
4360 __ lwc1(f2, MemOperand(a0, OFFSET_OF(Test, fOp2)) ); 4360 __ lwc1(f2, MemOperand(a0, offsetof(Test, fOp2)) );
4361 __ nop(); 4361 __ nop();
4362 __ div_s(f6, f4, f2); 4362 __ div_s(f6, f4, f2);
4363 __ swc1(f6, MemOperand(a0, OFFSET_OF(Test, fRes)) ); 4363 __ swc1(f6, MemOperand(a0, offsetof(Test, fRes)) );
4364 4364
4365 // Restore FCSR. 4365 // Restore FCSR.
4366 __ ctc1(a1, FCSR); 4366 __ ctc1(a1, FCSR);
4367 4367
4368 __ jr(ra); 4368 __ jr(ra);
4369 __ nop(); 4369 __ nop();
4370 CodeDesc desc; 4370 CodeDesc desc;
4371 assm.GetCode(&desc); 4371 assm.GetCode(&desc);
4372 Handle<Code> code = isolate->factory()->NewCode( 4372 Handle<Code> code = isolate->factory()->NewCode(
4373 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 4373 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
4442 test.fOp1 = std::numeric_limits<float>::quiet_NaN(); 4442 test.fOp1 = std::numeric_limits<float>::quiet_NaN();
4443 test.fOp2 = -5.0; 4443 test.fOp2 = -5.0;
4444 4444
4445 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 4445 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0));
4446 CHECK_EQ(true, std::isnan(test.dRes)); 4446 CHECK_EQ(true, std::isnan(test.dRes));
4447 CHECK_EQ(true, std::isnan(test.fRes)); 4447 CHECK_EQ(true, std::isnan(test.fRes));
4448 } 4448 }
4449 4449
4450 4450
4451 #undef __ 4451 #undef __
OLDNEW
« no previous file with comments | « test/cctest/test-assembler-mips.cc ('k') | test/cctest/test-assembler-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698