| 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 3407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 | 3424 |
| 3425 void LCodeGen::DoMathExp(LMathExp* instr) { | 3425 void LCodeGen::DoMathExp(LMathExp* instr) { |
| 3426 XMMRegister input = ToDoubleRegister(instr->value()); | 3426 XMMRegister input = ToDoubleRegister(instr->value()); |
| 3427 XMMRegister result = ToDoubleRegister(instr->result()); | 3427 XMMRegister result = ToDoubleRegister(instr->result()); |
| 3428 XMMRegister temp0 = double_scratch0(); | 3428 // Pass one double as argument on the stack. |
| 3429 Register temp1 = ToRegister(instr->temp1()); | 3429 __ PrepareCallCFunction(2, eax); |
| 3430 Register temp2 = ToRegister(instr->temp2()); | 3430 __ movsd(Operand(esp, 0 * kDoubleSize), input); |
| 3431 | 3431 __ CallCFunction(ExternalReference::ieee754_exp_function(isolate()), 2); |
| 3432 MathExpGenerator::EmitMathExp(masm(), input, result, temp0, temp1, temp2); | 3432 // Return value is in st(0) on ia32. |
| 3433 // Store it into the result register. |
| 3434 __ sub(esp, Immediate(kDoubleSize)); |
| 3435 __ fstp_d(Operand(esp, 0)); |
| 3436 __ movsd(result, Operand(esp, 0)); |
| 3437 __ add(esp, Immediate(kDoubleSize)); |
| 3433 } | 3438 } |
| 3434 | 3439 |
| 3435 void LCodeGen::PrepareForTailCall(const ParameterCount& actual, | 3440 void LCodeGen::PrepareForTailCall(const ParameterCount& actual, |
| 3436 Register scratch1, Register scratch2, | 3441 Register scratch1, Register scratch2, |
| 3437 Register scratch3) { | 3442 Register scratch3) { |
| 3438 #if DEBUG | 3443 #if DEBUG |
| 3439 if (actual.is_reg()) { | 3444 if (actual.is_reg()) { |
| 3440 DCHECK(!AreAliased(actual.reg(), scratch1, scratch2, scratch3)); | 3445 DCHECK(!AreAliased(actual.reg(), scratch1, scratch2, scratch3)); |
| 3441 } else { | 3446 } else { |
| 3442 DCHECK(!AreAliased(scratch1, scratch2, scratch3)); | 3447 DCHECK(!AreAliased(scratch1, scratch2, scratch3)); |
| (...skipping 1854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5297 __ bind(deferred->exit()); | 5302 __ bind(deferred->exit()); |
| 5298 __ bind(&done); | 5303 __ bind(&done); |
| 5299 } | 5304 } |
| 5300 | 5305 |
| 5301 #undef __ | 5306 #undef __ |
| 5302 | 5307 |
| 5303 } // namespace internal | 5308 } // namespace internal |
| 5304 } // namespace v8 | 5309 } // namespace v8 |
| 5305 | 5310 |
| 5306 #endif // V8_TARGET_ARCH_IA32 | 5311 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |