| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 } | 47 } |
| 48 | 48 |
| 49 | 49 |
| 50 TEST(DisasmIa320) { | 50 TEST(DisasmIa320) { |
| 51 CcTest::InitializeVM(); | 51 CcTest::InitializeVM(); |
| 52 Isolate* isolate = CcTest::i_isolate(); | 52 Isolate* isolate = CcTest::i_isolate(); |
| 53 HandleScope scope(isolate); | 53 HandleScope scope(isolate); |
| 54 v8::internal::byte buffer[4096]; | 54 v8::internal::byte buffer[4096]; |
| 55 Assembler assm(isolate, buffer, sizeof buffer); | 55 Assembler assm(isolate, buffer, sizeof buffer); |
| 56 DummyStaticFunction(NULL); // just bloody use it (DELETE; debugging) | 56 DummyStaticFunction(NULL); // just bloody use it (DELETE; debugging) |
| 57 | |
| 58 // Short immediate instructions | 57 // Short immediate instructions |
| 59 __ adc(eax, 12345678); | 58 __ adc(eax, 12345678); |
| 60 __ add(eax, Immediate(12345678)); | 59 __ add(eax, Immediate(12345678)); |
| 61 __ or_(eax, 12345678); | 60 __ or_(eax, 12345678); |
| 62 __ sub(eax, Immediate(12345678)); | 61 __ sub(eax, Immediate(12345678)); |
| 63 __ xor_(eax, 12345678); | 62 __ xor_(eax, 12345678); |
| 64 __ and_(eax, 12345678); | 63 __ and_(eax, 12345678); |
| 65 Handle<FixedArray> foo = isolate->factory()->NewFixedArray(10, TENURED); | 64 Handle<FixedArray> foo = isolate->factory()->NewFixedArray(10, TENURED); |
| 66 __ cmp(eax, foo); | 65 __ cmp(eax, foo); |
| 67 | 66 |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 __ divsd(xmm1, xmm0); | 450 __ divsd(xmm1, xmm0); |
| 452 __ divsd(xmm1, Operand(ebx, ecx, times_4, 10000)); | 451 __ divsd(xmm1, Operand(ebx, ecx, times_4, 10000)); |
| 453 __ minsd(xmm1, xmm0); | 452 __ minsd(xmm1, xmm0); |
| 454 __ minsd(xmm1, Operand(ebx, ecx, times_4, 10000)); | 453 __ minsd(xmm1, Operand(ebx, ecx, times_4, 10000)); |
| 455 __ maxsd(xmm1, xmm0); | 454 __ maxsd(xmm1, xmm0); |
| 456 __ maxsd(xmm1, Operand(ebx, ecx, times_4, 10000)); | 455 __ maxsd(xmm1, Operand(ebx, ecx, times_4, 10000)); |
| 457 __ ucomisd(xmm0, xmm1); | 456 __ ucomisd(xmm0, xmm1); |
| 458 __ cmpltsd(xmm0, xmm1); | 457 __ cmpltsd(xmm0, xmm1); |
| 459 | 458 |
| 460 __ andpd(xmm0, xmm1); | 459 __ andpd(xmm0, xmm1); |
| 460 |
| 461 __ psllw(xmm0, 17); |
| 462 __ pslld(xmm0, 17); |
| 463 __ psrlw(xmm0, 17); |
| 464 __ psrld(xmm0, 17); |
| 465 __ psraw(xmm0, 17); |
| 466 __ psrad(xmm0, 17); |
| 461 __ psllq(xmm0, 17); | 467 __ psllq(xmm0, 17); |
| 462 __ psllq(xmm0, xmm1); | 468 __ psllq(xmm0, xmm1); |
| 463 __ psrlq(xmm0, 17); | 469 __ psrlq(xmm0, 17); |
| 464 __ psrlq(xmm0, xmm1); | 470 __ psrlq(xmm0, xmm1); |
| 465 | 471 |
| 466 __ pinsrw(xmm5, edx, 5); | 472 __ pinsrw(xmm5, edx, 5); |
| 467 __ pinsrw(xmm5, Operand(edx, 4), 5); | 473 __ pinsrw(xmm5, Operand(edx, 4), 5); |
| 468 | 474 |
| 469 #define EMIT_SSE2_INSTR(instruction, notUsed1, notUsed2, notUsed3) \ | 475 #define EMIT_SSE2_INSTR(instruction, notUsed1, notUsed2, notUsed3) \ |
| 470 __ instruction(xmm5, xmm1); \ | 476 __ instruction(xmm5, xmm1); \ |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 543 __ vandps(xmm0, xmm1, xmm2); | 549 __ vandps(xmm0, xmm1, xmm2); |
| 544 __ vandps(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000)); | 550 __ vandps(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000)); |
| 545 __ vxorps(xmm0, xmm1, xmm2); | 551 __ vxorps(xmm0, xmm1, xmm2); |
| 546 __ vxorps(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000)); | 552 __ vxorps(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000)); |
| 547 | 553 |
| 548 __ vandpd(xmm0, xmm1, xmm2); | 554 __ vandpd(xmm0, xmm1, xmm2); |
| 549 __ vandpd(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000)); | 555 __ vandpd(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000)); |
| 550 __ vxorpd(xmm0, xmm1, xmm2); | 556 __ vxorpd(xmm0, xmm1, xmm2); |
| 551 __ vxorpd(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000)); | 557 __ vxorpd(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000)); |
| 552 | 558 |
| 559 __ vpsllw(xmm0, xmm7, 21); |
| 560 __ vpslld(xmm0, xmm7, 21); |
| 561 __ vpsrlw(xmm0, xmm7, 21); |
| 562 __ vpsrld(xmm0, xmm7, 21); |
| 563 __ vpsraw(xmm0, xmm7, 21); |
| 564 __ vpsrad(xmm0, xmm7, 21); |
| 553 #define EMIT_SSE2_AVXINSTR(instruction, notUsed1, notUsed2, notUsed3) \ | 565 #define EMIT_SSE2_AVXINSTR(instruction, notUsed1, notUsed2, notUsed3) \ |
| 554 __ v##instruction(xmm7, xmm5, xmm1); \ | 566 __ v##instruction(xmm7, xmm5, xmm1); \ |
| 555 __ v##instruction(xmm7, xmm5, Operand(edx, 4)); | 567 __ v##instruction(xmm7, xmm5, Operand(edx, 4)); |
| 556 | 568 |
| 557 SSE2_INSTRUCTION_LIST(EMIT_SSE2_AVXINSTR) | 569 SSE2_INSTRUCTION_LIST(EMIT_SSE2_AVXINSTR) |
| 558 #undef EMIT_SSE2_AVXINSTR | 570 #undef EMIT_SSE2_AVXINSTR |
| 559 | 571 |
| 560 #define EMIT_SSE4_AVXINSTR(instruction, notUsed1, notUsed2, notUsed3, \ | 572 #define EMIT_SSE4_AVXINSTR(instruction, notUsed1, notUsed2, notUsed3, \ |
| 561 notUsed4) \ | 573 notUsed4) \ |
| 562 __ v##instruction(xmm7, xmm5, xmm1); \ | 574 __ v##instruction(xmm7, xmm5, xmm1); \ |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 730 #ifdef OBJECT_PRINT | 742 #ifdef OBJECT_PRINT |
| 731 OFStream os(stdout); | 743 OFStream os(stdout); |
| 732 code->Print(os); | 744 code->Print(os); |
| 733 byte* begin = code->instruction_start(); | 745 byte* begin = code->instruction_start(); |
| 734 byte* end = begin + code->instruction_size(); | 746 byte* end = begin + code->instruction_size(); |
| 735 disasm::Disassembler::Disassemble(stdout, begin, end); | 747 disasm::Disassembler::Disassemble(stdout, begin, end); |
| 736 #endif | 748 #endif |
| 737 } | 749 } |
| 738 | 750 |
| 739 #undef __ | 751 #undef __ |
| OLD | NEW |