| 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_X87 | 5 #if V8_TARGET_ARCH_X87 |
| 6 | 6 |
| 7 #include "src/crankshaft/x87/lithium-codegen-x87.h" | 7 #include "src/crankshaft/x87/lithium-codegen-x87.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 3679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3690 } | 3690 } |
| 3691 | 3691 |
| 3692 | 3692 |
| 3693 void LCodeGen::DoMathClz32(LMathClz32* instr) { | 3693 void LCodeGen::DoMathClz32(LMathClz32* instr) { |
| 3694 Register input = ToRegister(instr->value()); | 3694 Register input = ToRegister(instr->value()); |
| 3695 Register result = ToRegister(instr->result()); | 3695 Register result = ToRegister(instr->result()); |
| 3696 | 3696 |
| 3697 __ Lzcnt(result, input); | 3697 __ Lzcnt(result, input); |
| 3698 } | 3698 } |
| 3699 | 3699 |
| 3700 void LCodeGen::DoMathCos(LMathCos* instr) { |
| 3701 X87Register result = ToX87Register(instr->result()); |
| 3702 X87Register input_reg = ToX87Register(instr->value()); |
| 3703 __ fld(x87_stack_.st(input_reg)); |
| 3704 |
| 3705 // Pass one double as argument on the stack. |
| 3706 __ PrepareCallCFunction(2, eax); |
| 3707 __ fstp_d(MemOperand(esp, 0)); |
| 3708 X87PrepareToWrite(result); |
| 3709 __ CallCFunction(ExternalReference::ieee754_cos_function(isolate()), 2); |
| 3710 // Return value is in st(0) on ia32. |
| 3711 X87CommitWrite(result); |
| 3712 } |
| 3713 |
| 3714 void LCodeGen::DoMathSin(LMathSin* instr) { |
| 3715 X87Register result = ToX87Register(instr->result()); |
| 3716 X87Register input_reg = ToX87Register(instr->value()); |
| 3717 __ fld(x87_stack_.st(input_reg)); |
| 3718 |
| 3719 // Pass one double as argument on the stack. |
| 3720 __ PrepareCallCFunction(2, eax); |
| 3721 __ fstp_d(MemOperand(esp, 0)); |
| 3722 X87PrepareToWrite(result); |
| 3723 __ CallCFunction(ExternalReference::ieee754_sin_function(isolate()), 2); |
| 3724 // Return value is in st(0) on ia32. |
| 3725 X87CommitWrite(result); |
| 3726 } |
| 3700 | 3727 |
| 3701 void LCodeGen::DoMathExp(LMathExp* instr) { | 3728 void LCodeGen::DoMathExp(LMathExp* instr) { |
| 3702 X87Register result = ToX87Register(instr->result()); | 3729 X87Register result = ToX87Register(instr->result()); |
| 3703 X87Register input_reg = ToX87Register(instr->value()); | 3730 X87Register input_reg = ToX87Register(instr->value()); |
| 3704 __ fld(x87_stack_.st(input_reg)); | 3731 __ fld(x87_stack_.st(input_reg)); |
| 3705 | 3732 |
| 3706 // Pass one double as argument on the stack. | 3733 // Pass one double as argument on the stack. |
| 3707 __ PrepareCallCFunction(2, eax); | 3734 __ PrepareCallCFunction(2, eax); |
| 3708 __ fstp_d(MemOperand(esp, 0)); | 3735 __ fstp_d(MemOperand(esp, 0)); |
| 3709 X87PrepareToWrite(result); | 3736 X87PrepareToWrite(result); |
| (...skipping 2074 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5784 __ bind(deferred->exit()); | 5811 __ bind(deferred->exit()); |
| 5785 __ bind(&done); | 5812 __ bind(&done); |
| 5786 } | 5813 } |
| 5787 | 5814 |
| 5788 #undef __ | 5815 #undef __ |
| 5789 | 5816 |
| 5790 } // namespace internal | 5817 } // namespace internal |
| 5791 } // namespace v8 | 5818 } // namespace v8 |
| 5792 | 5819 |
| 5793 #endif // V8_TARGET_ARCH_X87 | 5820 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |