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 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 __ fmul(3); | 342 __ fmul(3); |
343 __ fdiv(3); | 343 __ fdiv(3); |
344 | 344 |
345 __ faddp(3); | 345 __ faddp(3); |
346 __ fsubp(3); | 346 __ fsubp(3); |
347 __ fmulp(3); | 347 __ fmulp(3); |
348 __ fdivp(3); | 348 __ fdivp(3); |
349 __ fcompp(); | 349 __ fcompp(); |
350 __ fwait(); | 350 __ fwait(); |
351 __ nop(); | 351 __ nop(); |
| 352 |
| 353 // SSE instruction |
352 { | 354 { |
353 if (CpuFeatures::IsSupported(SSE2)) { | 355 if (CpuFeatures::IsSupported(SSE2)) { |
354 CpuFeatureScope fscope(&assm, SSE2); | 356 CpuFeatureScope fscope(&assm, SSE2); |
| 357 // Move operation |
| 358 __ movaps(xmm0, xmm1); |
| 359 __ shufps(xmm0, xmm0, 0x0); |
| 360 |
| 361 // logic operation |
| 362 __ andps(xmm0, xmm1); |
| 363 __ andps(xmm0, Operand(ebx, ecx, times_4, 10000)); |
| 364 __ orps(xmm0, xmm1); |
| 365 __ orps(xmm0, Operand(ebx, ecx, times_4, 10000)); |
| 366 __ xorps(xmm0, xmm1); |
| 367 __ xorps(xmm0, Operand(ebx, ecx, times_4, 10000)); |
| 368 |
| 369 // Arithmetic operation |
| 370 __ addps(xmm1, xmm0); |
| 371 __ addps(xmm1, Operand(ebx, ecx, times_4, 10000)); |
| 372 __ subps(xmm1, xmm0); |
| 373 __ subps(xmm1, Operand(ebx, ecx, times_4, 10000)); |
| 374 __ mulps(xmm1, xmm0); |
| 375 __ mulps(xmm1, Operand(ebx, ecx, times_4, 10000)); |
| 376 __ divps(xmm1, xmm0); |
| 377 __ divps(xmm1, Operand(ebx, ecx, times_4, 10000)); |
| 378 } |
| 379 } |
| 380 { |
| 381 if (CpuFeatures::IsSupported(SSE2)) { |
| 382 CpuFeatureScope fscope(&assm, SSE2); |
355 __ cvttss2si(edx, Operand(ebx, ecx, times_4, 10000)); | 383 __ cvttss2si(edx, Operand(ebx, ecx, times_4, 10000)); |
356 __ cvtsi2sd(xmm1, Operand(ebx, ecx, times_4, 10000)); | 384 __ cvtsi2sd(xmm1, Operand(ebx, ecx, times_4, 10000)); |
357 __ movsd(xmm1, Operand(ebx, ecx, times_4, 10000)); | 385 __ movsd(xmm1, Operand(ebx, ecx, times_4, 10000)); |
358 __ movsd(Operand(ebx, ecx, times_4, 10000), xmm1); | 386 __ movsd(Operand(ebx, ecx, times_4, 10000), xmm1); |
359 __ movaps(xmm0, xmm1); | |
360 // 128 bit move instructions. | 387 // 128 bit move instructions. |
361 __ movdqa(xmm0, Operand(ebx, ecx, times_4, 10000)); | 388 __ movdqa(xmm0, Operand(ebx, ecx, times_4, 10000)); |
362 __ movdqa(Operand(ebx, ecx, times_4, 10000), xmm0); | 389 __ movdqa(Operand(ebx, ecx, times_4, 10000), xmm0); |
363 __ movdqu(xmm0, Operand(ebx, ecx, times_4, 10000)); | 390 __ movdqu(xmm0, Operand(ebx, ecx, times_4, 10000)); |
364 __ movdqu(Operand(ebx, ecx, times_4, 10000), xmm0); | 391 __ movdqu(Operand(ebx, ecx, times_4, 10000), xmm0); |
365 | 392 |
366 __ addsd(xmm1, xmm0); | 393 __ addsd(xmm1, xmm0); |
367 __ mulsd(xmm1, xmm0); | 394 __ mulsd(xmm1, xmm0); |
368 __ subsd(xmm1, xmm0); | 395 __ subsd(xmm1, xmm0); |
369 __ divsd(xmm1, xmm0); | 396 __ divsd(xmm1, xmm0); |
370 __ ucomisd(xmm0, xmm1); | 397 __ ucomisd(xmm0, xmm1); |
371 __ cmpltsd(xmm0, xmm1); | 398 __ cmpltsd(xmm0, xmm1); |
372 | 399 |
373 __ andps(xmm0, xmm1); | |
374 __ orps(xmm0, xmm1); | |
375 __ andpd(xmm0, xmm1); | 400 __ andpd(xmm0, xmm1); |
376 __ psllq(xmm0, 17); | 401 __ psllq(xmm0, 17); |
377 __ psllq(xmm0, xmm1); | 402 __ psllq(xmm0, xmm1); |
378 __ psrlq(xmm0, 17); | 403 __ psrlq(xmm0, 17); |
379 __ psrlq(xmm0, xmm1); | 404 __ psrlq(xmm0, xmm1); |
380 __ por(xmm0, xmm1); | 405 __ por(xmm0, xmm1); |
381 } | 406 } |
382 } | 407 } |
383 | 408 |
384 // cmov. | 409 // cmov. |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 CHECK(code->IsCode()); | 455 CHECK(code->IsCode()); |
431 #ifdef OBJECT_PRINT | 456 #ifdef OBJECT_PRINT |
432 Code::cast(code)->Print(); | 457 Code::cast(code)->Print(); |
433 byte* begin = Code::cast(code)->instruction_start(); | 458 byte* begin = Code::cast(code)->instruction_start(); |
434 byte* end = begin + Code::cast(code)->instruction_size(); | 459 byte* end = begin + Code::cast(code)->instruction_size(); |
435 disasm::Disassembler::Disassemble(stdout, begin, end); | 460 disasm::Disassembler::Disassemble(stdout, begin, end); |
436 #endif | 461 #endif |
437 } | 462 } |
438 | 463 |
439 #undef __ | 464 #undef __ |
OLD | NEW |