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

Side by Side Diff: src/compiler/x64/code-generator-x64.cc

Issue 990963003: [turbofan] Unify Math.floor / Math.ceil optimization. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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/compiler/verifier.cc ('k') | src/compiler/x64/instruction-codes-x64.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 #include "src/compiler/code-generator.h" 5 #include "src/compiler/code-generator.h"
6 6
7 #include "src/compiler/code-generator-impl.h" 7 #include "src/compiler/code-generator-impl.h"
8 #include "src/compiler/gap-resolver.h" 8 #include "src/compiler/gap-resolver.h"
9 #include "src/compiler/node-matchers.h" 9 #include "src/compiler/node-matchers.h"
10 #include "src/scopes.h" 10 #include "src/scopes.h"
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after
741 __ addq(rsp, Immediate(kDoubleSize)); 741 __ addq(rsp, Immediate(kDoubleSize));
742 break; 742 break;
743 } 743 }
744 case kSSEFloat64Sqrt: 744 case kSSEFloat64Sqrt:
745 if (instr->InputAt(0)->IsDoubleRegister()) { 745 if (instr->InputAt(0)->IsDoubleRegister()) {
746 __ sqrtsd(i.OutputDoubleRegister(), i.InputDoubleRegister(0)); 746 __ sqrtsd(i.OutputDoubleRegister(), i.InputDoubleRegister(0));
747 } else { 747 } else {
748 __ sqrtsd(i.OutputDoubleRegister(), i.InputOperand(0)); 748 __ sqrtsd(i.OutputDoubleRegister(), i.InputOperand(0));
749 } 749 }
750 break; 750 break;
751 case kSSEFloat64Floor: { 751 case kSSEFloat64Round: {
752 CpuFeatureScope sse_scope(masm(), SSE4_1); 752 CpuFeatureScope sse_scope(masm(), SSE4_1);
753 __ roundsd(i.OutputDoubleRegister(), i.InputDoubleRegister(0), 753 RoundingMode const mode =
754 v8::internal::Assembler::kRoundDown); 754 static_cast<RoundingMode>(MiscField::decode(instr->opcode()));
755 break; 755 __ roundsd(i.OutputDoubleRegister(), i.InputDoubleRegister(0), mode);
756 }
757 case kSSEFloat64Ceil: {
758 CpuFeatureScope sse_scope(masm(), SSE4_1);
759 __ roundsd(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
760 v8::internal::Assembler::kRoundUp);
761 break;
762 }
763 case kSSEFloat64RoundTruncate: {
764 CpuFeatureScope sse_scope(masm(), SSE4_1);
765 __ roundsd(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
766 v8::internal::Assembler::kRoundToZero);
767 break; 756 break;
768 } 757 }
769 case kSSECvtss2sd: 758 case kSSECvtss2sd:
770 if (instr->InputAt(0)->IsDoubleRegister()) { 759 if (instr->InputAt(0)->IsDoubleRegister()) {
771 __ cvtss2sd(i.OutputDoubleRegister(), i.InputDoubleRegister(0)); 760 __ cvtss2sd(i.OutputDoubleRegister(), i.InputDoubleRegister(0));
772 } else { 761 } else {
773 __ cvtss2sd(i.OutputDoubleRegister(), i.InputOperand(0)); 762 __ cvtss2sd(i.OutputDoubleRegister(), i.InputOperand(0));
774 } 763 }
775 break; 764 break;
776 case kSSECvtsd2ss: 765 case kSSECvtsd2ss:
(...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after
1492 } 1481 }
1493 } 1482 }
1494 MarkLazyDeoptSite(); 1483 MarkLazyDeoptSite();
1495 } 1484 }
1496 1485
1497 #undef __ 1486 #undef __
1498 1487
1499 } // namespace internal 1488 } // namespace internal
1500 } // namespace compiler 1489 } // namespace compiler
1501 } // namespace v8 1490 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/verifier.cc ('k') | src/compiler/x64/instruction-codes-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698