| 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 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 __ fmul(3); | 328 __ fmul(3); |
| 329 __ fdiv(3); | 329 __ fdiv(3); |
| 330 | 330 |
| 331 __ faddp(3); | 331 __ faddp(3); |
| 332 __ fsubp(3); | 332 __ fsubp(3); |
| 333 __ fmulp(3); | 333 __ fmulp(3); |
| 334 __ fdivp(3); | 334 __ fdivp(3); |
| 335 __ fcompp(); | 335 __ fcompp(); |
| 336 __ fwait(); | 336 __ fwait(); |
| 337 __ nop(); | 337 __ nop(); |
| 338 |
| 339 // SSE instruction |
| 338 { | 340 { |
| 339 if (CpuFeatures::IsSupported(SSE2)) { | 341 __ cvttss2si(rdx, Operand(rbx, rcx, times_4, 10000)); |
| 340 CpuFeatures::Scope fscope(SSE2); | 342 __ cvttss2si(rdx, xmm1); |
| 341 __ cvttss2si(rdx, Operand(rbx, rcx, times_4, 10000)); | 343 __ movaps(xmm0, xmm1); |
| 342 __ cvttss2si(rdx, xmm1); | |
| 343 __ cvttsd2si(rdx, Operand(rbx, rcx, times_4, 10000)); | |
| 344 __ cvttsd2si(rdx, xmm1); | |
| 345 __ cvttsd2siq(rdx, xmm1); | |
| 346 __ addsd(xmm1, xmm0); | |
| 347 __ mulsd(xmm1, xmm0); | |
| 348 __ subsd(xmm1, xmm0); | |
| 349 __ divsd(xmm1, xmm0); | |
| 350 __ movsd(xmm1, Operand(rbx, rcx, times_4, 10000)); | |
| 351 __ movsd(Operand(rbx, rcx, times_4, 10000), xmm1); | |
| 352 __ ucomisd(xmm0, xmm1); | |
| 353 | 344 |
| 354 // 128 bit move instructions. | 345 __ andps(xmm0, xmm1); |
| 355 __ movdqa(xmm0, Operand(rbx, rcx, times_4, 10000)); | 346 } |
| 356 __ movdqa(Operand(rbx, rcx, times_4, 10000), xmm0); | 347 // SSE 2 instructions |
| 357 } | 348 { |
| 349 __ cvttsd2si(rdx, Operand(rbx, rcx, times_4, 10000)); |
| 350 __ cvttsd2si(rdx, xmm1); |
| 351 __ cvttsd2siq(rdx, xmm1); |
| 352 __ movsd(xmm1, Operand(rbx, rcx, times_4, 10000)); |
| 353 __ movsd(Operand(rbx, rcx, times_4, 10000), xmm1); |
| 354 // 128 bit move instructions. |
| 355 __ movdqa(xmm0, Operand(rbx, rcx, times_4, 10000)); |
| 356 __ movdqa(Operand(rbx, rcx, times_4, 10000), xmm0); |
| 357 |
| 358 __ addsd(xmm1, xmm0); |
| 359 __ mulsd(xmm1, xmm0); |
| 360 __ subsd(xmm1, xmm0); |
| 361 __ divsd(xmm1, xmm0); |
| 362 __ ucomisd(xmm0, xmm1); |
| 363 |
| 364 __ andpd(xmm0, xmm1); |
| 358 } | 365 } |
| 359 | 366 |
| 360 // cmov. | 367 // cmov. |
| 361 { | 368 { |
| 362 if (CpuFeatures::IsSupported(CMOV)) { | 369 __ cmovq(overflow, rax, Operand(rax, 0)); |
| 363 CpuFeatures::Scope use_cmov(CMOV); | 370 __ cmovq(no_overflow, rax, Operand(rax, 1)); |
| 364 __ cmovq(overflow, rax, Operand(rax, 0)); | 371 __ cmovq(below, rax, Operand(rax, 2)); |
| 365 __ cmovq(no_overflow, rax, Operand(rax, 1)); | 372 __ cmovq(above_equal, rax, Operand(rax, 3)); |
| 366 __ cmovq(below, rax, Operand(rax, 2)); | 373 __ cmovq(equal, rax, Operand(rbx, 0)); |
| 367 __ cmovq(above_equal, rax, Operand(rax, 3)); | 374 __ cmovq(not_equal, rax, Operand(rbx, 1)); |
| 368 __ cmovq(equal, rax, Operand(rbx, 0)); | 375 __ cmovq(below_equal, rax, Operand(rbx, 2)); |
| 369 __ cmovq(not_equal, rax, Operand(rbx, 1)); | 376 __ cmovq(above, rax, Operand(rbx, 3)); |
| 370 __ cmovq(below_equal, rax, Operand(rbx, 2)); | 377 __ cmovq(sign, rax, Operand(rcx, 0)); |
| 371 __ cmovq(above, rax, Operand(rbx, 3)); | 378 __ cmovq(not_sign, rax, Operand(rcx, 1)); |
| 372 __ cmovq(sign, rax, Operand(rcx, 0)); | 379 __ cmovq(parity_even, rax, Operand(rcx, 2)); |
| 373 __ cmovq(not_sign, rax, Operand(rcx, 1)); | 380 __ cmovq(parity_odd, rax, Operand(rcx, 3)); |
| 374 __ cmovq(parity_even, rax, Operand(rcx, 2)); | 381 __ cmovq(less, rax, Operand(rdx, 0)); |
| 375 __ cmovq(parity_odd, rax, Operand(rcx, 3)); | 382 __ cmovq(greater_equal, rax, Operand(rdx, 1)); |
| 376 __ cmovq(less, rax, Operand(rdx, 0)); | 383 __ cmovq(less_equal, rax, Operand(rdx, 2)); |
| 377 __ cmovq(greater_equal, rax, Operand(rdx, 1)); | 384 __ cmovq(greater, rax, Operand(rdx, 3)); |
| 378 __ cmovq(less_equal, rax, Operand(rdx, 2)); | |
| 379 __ cmovq(greater, rax, Operand(rdx, 3)); | |
| 380 } | |
| 381 } | |
| 382 | |
| 383 // andpd, etc. | |
| 384 { | |
| 385 if (CpuFeatures::IsSupported(SSE2)) { | |
| 386 CpuFeatures::Scope fscope(SSE2); | |
| 387 __ andpd(xmm0, xmm1); | |
| 388 __ andpd(xmm1, xmm2); | |
| 389 | |
| 390 __ movaps(xmm0, xmm1); | |
| 391 __ movaps(xmm1, xmm2); | |
| 392 } | |
| 393 } | 385 } |
| 394 | 386 |
| 395 { | 387 { |
| 396 if (CpuFeatures::IsSupported(SSE4_1)) { | 388 if (CpuFeatures::IsSupported(SSE4_1)) { |
| 397 CpuFeatureScope scope(&assm, SSE4_1); | 389 CpuFeatureScope scope(&assm, SSE4_1); |
| 398 __ extractps(rax, xmm1, 0); | 390 __ extractps(rax, xmm1, 0); |
| 399 } | 391 } |
| 400 } | 392 } |
| 401 | 393 |
| 402 // Nop instructions | 394 // Nop instructions |
| (...skipping 12 matching lines...) Expand all Loading... |
| 415 CHECK(code->IsCode()); | 407 CHECK(code->IsCode()); |
| 416 #ifdef OBJECT_PRINT | 408 #ifdef OBJECT_PRINT |
| 417 Code::cast(code)->Print(); | 409 Code::cast(code)->Print(); |
| 418 byte* begin = Code::cast(code)->instruction_start(); | 410 byte* begin = Code::cast(code)->instruction_start(); |
| 419 byte* end = begin + Code::cast(code)->instruction_size(); | 411 byte* end = begin + Code::cast(code)->instruction_size(); |
| 420 disasm::Disassembler::Disassemble(stdout, begin, end); | 412 disasm::Disassembler::Disassemble(stdout, begin, end); |
| 421 #endif | 413 #endif |
| 422 } | 414 } |
| 423 | 415 |
| 424 #undef __ | 416 #undef __ |
| OLD | NEW |