| 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 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 CHECK(CpuFeatures::IsSupported(CpuFeatures::SSE2)); | 356 CHECK(CpuFeatures::IsSupported(CpuFeatures::SSE2)); |
| 357 CpuFeatures::Scope fscope(CpuFeatures::SSE2); | 357 CpuFeatures::Scope fscope(CpuFeatures::SSE2); |
| 358 __ cvttss2si(edx, Operand(ebx, ecx, times_4, 10000)); | 358 __ cvttss2si(edx, Operand(ebx, ecx, times_4, 10000)); |
| 359 __ cvtsi2sd(xmm1, Operand(ebx, ecx, times_4, 10000)); | 359 __ cvtsi2sd(xmm1, Operand(ebx, ecx, times_4, 10000)); |
| 360 __ addsd(xmm1, xmm0); | 360 __ addsd(xmm1, xmm0); |
| 361 __ mulsd(xmm1, xmm0); | 361 __ mulsd(xmm1, xmm0); |
| 362 __ subsd(xmm1, xmm0); | 362 __ subsd(xmm1, xmm0); |
| 363 __ divsd(xmm1, xmm0); | 363 __ divsd(xmm1, xmm0); |
| 364 __ movdbl(xmm1, Operand(ebx, ecx, times_4, 10000)); | 364 __ movdbl(xmm1, Operand(ebx, ecx, times_4, 10000)); |
| 365 __ movdbl(Operand(ebx, ecx, times_4, 10000), xmm1); | 365 __ movdbl(Operand(ebx, ecx, times_4, 10000), xmm1); |
| 366 __ comisd(xmm0, xmm1); |
| 366 } | 367 } |
| 368 |
| 369 // cmov. |
| 370 { |
| 371 CHECK(CpuFeatures::IsSupported(CpuFeatures::CMOV)); |
| 372 CpuFeatures::Scope use_cmov(CpuFeatures::CMOV); |
| 373 __ cmov(overflow, eax, Operand(eax, 0)); |
| 374 __ cmov(no_overflow, eax, Operand(eax, 1)); |
| 375 __ cmov(below, eax, Operand(eax, 2)); |
| 376 __ cmov(above_equal, eax, Operand(eax, 3)); |
| 377 __ cmov(equal, eax, Operand(ebx, 0)); |
| 378 __ cmov(not_equal, eax, Operand(ebx, 1)); |
| 379 __ cmov(below_equal, eax, Operand(ebx, 2)); |
| 380 __ cmov(above, eax, Operand(ebx, 3)); |
| 381 __ cmov(sign, eax, Operand(ecx, 0)); |
| 382 __ cmov(not_sign, eax, Operand(ecx, 1)); |
| 383 __ cmov(parity_even, eax, Operand(ecx, 2)); |
| 384 __ cmov(parity_odd, eax, Operand(ecx, 3)); |
| 385 __ cmov(less, eax, Operand(edx, 0)); |
| 386 __ cmov(greater_equal, eax, Operand(edx, 1)); |
| 387 __ cmov(less_equal, eax, Operand(edx, 2)); |
| 388 __ cmov(greater, eax, Operand(edx, 3)); |
| 389 } |
| 390 |
| 367 __ ret(0); | 391 __ ret(0); |
| 368 | 392 |
| 369 CodeDesc desc; | 393 CodeDesc desc; |
| 370 assm.GetCode(&desc); | 394 assm.GetCode(&desc); |
| 371 Object* code = Heap::CreateCode(desc, | 395 Object* code = Heap::CreateCode(desc, |
| 372 NULL, | 396 NULL, |
| 373 Code::ComputeFlags(Code::STUB), | 397 Code::ComputeFlags(Code::STUB), |
| 374 Handle<Object>(Heap::undefined_value())); | 398 Handle<Object>(Heap::undefined_value())); |
| 375 CHECK(code->IsCode()); | 399 CHECK(code->IsCode()); |
| 376 #ifdef DEBUG | 400 #ifdef DEBUG |
| 377 Code::cast(code)->Print(); | 401 Code::cast(code)->Print(); |
| 378 byte* begin = Code::cast(code)->instruction_start(); | 402 byte* begin = Code::cast(code)->instruction_start(); |
| 379 byte* end = begin + Code::cast(code)->instruction_size(); | 403 byte* end = begin + Code::cast(code)->instruction_size(); |
| 380 disasm::Disassembler::Disassemble(stdout, begin, end); | 404 disasm::Disassembler::Disassemble(stdout, begin, end); |
| 381 #endif | 405 #endif |
| 382 } | 406 } |
| 383 | 407 |
| 384 #undef __ | 408 #undef __ |
| OLD | NEW |