| 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 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 { | 352 { |
| 353 if (CpuFeatures::IsSupported(SSE2)) { | 353 if (CpuFeatures::IsSupported(SSE2)) { |
| 354 CpuFeatureScope fscope(&assm, SSE2); | 354 CpuFeatureScope fscope(&assm, SSE2); |
| 355 __ cvttss2si(edx, Operand(ebx, ecx, times_4, 10000)); | 355 __ cvttss2si(edx, Operand(ebx, ecx, times_4, 10000)); |
| 356 __ cvtsi2sd(xmm1, Operand(ebx, ecx, times_4, 10000)); | 356 __ cvtsi2sd(xmm1, Operand(ebx, ecx, times_4, 10000)); |
| 357 __ addsd(xmm1, xmm0); | 357 __ movsd(xmm1, Operand(ebx, ecx, times_4, 10000)); |
| 358 __ mulsd(xmm1, xmm0); | 358 __ movsd(Operand(ebx, ecx, times_4, 10000), xmm1); |
| 359 __ subsd(xmm1, xmm0); | 359 __ movaps(xmm0, xmm1); |
| 360 __ divsd(xmm1, xmm0); | |
| 361 __ movdbl(xmm1, Operand(ebx, ecx, times_4, 10000)); | |
| 362 __ movdbl(Operand(ebx, ecx, times_4, 10000), xmm1); | |
| 363 __ ucomisd(xmm0, xmm1); | |
| 364 | |
| 365 // 128 bit move instructions. | 360 // 128 bit move instructions. |
| 366 __ movdqa(xmm0, Operand(ebx, ecx, times_4, 10000)); | 361 __ movdqa(xmm0, Operand(ebx, ecx, times_4, 10000)); |
| 367 __ movdqa(Operand(ebx, ecx, times_4, 10000), xmm0); | 362 __ movdqa(Operand(ebx, ecx, times_4, 10000), xmm0); |
| 368 __ movdqu(xmm0, Operand(ebx, ecx, times_4, 10000)); | 363 __ movdqu(xmm0, Operand(ebx, ecx, times_4, 10000)); |
| 369 __ movdqu(Operand(ebx, ecx, times_4, 10000), xmm0); | 364 __ movdqu(Operand(ebx, ecx, times_4, 10000), xmm0); |
| 365 |
| 366 __ addsd(xmm1, xmm0); |
| 367 __ mulsd(xmm1, xmm0); |
| 368 __ subsd(xmm1, xmm0); |
| 369 __ divsd(xmm1, xmm0); |
| 370 __ ucomisd(xmm0, xmm1); |
| 371 __ cmpltsd(xmm0, xmm1); |
| 372 |
| 373 __ andps(xmm0, xmm1); |
| 374 __ andpd(xmm0, xmm1); |
| 375 __ psllq(xmm0, 17); |
| 376 __ psllq(xmm0, xmm1); |
| 377 __ psrlq(xmm0, 17); |
| 378 __ psrlq(xmm0, xmm1); |
| 379 __ por(xmm0, xmm1); |
| 370 } | 380 } |
| 371 } | 381 } |
| 372 | 382 |
| 373 // cmov. | 383 // cmov. |
| 374 { | 384 { |
| 375 if (CpuFeatures::IsSupported(CMOV)) { | 385 if (CpuFeatures::IsSupported(CMOV)) { |
| 376 CpuFeatureScope use_cmov(&assm, CMOV); | 386 CpuFeatureScope use_cmov(&assm, CMOV); |
| 377 __ cmov(overflow, eax, Operand(eax, 0)); | 387 __ cmov(overflow, eax, Operand(eax, 0)); |
| 378 __ cmov(no_overflow, eax, Operand(eax, 1)); | 388 __ cmov(no_overflow, eax, Operand(eax, 1)); |
| 379 __ cmov(below, eax, Operand(eax, 2)); | 389 __ cmov(below, eax, Operand(eax, 2)); |
| 380 __ cmov(above_equal, eax, Operand(eax, 3)); | 390 __ cmov(above_equal, eax, Operand(eax, 3)); |
| 381 __ cmov(equal, eax, Operand(ebx, 0)); | 391 __ cmov(equal, eax, Operand(ebx, 0)); |
| 382 __ cmov(not_equal, eax, Operand(ebx, 1)); | 392 __ cmov(not_equal, eax, Operand(ebx, 1)); |
| 383 __ cmov(below_equal, eax, Operand(ebx, 2)); | 393 __ cmov(below_equal, eax, Operand(ebx, 2)); |
| 384 __ cmov(above, eax, Operand(ebx, 3)); | 394 __ cmov(above, eax, Operand(ebx, 3)); |
| 385 __ cmov(sign, eax, Operand(ecx, 0)); | 395 __ cmov(sign, eax, Operand(ecx, 0)); |
| 386 __ cmov(not_sign, eax, Operand(ecx, 1)); | 396 __ cmov(not_sign, eax, Operand(ecx, 1)); |
| 387 __ cmov(parity_even, eax, Operand(ecx, 2)); | 397 __ cmov(parity_even, eax, Operand(ecx, 2)); |
| 388 __ cmov(parity_odd, eax, Operand(ecx, 3)); | 398 __ cmov(parity_odd, eax, Operand(ecx, 3)); |
| 389 __ cmov(less, eax, Operand(edx, 0)); | 399 __ cmov(less, eax, Operand(edx, 0)); |
| 390 __ cmov(greater_equal, eax, Operand(edx, 1)); | 400 __ cmov(greater_equal, eax, Operand(edx, 1)); |
| 391 __ cmov(less_equal, eax, Operand(edx, 2)); | 401 __ cmov(less_equal, eax, Operand(edx, 2)); |
| 392 __ cmov(greater, eax, Operand(edx, 3)); | 402 __ cmov(greater, eax, Operand(edx, 3)); |
| 393 } | 403 } |
| 394 } | 404 } |
| 395 | 405 |
| 396 // andpd, cmpltsd, movaps, psllq, psrlq, por. | |
| 397 { | |
| 398 if (CpuFeatures::IsSupported(SSE2)) { | |
| 399 CpuFeatureScope fscope(&assm, SSE2); | |
| 400 __ andpd(xmm0, xmm1); | |
| 401 __ andpd(xmm1, xmm2); | |
| 402 | |
| 403 __ cmpltsd(xmm0, xmm1); | |
| 404 __ cmpltsd(xmm1, xmm2); | |
| 405 | |
| 406 __ movaps(xmm0, xmm1); | |
| 407 __ movaps(xmm1, xmm2); | |
| 408 | |
| 409 __ psllq(xmm0, 17); | |
| 410 __ psllq(xmm1, 42); | |
| 411 | |
| 412 __ psllq(xmm0, xmm1); | |
| 413 __ psllq(xmm1, xmm2); | |
| 414 | |
| 415 __ psrlq(xmm0, 17); | |
| 416 __ psrlq(xmm1, 42); | |
| 417 | |
| 418 __ psrlq(xmm0, xmm1); | |
| 419 __ psrlq(xmm1, xmm2); | |
| 420 | |
| 421 __ por(xmm0, xmm1); | |
| 422 __ por(xmm1, xmm2); | |
| 423 } | |
| 424 } | |
| 425 | |
| 426 { | 406 { |
| 427 if (CpuFeatures::IsSupported(SSE2) && | 407 if (CpuFeatures::IsSupported(SSE2) && |
| 428 CpuFeatures::IsSupported(SSE4_1)) { | 408 CpuFeatures::IsSupported(SSE4_1)) { |
| 429 CpuFeatureScope scope(&assm, SSE4_1); | 409 CpuFeatureScope scope(&assm, SSE4_1); |
| 430 __ pextrd(eax, xmm0, 1); | 410 __ pextrd(eax, xmm0, 1); |
| 431 __ pinsrd(xmm1, eax, 0); | 411 __ pinsrd(xmm1, eax, 0); |
| 412 __ extractps(eax, xmm1, 0); |
| 432 } | 413 } |
| 433 } | 414 } |
| 434 | 415 |
| 435 // Nop instructions | 416 // Nop instructions |
| 436 for (int i = 0; i < 16; i++) { | 417 for (int i = 0; i < 16; i++) { |
| 437 __ Nop(i); | 418 __ Nop(i); |
| 438 } | 419 } |
| 439 | 420 |
| 440 __ ret(0); | 421 __ ret(0); |
| 441 | 422 |
| 442 CodeDesc desc; | 423 CodeDesc desc; |
| 443 assm.GetCode(&desc); | 424 assm.GetCode(&desc); |
| 444 Object* code = isolate->heap()->CreateCode( | 425 Object* code = isolate->heap()->CreateCode( |
| 445 desc, | 426 desc, |
| 446 Code::ComputeFlags(Code::STUB), | 427 Code::ComputeFlags(Code::STUB), |
| 447 Handle<Code>())->ToObjectChecked(); | 428 Handle<Code>())->ToObjectChecked(); |
| 448 CHECK(code->IsCode()); | 429 CHECK(code->IsCode()); |
| 449 #ifdef OBJECT_PRINT | 430 #ifdef OBJECT_PRINT |
| 450 Code::cast(code)->Print(); | 431 Code::cast(code)->Print(); |
| 451 byte* begin = Code::cast(code)->instruction_start(); | 432 byte* begin = Code::cast(code)->instruction_start(); |
| 452 byte* end = begin + Code::cast(code)->instruction_size(); | 433 byte* end = begin + Code::cast(code)->instruction_size(); |
| 453 disasm::Disassembler::Disassemble(stdout, begin, end); | 434 disasm::Disassembler::Disassemble(stdout, begin, end); |
| 454 #endif | 435 #endif |
| 455 } | 436 } |
| 456 | 437 |
| 457 #undef __ | 438 #undef __ |
| OLD | NEW |