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

Side by Side Diff: test/unittests/register-configuration-unittest.cc

Issue 2176173003: [Turbofan] Revert FP register aliasing support on Arm. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase. Created 4 years, 4 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 | « test/unittests/compiler/instruction-sequence-unittest.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 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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/register-configuration.h" 5 #include "src/register-configuration.h"
6 #include "testing/gtest-support.h" 6 #include "testing/gtest-support.h"
7 7
8 namespace v8 { 8 namespace v8 {
9 namespace internal { 9 namespace internal {
10 10
(...skipping 12 matching lines...) Expand all
23 TEST_F(RegisterConfigurationUnitTest, BasicProperties) { 23 TEST_F(RegisterConfigurationUnitTest, BasicProperties) {
24 const int kNumGeneralRegs = 3; 24 const int kNumGeneralRegs = 3;
25 const int kNumDoubleRegs = 4; 25 const int kNumDoubleRegs = 4;
26 const int kNumAllocatableGeneralRegs = 2; 26 const int kNumAllocatableGeneralRegs = 2;
27 const int kNumAllocatableDoubleRegs = 2; 27 const int kNumAllocatableDoubleRegs = 2;
28 int general_codes[kNumAllocatableGeneralRegs] = {1, 2}; 28 int general_codes[kNumAllocatableGeneralRegs] = {1, 2};
29 int double_codes[kNumAllocatableDoubleRegs] = {2, 3}; 29 int double_codes[kNumAllocatableDoubleRegs] = {2, 3};
30 30
31 RegisterConfiguration test( 31 RegisterConfiguration test(
32 kNumGeneralRegs, kNumDoubleRegs, kNumAllocatableGeneralRegs, 32 kNumGeneralRegs, kNumDoubleRegs, kNumAllocatableGeneralRegs,
33 kNumAllocatableDoubleRegs, general_codes, double_codes, 33 kNumAllocatableDoubleRegs, kNumAllocatableDoubleRegs, general_codes,
34 RegisterConfiguration::OVERLAP, nullptr, nullptr, nullptr, nullptr); 34 double_codes, RegisterConfiguration::OVERLAP, nullptr, nullptr, nullptr,
35 nullptr);
35 36
36 EXPECT_EQ(test.num_general_registers(), kNumGeneralRegs); 37 EXPECT_EQ(test.num_general_registers(), kNumGeneralRegs);
37 EXPECT_EQ(test.num_double_registers(), kNumDoubleRegs); 38 EXPECT_EQ(test.num_double_registers(), kNumDoubleRegs);
38 EXPECT_EQ(test.num_allocatable_general_registers(), 39 EXPECT_EQ(test.num_allocatable_general_registers(),
39 kNumAllocatableGeneralRegs); 40 kNumAllocatableGeneralRegs);
40 EXPECT_EQ(test.num_allocatable_double_registers(), kNumAllocatableDoubleRegs); 41 EXPECT_EQ(test.num_allocatable_double_registers(), kNumAllocatableDoubleRegs);
41 EXPECT_EQ(test.num_allocatable_float_registers(), kNumAllocatableDoubleRegs); 42 EXPECT_EQ(test.num_allocatable_float_registers(), kNumAllocatableDoubleRegs);
42 EXPECT_EQ(test.num_allocatable_simd128_registers(), 43 EXPECT_EQ(test.num_allocatable_simd128_registers(),
43 kNumAllocatableDoubleRegs); 44 kNumAllocatableDoubleRegs);
44 45
(...skipping 14 matching lines...) Expand all
59 TEST_F(RegisterConfigurationUnitTest, CombineAliasing) { 60 TEST_F(RegisterConfigurationUnitTest, CombineAliasing) {
60 const int kNumGeneralRegs = 3; 61 const int kNumGeneralRegs = 3;
61 const int kNumDoubleRegs = 4; 62 const int kNumDoubleRegs = 4;
62 const int kNumAllocatableGeneralRegs = 2; 63 const int kNumAllocatableGeneralRegs = 2;
63 const int kNumAllocatableDoubleRegs = 3; 64 const int kNumAllocatableDoubleRegs = 3;
64 int general_codes[] = {1, 2}; 65 int general_codes[] = {1, 2};
65 int double_codes[] = {2, 3, 16}; // reg 16 should not alias registers 32, 33. 66 int double_codes[] = {2, 3, 16}; // reg 16 should not alias registers 32, 33.
66 67
67 RegisterConfiguration test( 68 RegisterConfiguration test(
68 kNumGeneralRegs, kNumDoubleRegs, kNumAllocatableGeneralRegs, 69 kNumGeneralRegs, kNumDoubleRegs, kNumAllocatableGeneralRegs,
69 kNumAllocatableDoubleRegs, general_codes, double_codes, 70 kNumAllocatableDoubleRegs, kNumAllocatableDoubleRegs, general_codes,
70 RegisterConfiguration::COMBINE, nullptr, nullptr, nullptr, nullptr); 71 double_codes, RegisterConfiguration::COMBINE, nullptr, nullptr, nullptr,
72 nullptr);
71 73
72 // There are 3 allocatable double regs, but only 2 can alias float regs. 74 // There are 3 allocatable double regs, but only 2 can alias float regs.
73 EXPECT_EQ(test.num_allocatable_float_registers(), 4); 75 EXPECT_EQ(test.num_allocatable_float_registers(), 4);
74 76
75 // Test that float registers combine in pairs to form double registers. 77 // Test that float registers combine in pairs to form double registers.
76 EXPECT_EQ(test.GetAllocatableFloatCode(0), double_codes[0] * 2); 78 EXPECT_EQ(test.GetAllocatableFloatCode(0), double_codes[0] * 2);
77 EXPECT_EQ(test.GetAllocatableFloatCode(1), double_codes[0] * 2 + 1); 79 EXPECT_EQ(test.GetAllocatableFloatCode(1), double_codes[0] * 2 + 1);
78 EXPECT_EQ(test.GetAllocatableFloatCode(2), double_codes[1] * 2); 80 EXPECT_EQ(test.GetAllocatableFloatCode(2), double_codes[1] * 2);
79 EXPECT_EQ(test.GetAllocatableFloatCode(3), double_codes[1] * 2 + 1); 81 EXPECT_EQ(test.GetAllocatableFloatCode(3), double_codes[1] * 2 + 1);
80 82
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 test.GetAliases(kFloat64, RegisterConfiguration::kMaxFPRegisters / 2 + 1, 157 test.GetAliases(kFloat64, RegisterConfiguration::kMaxFPRegisters / 2 + 1,
156 kFloat32, &alias_base_index), 158 kFloat32, &alias_base_index),
157 0); 159 0);
158 EXPECT_EQ(test.GetAliases(kFloat64, RegisterConfiguration::kMaxFPRegisters, 160 EXPECT_EQ(test.GetAliases(kFloat64, RegisterConfiguration::kMaxFPRegisters,
159 kFloat32, &alias_base_index), 161 kFloat32, &alias_base_index),
160 0); 162 0);
161 } 163 }
162 164
163 } // namespace internal 165 } // namespace internal
164 } // namespace v8 166 } // namespace v8
OLDNEW
« no previous file with comments | « test/unittests/compiler/instruction-sequence-unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698