Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: src/crankshaft/ia32/lithium-codegen-ia32.cc

Issue 2073123002: [builtins] Introduce proper Float64Cos and Float64Sin. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix missing breaks Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/crankshaft/hydrogen-instructions.cc ('k') | src/crankshaft/ia32/lithium-ia32.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/crankshaft/hydrogen-instructions.cc ('k') | src/crankshaft/ia32/lithium-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698