OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 __ fwait(); | 384 __ fwait(); |
385 __ frndint(); | 385 __ frndint(); |
386 __ fninit(); | 386 __ fninit(); |
387 __ nop(); | 387 __ nop(); |
388 | 388 |
389 // SSE instruction | 389 // SSE instruction |
390 { | 390 { |
391 // Move operation | 391 // Move operation |
392 __ movaps(xmm0, xmm1); | 392 __ movaps(xmm0, xmm1); |
393 __ shufps(xmm0, xmm0, 0x0); | 393 __ shufps(xmm0, xmm0, 0x0); |
394 __ movups(xmm1, Operand(ebx, ecx, times_4, 10000)); | |
395 __ movups(Operand(ebx, ecx, times_4, 10000), xmm1); | |
396 __ cvtsd2ss(xmm0, xmm1); | 394 __ cvtsd2ss(xmm0, xmm1); |
397 __ cvtsd2ss(xmm0, Operand(ebx, ecx, times_4, 10000)); | 395 __ cvtsd2ss(xmm0, Operand(ebx, ecx, times_4, 10000)); |
398 | 396 |
399 // logic operation | 397 // logic operation |
400 __ andps(xmm0, xmm1); | 398 __ andps(xmm0, xmm1); |
401 __ andps(xmm0, Operand(ebx, ecx, times_4, 10000)); | 399 __ andps(xmm0, Operand(ebx, ecx, times_4, 10000)); |
402 __ orps(xmm0, xmm1); | 400 __ orps(xmm0, xmm1); |
403 __ orps(xmm0, Operand(ebx, ecx, times_4, 10000)); | 401 __ orps(xmm0, Operand(ebx, ecx, times_4, 10000)); |
404 __ xorps(xmm0, xmm1); | 402 __ xorps(xmm0, xmm1); |
405 __ xorps(xmm0, Operand(ebx, ecx, times_4, 10000)); | 403 __ xorps(xmm0, Operand(ebx, ecx, times_4, 10000)); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 __ psllq(xmm0, 17); | 461 __ psllq(xmm0, 17); |
464 __ psllq(xmm0, xmm1); | 462 __ psllq(xmm0, xmm1); |
465 __ psrlq(xmm0, 17); | 463 __ psrlq(xmm0, 17); |
466 __ psrlq(xmm0, xmm1); | 464 __ psrlq(xmm0, xmm1); |
467 __ por(xmm0, xmm1); | 465 __ por(xmm0, xmm1); |
468 | 466 |
469 __ pcmpeqd(xmm1, xmm0); | 467 __ pcmpeqd(xmm1, xmm0); |
470 | 468 |
471 __ punpckldq(xmm1, xmm6); | 469 __ punpckldq(xmm1, xmm6); |
472 __ punpckhdq(xmm7, xmm5); | 470 __ punpckhdq(xmm7, xmm5); |
473 | |
474 __ paddd(xmm1, Operand(ebx, ecx, times_4, 10000)); | |
475 __ paddd(xmm1, xmm0); | |
476 __ psubd(xmm1, Operand(ebx, ecx, times_4, 10000)); | |
477 __ psubd(xmm1, xmm0); | |
478 __ pmuludq(xmm1, Operand(ebx, ecx, times_4, 10000)); | |
479 __ pmuludq(xmm1, xmm0); | |
480 __ punpackldq(xmm1, Operand(ebx, ecx, times_4, 10000)); | |
481 __ punpackldq(xmm1, xmm0); | |
482 | |
483 __ cvtdq2ps(xmm1, Operand(ebx, ecx, times_4, 10000)); | |
484 __ cvtdq2ps(xmm1, xmm0); | |
485 __ cvtps2dq(xmm1, Operand(ebx, ecx, times_4, 10000)); | |
486 __ cvtps2dq(xmm1, xmm0); | |
487 } | |
488 { | |
489 __ andps(xmm1, Operand(ebx, ecx, times_4, 10000)); | |
490 __ andps(xmm1, xmm0); | |
491 __ xorps(xmm1, Operand(ebx, ecx, times_4, 10000)); | |
492 __ xorps(xmm1, xmm0); | |
493 __ orps(xmm1, Operand(ebx, ecx, times_4, 10000)); | |
494 __ orps(xmm1, xmm0); | |
495 | |
496 __ addps(xmm1, Operand(ebx, ecx, times_4, 10000)); | |
497 __ addps(xmm1, xmm0); | |
498 __ subps(xmm1, Operand(ebx, ecx, times_4, 10000)); | |
499 __ subps(xmm1, xmm0); | |
500 __ mulps(xmm1, Operand(ebx, ecx, times_4, 10000)); | |
501 __ mulps(xmm1, xmm0); | |
502 __ divps(xmm1, Operand(ebx, ecx, times_4, 10000)); | |
503 __ divps(xmm1, xmm0); | |
504 __ minps(xmm1, Operand(ebx, ecx, times_4, 10000)); | |
505 __ minps(xmm1, xmm0); | |
506 __ maxps(xmm1, Operand(ebx, ecx, times_4, 10000)); | |
507 __ maxps(xmm1, xmm0); | |
508 __ rcpps(xmm1, Operand(ebx, ecx, times_4, 10000)); | |
509 __ rcpps(xmm1, xmm0); | |
510 __ rsqrtps(xmm1, Operand(ebx, ecx, times_4, 10000)); | |
511 __ rsqrtps(xmm1, xmm0); | |
512 __ sqrtps(xmm1, Operand(ebx, ecx, times_4, 10000)); | |
513 __ sqrtps(xmm1, xmm0); | |
514 | |
515 __ cmpps(xmm1, xmm0, 123); | |
516 __ cmpeqps(xmm1, xmm0); | |
517 __ cmpltps(xmm1, xmm0); | |
518 __ cmpleps(xmm1, xmm0); | |
519 __ cmpneqps(xmm1, xmm0); | |
520 __ cmpnltps(xmm1, xmm0); | |
521 __ cmpnleps(xmm1, xmm0); | |
522 } | 471 } |
523 | 472 |
524 // cmov. | 473 // cmov. |
525 { | 474 { |
526 __ cmov(overflow, eax, Operand(eax, 0)); | 475 __ cmov(overflow, eax, Operand(eax, 0)); |
527 __ cmov(no_overflow, eax, Operand(eax, 1)); | 476 __ cmov(no_overflow, eax, Operand(eax, 1)); |
528 __ cmov(below, eax, Operand(eax, 2)); | 477 __ cmov(below, eax, Operand(eax, 2)); |
529 __ cmov(above_equal, eax, Operand(eax, 3)); | 478 __ cmov(above_equal, eax, Operand(eax, 3)); |
530 __ cmov(equal, eax, Operand(ebx, 0)); | 479 __ cmov(equal, eax, Operand(ebx, 0)); |
531 __ cmov(not_equal, eax, Operand(ebx, 1)); | 480 __ cmov(not_equal, eax, Operand(ebx, 1)); |
532 __ cmov(below_equal, eax, Operand(ebx, 2)); | 481 __ cmov(below_equal, eax, Operand(ebx, 2)); |
533 __ cmov(above, eax, Operand(ebx, 3)); | 482 __ cmov(above, eax, Operand(ebx, 3)); |
534 __ cmov(sign, eax, Operand(ecx, 0)); | 483 __ cmov(sign, eax, Operand(ecx, 0)); |
535 __ cmov(not_sign, eax, Operand(ecx, 1)); | 484 __ cmov(not_sign, eax, Operand(ecx, 1)); |
536 __ cmov(parity_even, eax, Operand(ecx, 2)); | 485 __ cmov(parity_even, eax, Operand(ecx, 2)); |
537 __ cmov(parity_odd, eax, Operand(ecx, 3)); | 486 __ cmov(parity_odd, eax, Operand(ecx, 3)); |
538 __ cmov(less, eax, Operand(edx, 0)); | 487 __ cmov(less, eax, Operand(edx, 0)); |
539 __ cmov(greater_equal, eax, Operand(edx, 1)); | 488 __ cmov(greater_equal, eax, Operand(edx, 1)); |
540 __ cmov(less_equal, eax, Operand(edx, 2)); | 489 __ cmov(less_equal, eax, Operand(edx, 2)); |
541 __ cmov(greater, eax, Operand(edx, 3)); | 490 __ cmov(greater, eax, Operand(edx, 3)); |
542 } | 491 } |
543 | 492 |
544 { | 493 { |
545 if (CpuFeatures::IsSupported(SSE4_1)) { | 494 if (CpuFeatures::IsSupported(SSE4_1)) { |
546 CpuFeatureScope scope(&assm, SSE4_1); | 495 CpuFeatureScope scope(&assm, SSE4_1); |
547 __ pextrd(eax, xmm0, 1); | 496 __ pextrd(eax, xmm0, 1); |
548 __ pinsrd(xmm1, eax, 0); | 497 __ pinsrd(xmm1, eax, 0); |
549 __ extractps(eax, xmm1, 0); | 498 __ extractps(eax, xmm1, 0); |
550 __ insertps(xmm1, xmm0, 0); | |
551 __ pmulld(xmm1, Operand(ebx, ecx, times_4, 10000)); | |
552 __ pmulld(xmm1, xmm0); | |
553 } | 499 } |
554 } | 500 } |
555 | 501 |
556 // AVX instruction | 502 // AVX instruction |
557 { | 503 { |
558 if (CpuFeatures::IsSupported(AVX)) { | 504 if (CpuFeatures::IsSupported(AVX)) { |
559 CpuFeatureScope scope(&assm, AVX); | 505 CpuFeatureScope scope(&assm, AVX); |
560 __ vaddsd(xmm0, xmm1, xmm2); | 506 __ vaddsd(xmm0, xmm1, xmm2); |
561 __ vaddsd(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000)); | 507 __ vaddsd(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000)); |
562 __ vmulsd(xmm0, xmm1, xmm2); | 508 __ vmulsd(xmm0, xmm1, xmm2); |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
758 #ifdef OBJECT_PRINT | 704 #ifdef OBJECT_PRINT |
759 OFStream os(stdout); | 705 OFStream os(stdout); |
760 code->Print(os); | 706 code->Print(os); |
761 byte* begin = code->instruction_start(); | 707 byte* begin = code->instruction_start(); |
762 byte* end = begin + code->instruction_size(); | 708 byte* end = begin + code->instruction_size(); |
763 disasm::Disassembler::Disassemble(stdout, begin, end); | 709 disasm::Disassembler::Disassemble(stdout, begin, end); |
764 #endif | 710 #endif |
765 } | 711 } |
766 | 712 |
767 #undef __ | 713 #undef __ |
OLD | NEW |