| OLD | NEW |
| 1 // Copyright 2007-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2007-2008 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 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 __ fdiv(3); | 354 __ fdiv(3); |
| 355 | 355 |
| 356 __ faddp(3); | 356 __ faddp(3); |
| 357 __ fsubp(3); | 357 __ fsubp(3); |
| 358 __ fmulp(3); | 358 __ fmulp(3); |
| 359 __ fdivp(3); | 359 __ fdivp(3); |
| 360 __ fcompp(); | 360 __ fcompp(); |
| 361 __ fwait(); | 361 __ fwait(); |
| 362 __ nop(); | 362 __ nop(); |
| 363 { | 363 { |
| 364 CHECK(CpuFeatures::IsSupported(SSE2)); | 364 if (CpuFeatures::IsSupported(SSE2)) { |
| 365 CpuFeatures::Scope fscope(SSE2); | 365 CpuFeatures::Scope fscope(SSE2); |
| 366 __ cvttss2si(edx, Operand(ebx, ecx, times_4, 10000)); | 366 __ cvttss2si(edx, Operand(ebx, ecx, times_4, 10000)); |
| 367 __ cvtsi2sd(xmm1, Operand(ebx, ecx, times_4, 10000)); | 367 __ cvtsi2sd(xmm1, Operand(ebx, ecx, times_4, 10000)); |
| 368 __ addsd(xmm1, xmm0); | 368 __ addsd(xmm1, xmm0); |
| 369 __ mulsd(xmm1, xmm0); | 369 __ mulsd(xmm1, xmm0); |
| 370 __ subsd(xmm1, xmm0); | 370 __ subsd(xmm1, xmm0); |
| 371 __ divsd(xmm1, xmm0); | 371 __ divsd(xmm1, xmm0); |
| 372 __ movdbl(xmm1, Operand(ebx, ecx, times_4, 10000)); | 372 __ movdbl(xmm1, Operand(ebx, ecx, times_4, 10000)); |
| 373 __ movdbl(Operand(ebx, ecx, times_4, 10000), xmm1); | 373 __ movdbl(Operand(ebx, ecx, times_4, 10000), xmm1); |
| 374 __ comisd(xmm0, xmm1); | 374 __ comisd(xmm0, xmm1); |
| 375 | 375 |
| 376 // 128 bit move instructions. | 376 // 128 bit move instructions. |
| 377 __ movdqa(xmm0, Operand(ebx, ecx, times_4, 10000)); | 377 __ movdqa(xmm0, Operand(ebx, ecx, times_4, 10000)); |
| 378 __ movdqa(Operand(ebx, ecx, times_4, 10000), xmm0); | 378 __ movdqa(Operand(ebx, ecx, times_4, 10000), xmm0); |
| 379 __ movdqu(xmm0, Operand(ebx, ecx, times_4, 10000)); | 379 __ movdqu(xmm0, Operand(ebx, ecx, times_4, 10000)); |
| 380 __ movdqu(Operand(ebx, ecx, times_4, 10000), xmm0); | 380 __ movdqu(Operand(ebx, ecx, times_4, 10000), xmm0); |
| 381 } |
| 381 } | 382 } |
| 382 | 383 |
| 383 // cmov. | 384 // cmov. |
| 384 { | 385 { |
| 385 CHECK(CpuFeatures::IsSupported(CMOV)); | 386 if (CpuFeatures::IsSupported(CMOV)) { |
| 386 CpuFeatures::Scope use_cmov(CMOV); | 387 CpuFeatures::Scope use_cmov(CMOV); |
| 387 __ cmov(overflow, eax, Operand(eax, 0)); | 388 __ cmov(overflow, eax, Operand(eax, 0)); |
| 388 __ cmov(no_overflow, eax, Operand(eax, 1)); | 389 __ cmov(no_overflow, eax, Operand(eax, 1)); |
| 389 __ cmov(below, eax, Operand(eax, 2)); | 390 __ cmov(below, eax, Operand(eax, 2)); |
| 390 __ cmov(above_equal, eax, Operand(eax, 3)); | 391 __ cmov(above_equal, eax, Operand(eax, 3)); |
| 391 __ cmov(equal, eax, Operand(ebx, 0)); | 392 __ cmov(equal, eax, Operand(ebx, 0)); |
| 392 __ cmov(not_equal, eax, Operand(ebx, 1)); | 393 __ cmov(not_equal, eax, Operand(ebx, 1)); |
| 393 __ cmov(below_equal, eax, Operand(ebx, 2)); | 394 __ cmov(below_equal, eax, Operand(ebx, 2)); |
| 394 __ cmov(above, eax, Operand(ebx, 3)); | 395 __ cmov(above, eax, Operand(ebx, 3)); |
| 395 __ cmov(sign, eax, Operand(ecx, 0)); | 396 __ cmov(sign, eax, Operand(ecx, 0)); |
| 396 __ cmov(not_sign, eax, Operand(ecx, 1)); | 397 __ cmov(not_sign, eax, Operand(ecx, 1)); |
| 397 __ cmov(parity_even, eax, Operand(ecx, 2)); | 398 __ cmov(parity_even, eax, Operand(ecx, 2)); |
| 398 __ cmov(parity_odd, eax, Operand(ecx, 3)); | 399 __ cmov(parity_odd, eax, Operand(ecx, 3)); |
| 399 __ cmov(less, eax, Operand(edx, 0)); | 400 __ cmov(less, eax, Operand(edx, 0)); |
| 400 __ cmov(greater_equal, eax, Operand(edx, 1)); | 401 __ cmov(greater_equal, eax, Operand(edx, 1)); |
| 401 __ cmov(less_equal, eax, Operand(edx, 2)); | 402 __ cmov(less_equal, eax, Operand(edx, 2)); |
| 402 __ cmov(greater, eax, Operand(edx, 3)); | 403 __ cmov(greater, eax, Operand(edx, 3)); |
| 404 } |
| 403 } | 405 } |
| 404 | 406 |
| 405 __ ret(0); | 407 __ ret(0); |
| 406 | 408 |
| 407 CodeDesc desc; | 409 CodeDesc desc; |
| 408 assm.GetCode(&desc); | 410 assm.GetCode(&desc); |
| 409 Object* code = Heap::CreateCode(desc, | 411 Object* code = Heap::CreateCode(desc, |
| 410 NULL, | 412 NULL, |
| 411 Code::ComputeFlags(Code::STUB), | 413 Code::ComputeFlags(Code::STUB), |
| 412 Handle<Object>(Heap::undefined_value())); | 414 Handle<Object>(Heap::undefined_value())); |
| 413 CHECK(code->IsCode()); | 415 CHECK(code->IsCode()); |
| 414 #ifdef DEBUG | 416 #ifdef DEBUG |
| 415 Code::cast(code)->Print(); | 417 Code::cast(code)->Print(); |
| 416 byte* begin = Code::cast(code)->instruction_start(); | 418 byte* begin = Code::cast(code)->instruction_start(); |
| 417 byte* end = begin + Code::cast(code)->instruction_size(); | 419 byte* end = begin + Code::cast(code)->instruction_size(); |
| 418 disasm::Disassembler::Disassemble(stdout, begin, end); | 420 disasm::Disassembler::Disassemble(stdout, begin, end); |
| 419 #endif | 421 #endif |
| 420 } | 422 } |
| 421 | 423 |
| 422 #undef __ | 424 #undef __ |
| OLD | NEW |