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 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 __ maxsd(xmm1, xmm0); | 455 __ maxsd(xmm1, xmm0); |
456 __ maxsd(xmm1, Operand(ebx, ecx, times_4, 10000)); | 456 __ maxsd(xmm1, Operand(ebx, ecx, times_4, 10000)); |
457 __ ucomisd(xmm0, xmm1); | 457 __ ucomisd(xmm0, xmm1); |
458 __ cmpltsd(xmm0, xmm1); | 458 __ cmpltsd(xmm0, xmm1); |
459 | 459 |
460 __ andpd(xmm0, xmm1); | 460 __ andpd(xmm0, xmm1); |
461 __ psllq(xmm0, 17); | 461 __ psllq(xmm0, 17); |
462 __ psllq(xmm0, xmm1); | 462 __ psllq(xmm0, xmm1); |
463 __ psrlq(xmm0, 17); | 463 __ psrlq(xmm0, 17); |
464 __ psrlq(xmm0, xmm1); | 464 __ psrlq(xmm0, xmm1); |
465 __ por(xmm0, xmm1); | |
466 | |
467 __ pcmpeqd(xmm1, xmm0); | |
468 | |
469 __ punpckldq(xmm1, xmm6); | |
470 __ punpckhdq(xmm7, xmm5); | |
471 | 465 |
472 __ pinsrw(xmm5, edx, 5); | 466 __ pinsrw(xmm5, edx, 5); |
473 __ pinsrw(xmm5, Operand(edx, 4), 5); | 467 __ pinsrw(xmm5, Operand(edx, 4), 5); |
474 | 468 |
475 #define EMIT_SSE2_INSTR(instruction, notUsed1, notUsed2, notUsed3) \ | 469 #define EMIT_SSE2_INSTR(instruction, notUsed1, notUsed2, notUsed3) \ |
476 __ instruction(xmm5, xmm1); \ | 470 __ instruction(xmm5, xmm1); \ |
477 __ instruction(xmm5, Operand(edx, 4)); | 471 __ instruction(xmm5, Operand(edx, 4)); |
478 | 472 |
479 SSE2_INSTRUCTION_LIST(EMIT_SSE2_INSTR) | 473 SSE2_INSTRUCTION_LIST(EMIT_SSE2_INSTR) |
480 #undef EMIT_SSE2_INSTR | 474 #undef EMIT_SSE2_INSTR |
(...skipping 18 matching lines...) Expand all Loading... |
499 __ cmov(less_equal, eax, Operand(edx, 2)); | 493 __ cmov(less_equal, eax, Operand(edx, 2)); |
500 __ cmov(greater, eax, Operand(edx, 3)); | 494 __ cmov(greater, eax, Operand(edx, 3)); |
501 } | 495 } |
502 | 496 |
503 { | 497 { |
504 if (CpuFeatures::IsSupported(SSE4_1)) { | 498 if (CpuFeatures::IsSupported(SSE4_1)) { |
505 CpuFeatureScope scope(&assm, SSE4_1); | 499 CpuFeatureScope scope(&assm, SSE4_1); |
506 __ pextrd(eax, xmm0, 1); | 500 __ pextrd(eax, xmm0, 1); |
507 __ pinsrd(xmm1, eax, 0); | 501 __ pinsrd(xmm1, eax, 0); |
508 __ extractps(eax, xmm1, 0); | 502 __ extractps(eax, xmm1, 0); |
| 503 |
| 504 #define EMIT_SSE4_INSTR(instruction, notUsed1, notUsed2, notUsed3, notUsed4) \ |
| 505 __ instruction(xmm5, xmm1); \ |
| 506 __ instruction(xmm5, Operand(edx, 4)); |
| 507 |
| 508 SSE4_INSTRUCTION_LIST(EMIT_SSE4_INSTR) |
| 509 #undef EMIT_SSE4_INSTR |
509 } | 510 } |
510 } | 511 } |
511 | 512 |
512 // AVX instruction | 513 // AVX instruction |
513 { | 514 { |
514 if (CpuFeatures::IsSupported(AVX)) { | 515 if (CpuFeatures::IsSupported(AVX)) { |
515 CpuFeatureScope scope(&assm, AVX); | 516 CpuFeatureScope scope(&assm, AVX); |
516 __ vaddsd(xmm0, xmm1, xmm2); | 517 __ vaddsd(xmm0, xmm1, xmm2); |
517 __ vaddsd(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000)); | 518 __ vaddsd(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000)); |
518 __ vmulsd(xmm0, xmm1, xmm2); | 519 __ vmulsd(xmm0, xmm1, xmm2); |
(...skipping 29 matching lines...) Expand all Loading... |
548 __ vandpd(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000)); | 549 __ vandpd(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000)); |
549 __ vxorpd(xmm0, xmm1, xmm2); | 550 __ vxorpd(xmm0, xmm1, xmm2); |
550 __ vxorpd(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000)); | 551 __ vxorpd(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000)); |
551 | 552 |
552 #define EMIT_SSE2_AVXINSTR(instruction, notUsed1, notUsed2, notUsed3) \ | 553 #define EMIT_SSE2_AVXINSTR(instruction, notUsed1, notUsed2, notUsed3) \ |
553 __ v##instruction(xmm7, xmm5, xmm1); \ | 554 __ v##instruction(xmm7, xmm5, xmm1); \ |
554 __ v##instruction(xmm7, xmm5, Operand(edx, 4)); | 555 __ v##instruction(xmm7, xmm5, Operand(edx, 4)); |
555 | 556 |
556 SSE2_INSTRUCTION_LIST(EMIT_SSE2_AVXINSTR) | 557 SSE2_INSTRUCTION_LIST(EMIT_SSE2_AVXINSTR) |
557 #undef EMIT_SSE2_AVXINSTR | 558 #undef EMIT_SSE2_AVXINSTR |
| 559 |
| 560 #define EMIT_SSE4_AVXINSTR(instruction, notUsed1, notUsed2, notUsed3, \ |
| 561 notUsed4) \ |
| 562 __ v##instruction(xmm7, xmm5, xmm1); \ |
| 563 __ v##instruction(xmm7, xmm5, Operand(edx, 4)); |
| 564 |
| 565 SSE4_INSTRUCTION_LIST(EMIT_SSE4_AVXINSTR) |
| 566 #undef EMIT_SSE4_AVXINSTR |
558 } | 567 } |
559 } | 568 } |
560 | 569 |
561 // FMA3 instruction | 570 // FMA3 instruction |
562 { | 571 { |
563 if (CpuFeatures::IsSupported(FMA3)) { | 572 if (CpuFeatures::IsSupported(FMA3)) { |
564 CpuFeatureScope scope(&assm, FMA3); | 573 CpuFeatureScope scope(&assm, FMA3); |
565 __ vfmadd132sd(xmm0, xmm1, xmm2); | 574 __ vfmadd132sd(xmm0, xmm1, xmm2); |
566 __ vfmadd132sd(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000)); | 575 __ vfmadd132sd(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000)); |
567 __ vfmadd213sd(xmm0, xmm1, xmm2); | 576 __ vfmadd213sd(xmm0, xmm1, xmm2); |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
721 #ifdef OBJECT_PRINT | 730 #ifdef OBJECT_PRINT |
722 OFStream os(stdout); | 731 OFStream os(stdout); |
723 code->Print(os); | 732 code->Print(os); |
724 byte* begin = code->instruction_start(); | 733 byte* begin = code->instruction_start(); |
725 byte* end = begin + code->instruction_size(); | 734 byte* end = begin + code->instruction_size(); |
726 disasm::Disassembler::Disassemble(stdout, begin, end); | 735 disasm::Disassembler::Disassemble(stdout, begin, end); |
727 #endif | 736 #endif |
728 } | 737 } |
729 | 738 |
730 #undef __ | 739 #undef __ |
OLD | NEW |