OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #if V8_TARGET_ARCH_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
6 | 6 |
7 #include "src/crankshaft/ia32/lithium-codegen-ia32.h" | 7 #include "src/crankshaft/ia32/lithium-codegen-ia32.h" |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 3403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3414 } | 3414 } |
3415 | 3415 |
3416 | 3416 |
3417 void LCodeGen::DoMathClz32(LMathClz32* instr) { | 3417 void LCodeGen::DoMathClz32(LMathClz32* instr) { |
3418 Register input = ToRegister(instr->value()); | 3418 Register input = ToRegister(instr->value()); |
3419 Register result = ToRegister(instr->result()); | 3419 Register result = ToRegister(instr->result()); |
3420 | 3420 |
3421 __ Lzcnt(result, input); | 3421 __ Lzcnt(result, input); |
3422 } | 3422 } |
3423 | 3423 |
| 3424 void LCodeGen::DoMathCos(LMathCos* instr) { |
| 3425 XMMRegister input = ToDoubleRegister(instr->value()); |
| 3426 XMMRegister result = ToDoubleRegister(instr->result()); |
| 3427 // Pass one double as argument on the stack. |
| 3428 __ PrepareCallCFunction(2, eax); |
| 3429 __ movsd(Operand(esp, 0 * kDoubleSize), input); |
| 3430 __ CallCFunction(ExternalReference::ieee754_cos_function(isolate()), 2); |
| 3431 // Return value is in st(0) on ia32. |
| 3432 // Store it into the result register. |
| 3433 __ sub(esp, Immediate(kDoubleSize)); |
| 3434 __ fstp_d(Operand(esp, 0)); |
| 3435 __ movsd(result, Operand(esp, 0)); |
| 3436 __ add(esp, Immediate(kDoubleSize)); |
| 3437 } |
| 3438 |
| 3439 void LCodeGen::DoMathSin(LMathSin* instr) { |
| 3440 XMMRegister input = ToDoubleRegister(instr->value()); |
| 3441 XMMRegister result = ToDoubleRegister(instr->result()); |
| 3442 // Pass one double as argument on the stack. |
| 3443 __ PrepareCallCFunction(2, eax); |
| 3444 __ movsd(Operand(esp, 0 * kDoubleSize), input); |
| 3445 __ CallCFunction(ExternalReference::ieee754_sin_function(isolate()), 2); |
| 3446 // Return value is in st(0) on ia32. |
| 3447 // Store it into the result register. |
| 3448 __ sub(esp, Immediate(kDoubleSize)); |
| 3449 __ fstp_d(Operand(esp, 0)); |
| 3450 __ movsd(result, Operand(esp, 0)); |
| 3451 __ add(esp, Immediate(kDoubleSize)); |
| 3452 } |
3424 | 3453 |
3425 void LCodeGen::DoMathExp(LMathExp* instr) { | 3454 void LCodeGen::DoMathExp(LMathExp* instr) { |
3426 XMMRegister input = ToDoubleRegister(instr->value()); | 3455 XMMRegister input = ToDoubleRegister(instr->value()); |
3427 XMMRegister result = ToDoubleRegister(instr->result()); | 3456 XMMRegister result = ToDoubleRegister(instr->result()); |
3428 // Pass one double as argument on the stack. | 3457 // Pass one double as argument on the stack. |
3429 __ PrepareCallCFunction(2, eax); | 3458 __ PrepareCallCFunction(2, eax); |
3430 __ movsd(Operand(esp, 0 * kDoubleSize), input); | 3459 __ movsd(Operand(esp, 0 * kDoubleSize), input); |
3431 __ CallCFunction(ExternalReference::ieee754_exp_function(isolate()), 2); | 3460 __ CallCFunction(ExternalReference::ieee754_exp_function(isolate()), 2); |
3432 // Return value is in st(0) on ia32. | 3461 // Return value is in st(0) on ia32. |
3433 // Store it into the result register. | 3462 // Store it into the result register. |
(...skipping 1868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5302 __ bind(deferred->exit()); | 5331 __ bind(deferred->exit()); |
5303 __ bind(&done); | 5332 __ bind(&done); |
5304 } | 5333 } |
5305 | 5334 |
5306 #undef __ | 5335 #undef __ |
5307 | 5336 |
5308 } // namespace internal | 5337 } // namespace internal |
5309 } // namespace v8 | 5338 } // namespace v8 |
5310 | 5339 |
5311 #endif // V8_TARGET_ARCH_IA32 | 5340 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |