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

Side by Side Diff: test/unittests/compiler/x64/instruction-selector-x64-unittest.cc

Issue 764863002: [x64] introduce vex prefix version of float64 arithmetic binop (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: addressed comments Created 6 years 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 | « test/cctest/test-disasm-x64.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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 "test/unittests/compiler/instruction-selector-unittest.h" 5 #include "test/unittests/compiler/instruction-selector-unittest.h"
6 6
7 #include "src/compiler/node-matchers.h" 7 #include "src/compiler/node-matchers.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after
865 EXPECT_EQ(kX64Shl, s[0]->arch_opcode()); 865 EXPECT_EQ(kX64Shl, s[0]->arch_opcode());
866 ASSERT_EQ(2U, s[0]->InputCount()); 866 ASSERT_EQ(2U, s[0]->InputCount());
867 EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0))); 867 EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0)));
868 EXPECT_EQ(x, s.ToInt32(s[0]->InputAt(1))); 868 EXPECT_EQ(x, s.ToInt32(s[0]->InputAt(1)));
869 ASSERT_EQ(1U, s[0]->OutputCount()); 869 ASSERT_EQ(1U, s[0]->OutputCount());
870 EXPECT_TRUE(s.IsSameAsFirst(s[0]->Output())); 870 EXPECT_TRUE(s.IsSameAsFirst(s[0]->Output()));
871 EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output())); 871 EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output()));
872 } 872 }
873 } 873 }
874 874
875
876 TEST_F(InstructionSelectorTest, Float64BinopArithmetic) {
877 {
878 StreamBuilder m(this, kMachFloat64, kMachFloat64, kMachFloat64);
879 Node* add = m.Float64Add(m.Parameter(0), m.Parameter(1));
880 Node* mul = m.Float64Mul(add, m.Parameter(1));
881 Node* sub = m.Float64Sub(mul, add);
882 Node* ret = m.Float64Div(mul, sub);
883 m.Return(ret);
884 Stream s = m.Build(AVX);
885 ASSERT_EQ(4U, s.size());
886 EXPECT_EQ(kAVXFloat64Add, s[0]->arch_opcode());
887 EXPECT_EQ(kAVXFloat64Mul, s[1]->arch_opcode());
888 EXPECT_EQ(kAVXFloat64Sub, s[2]->arch_opcode());
889 EXPECT_EQ(kAVXFloat64Div, s[3]->arch_opcode());
890 }
891 {
892 StreamBuilder m(this, kMachFloat64, kMachFloat64, kMachFloat64);
893 Node* add = m.Float64Add(m.Parameter(0), m.Parameter(1));
894 Node* mul = m.Float64Mul(add, m.Parameter(1));
895 Node* sub = m.Float64Sub(mul, add);
896 Node* ret = m.Float64Div(mul, sub);
897 m.Return(ret);
898 Stream s = m.Build();
899 ASSERT_EQ(4U, s.size());
900 EXPECT_EQ(kSSEFloat64Add, s[0]->arch_opcode());
901 EXPECT_EQ(kSSEFloat64Mul, s[1]->arch_opcode());
902 EXPECT_EQ(kSSEFloat64Sub, s[2]->arch_opcode());
903 EXPECT_EQ(kSSEFloat64Div, s[3]->arch_opcode());
904 }
905 }
906
875 } // namespace compiler 907 } // namespace compiler
876 } // namespace internal 908 } // namespace internal
877 } // namespace v8 909 } // namespace v8
OLDNEW
« no previous file with comments | « test/cctest/test-disasm-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698