OLD | NEW |
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 "src/compiler/common-operator.h" | 5 #include "src/compiler/common-operator.h" |
6 #include "src/compiler/graph.h" | 6 #include "src/compiler/graph.h" |
7 #include "src/compiler/machine-operator.h" | 7 #include "src/compiler/machine-operator.h" |
8 #include "src/compiler/node.h" | 8 #include "src/compiler/node.h" |
9 #include "src/compiler/node-matchers.h" | 9 #include "src/compiler/node-matchers.h" |
10 #include "src/compiler/opcodes.h" | 10 #include "src/compiler/opcodes.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 | 23 |
24 MachineOperatorBuilder* machine() { return &machine_; } | 24 MachineOperatorBuilder* machine() { return &machine_; } |
25 | 25 |
26 private: | 26 private: |
27 MachineOperatorBuilder machine_; | 27 MachineOperatorBuilder machine_; |
28 }; | 28 }; |
29 | 29 |
30 namespace { | 30 namespace { |
31 | 31 |
32 template <class Matcher> | 32 template <class Matcher> |
33 void CheckScaledWithOffsetMatch(Matcher* matcher, Node* scaled, | 33 void CheckBaseWithIndexAndDisplacement(Matcher* matcher, Node* index, int scale, |
34 int scale_exponent, Node* offset, | 34 Node* base, Node* displacement) { |
35 Node* constant) { | |
36 EXPECT_TRUE(matcher->matches()); | 35 EXPECT_TRUE(matcher->matches()); |
37 EXPECT_EQ(scaled, matcher->scaled()); | 36 EXPECT_EQ(index, matcher->index()); |
38 EXPECT_EQ(scale_exponent, matcher->scale_exponent()); | 37 EXPECT_EQ(scale, matcher->scale()); |
39 EXPECT_EQ(offset, matcher->offset()); | 38 EXPECT_EQ(base, matcher->base()); |
40 EXPECT_EQ(constant, matcher->constant()); | 39 EXPECT_EQ(displacement, matcher->displacement()); |
41 } | 40 } |
42 }; | 41 }; |
43 | 42 |
44 | 43 |
45 TEST_F(NodeMatcherTest, ScaledWithOffset32Matcher) { | 44 TEST_F(NodeMatcherTest, ScaledWithOffset32Matcher) { |
46 graph()->SetStart(graph()->NewNode(common()->Start(0))); | 45 graph()->SetStart(graph()->NewNode(common()->Start(0))); |
47 | 46 |
48 const Operator* c0_op = common()->Int32Constant(0); | 47 const Operator* d0_op = common()->Int32Constant(0); |
49 Node* c0 = graph()->NewNode(c0_op); | 48 Node* d0 = graph()->NewNode(d0_op); |
50 USE(c0); | 49 USE(d0); |
51 const Operator* c1_op = common()->Int32Constant(1); | 50 const Operator* d1_op = common()->Int32Constant(1); |
52 Node* c1 = graph()->NewNode(c1_op); | 51 Node* d1 = graph()->NewNode(d1_op); |
53 USE(c1); | 52 USE(d1); |
54 const Operator* c2_op = common()->Int32Constant(2); | 53 const Operator* d2_op = common()->Int32Constant(2); |
55 Node* c2 = graph()->NewNode(c2_op); | 54 Node* d2 = graph()->NewNode(d2_op); |
56 USE(c2); | 55 USE(d2); |
57 const Operator* c3_op = common()->Int32Constant(3); | 56 const Operator* d3_op = common()->Int32Constant(3); |
58 Node* c3 = graph()->NewNode(c3_op); | 57 Node* d3 = graph()->NewNode(d3_op); |
59 USE(c3); | 58 USE(d3); |
60 const Operator* c4_op = common()->Int32Constant(4); | 59 const Operator* d4_op = common()->Int32Constant(4); |
61 Node* c4 = graph()->NewNode(c4_op); | 60 Node* d4 = graph()->NewNode(d4_op); |
62 USE(c4); | 61 USE(d4); |
63 const Operator* c8_op = common()->Int32Constant(8); | 62 const Operator* d5_op = common()->Int32Constant(5); |
64 Node* c8 = graph()->NewNode(c8_op); | 63 Node* d5 = graph()->NewNode(d5_op); |
65 USE(c8); | 64 USE(d5); |
66 const Operator* c15_op = common()->Int32Constant(15); | 65 const Operator* d7_op = common()->Int32Constant(7); |
67 Node* c15 = graph()->NewNode(c15_op); | 66 Node* d7 = graph()->NewNode(d7_op); |
68 USE(c15); | 67 USE(d4); |
| 68 const Operator* d8_op = common()->Int32Constant(8); |
| 69 Node* d8 = graph()->NewNode(d8_op); |
| 70 USE(d8); |
| 71 const Operator* d9_op = common()->Int32Constant(9); |
| 72 Node* d9 = graph()->NewNode(d9_op); |
| 73 USE(d9); |
| 74 const Operator* d15_op = common()->Int32Constant(15); |
| 75 Node* d15 = graph()->NewNode(d15_op); |
| 76 USE(d15); |
69 | 77 |
70 const Operator* o0_op = common()->Parameter(0); | 78 const Operator* b0_op = common()->Parameter(0); |
71 Node* o0 = graph()->NewNode(o0_op, graph()->start()); | 79 Node* b0 = graph()->NewNode(b0_op, graph()->start()); |
72 USE(o0); | 80 USE(b0); |
73 const Operator* o1_op = common()->Parameter(1); | 81 const Operator* b1_op = common()->Parameter(1); |
74 Node* o1 = graph()->NewNode(o1_op, graph()->start()); | 82 Node* b1 = graph()->NewNode(b1_op, graph()->start()); |
75 USE(o0); | 83 USE(b0); |
76 | 84 |
77 const Operator* p1_op = common()->Parameter(3); | 85 const Operator* p1_op = common()->Parameter(3); |
78 Node* p1 = graph()->NewNode(p1_op, graph()->start()); | 86 Node* p1 = graph()->NewNode(p1_op, graph()->start()); |
79 USE(p1); | 87 USE(p1); |
80 | 88 |
81 const Operator* a_op = machine()->Int32Add(); | 89 const Operator* a_op = machine()->Int32Add(); |
82 USE(a_op); | 90 USE(a_op); |
83 | 91 |
84 const Operator* m_op = machine()->Int32Mul(); | 92 const Operator* m_op = machine()->Int32Mul(); |
85 Node* m1 = graph()->NewNode(m_op, p1, c1); | 93 Node* m1 = graph()->NewNode(m_op, p1, d1); |
86 Node* m2 = graph()->NewNode(m_op, p1, c2); | 94 Node* m2 = graph()->NewNode(m_op, p1, d2); |
87 Node* m4 = graph()->NewNode(m_op, p1, c4); | 95 Node* m3 = graph()->NewNode(m_op, p1, d3); |
88 Node* m8 = graph()->NewNode(m_op, p1, c8); | 96 Node* m4 = graph()->NewNode(m_op, p1, d4); |
89 Node* m3 = graph()->NewNode(m_op, p1, c3); | 97 Node* m5 = graph()->NewNode(m_op, p1, d5); |
| 98 Node* m7 = graph()->NewNode(m_op, p1, d7); |
| 99 Node* m8 = graph()->NewNode(m_op, p1, d8); |
| 100 Node* m9 = graph()->NewNode(m_op, p1, d9); |
90 USE(m1); | 101 USE(m1); |
91 USE(m2); | 102 USE(m2); |
| 103 USE(m3); |
92 USE(m4); | 104 USE(m4); |
| 105 USE(m5); |
| 106 USE(m7); |
93 USE(m8); | 107 USE(m8); |
94 USE(m3); | 108 USE(m9); |
95 | 109 |
96 const Operator* s_op = machine()->Word32Shl(); | 110 const Operator* s_op = machine()->Word32Shl(); |
97 Node* s0 = graph()->NewNode(s_op, p1, c0); | 111 Node* s0 = graph()->NewNode(s_op, p1, d0); |
98 Node* s1 = graph()->NewNode(s_op, p1, c1); | 112 Node* s1 = graph()->NewNode(s_op, p1, d1); |
99 Node* s2 = graph()->NewNode(s_op, p1, c2); | 113 Node* s2 = graph()->NewNode(s_op, p1, d2); |
100 Node* s3 = graph()->NewNode(s_op, p1, c3); | 114 Node* s3 = graph()->NewNode(s_op, p1, d3); |
101 Node* s4 = graph()->NewNode(s_op, p1, c4); | 115 Node* s4 = graph()->NewNode(s_op, p1, d4); |
102 USE(s0); | 116 USE(s0); |
103 USE(s1); | 117 USE(s1); |
104 USE(s2); | 118 USE(s2); |
105 USE(s3); | 119 USE(s3); |
106 USE(s4); | 120 USE(s4); |
107 | 121 |
108 // 1 INPUT | 122 // 1 INPUT |
109 | 123 |
110 // Only relevant test cases is checking for non-match. | 124 // Only relevant test dases is Checking for non-match. |
111 ScaledWithOffset32Matcher match0(c15); | 125 BaseWithIndexAndDisplacement32Matcher match0(d15); |
112 EXPECT_FALSE(match0.matches()); | 126 EXPECT_FALSE(match0.matches()); |
113 | 127 |
114 // 2 INPUT | 128 // 2 INPUT |
115 | 129 |
116 // (O0 + O1) -> [O0, 0, O1, NULL] | 130 // (B0 + B1) -> [B0, 0, B1, NULL] |
117 ScaledWithOffset32Matcher match1(graph()->NewNode(a_op, o0, o1)); | 131 BaseWithIndexAndDisplacement32Matcher match1(graph()->NewNode(a_op, b0, b1)); |
118 CheckScaledWithOffsetMatch(&match1, o1, 0, o0, NULL); | 132 CheckBaseWithIndexAndDisplacement(&match1, b1, 0, b0, NULL); |
119 | 133 |
120 // (O0 + C15) -> [NULL, 0, O0, C15] | 134 // (B0 + D15) -> [NULL, 0, B0, D15] |
121 ScaledWithOffset32Matcher match2(graph()->NewNode(a_op, o0, c15)); | 135 BaseWithIndexAndDisplacement32Matcher match2(graph()->NewNode(a_op, b0, d15)); |
122 CheckScaledWithOffsetMatch(&match2, NULL, 0, o0, c15); | 136 CheckBaseWithIndexAndDisplacement(&match2, NULL, 0, b0, d15); |
123 | 137 |
124 // (C15 + O0) -> [NULL, 0, O0, C15] | 138 // (D15 + B0) -> [NULL, 0, B0, D15] |
125 ScaledWithOffset32Matcher match3(graph()->NewNode(a_op, c15, o0)); | 139 BaseWithIndexAndDisplacement32Matcher match3(graph()->NewNode(a_op, d15, b0)); |
126 CheckScaledWithOffsetMatch(&match3, NULL, 0, o0, c15); | 140 CheckBaseWithIndexAndDisplacement(&match3, NULL, 0, b0, d15); |
127 | 141 |
128 // (O0 + M1) -> [p1, 0, O0, NULL] | 142 // (B0 + M1) -> [p1, 0, B0, NULL] |
129 ScaledWithOffset32Matcher match4(graph()->NewNode(a_op, o0, m1)); | 143 BaseWithIndexAndDisplacement32Matcher match4(graph()->NewNode(a_op, b0, m1)); |
130 CheckScaledWithOffsetMatch(&match4, p1, 0, o0, NULL); | 144 CheckBaseWithIndexAndDisplacement(&match4, p1, 0, b0, NULL); |
131 | 145 |
132 // (M1 + O0) -> [p1, 0, O0, NULL] | 146 // (M1 + B0) -> [p1, 0, B0, NULL] |
133 m1 = graph()->NewNode(m_op, p1, c1); | 147 m1 = graph()->NewNode(m_op, p1, d1); |
134 ScaledWithOffset32Matcher match5(graph()->NewNode(a_op, m1, o0)); | 148 BaseWithIndexAndDisplacement32Matcher match5(graph()->NewNode(a_op, m1, b0)); |
135 CheckScaledWithOffsetMatch(&match5, p1, 0, o0, NULL); | 149 CheckBaseWithIndexAndDisplacement(&match5, p1, 0, b0, NULL); |
136 | 150 |
137 // (C15 + M1) -> [P1, 0, NULL, C15] | 151 // (D15 + M1) -> [P1, 0, NULL, D15] |
138 m1 = graph()->NewNode(m_op, p1, c1); | 152 m1 = graph()->NewNode(m_op, p1, d1); |
139 ScaledWithOffset32Matcher match6(graph()->NewNode(a_op, c15, m1)); | 153 BaseWithIndexAndDisplacement32Matcher match6(graph()->NewNode(a_op, d15, m1)); |
140 CheckScaledWithOffsetMatch(&match6, p1, 0, NULL, c15); | 154 CheckBaseWithIndexAndDisplacement(&match6, p1, 0, NULL, d15); |
141 | 155 |
142 // (M1 + C15) -> [P1, 0, NULL, C15] | 156 // (M1 + D15) -> [P1, 0, NULL, D15] |
143 m1 = graph()->NewNode(m_op, p1, c1); | 157 m1 = graph()->NewNode(m_op, p1, d1); |
144 ScaledWithOffset32Matcher match7(graph()->NewNode(a_op, m1, c15)); | 158 BaseWithIndexAndDisplacement32Matcher match7(graph()->NewNode(a_op, m1, d15)); |
145 CheckScaledWithOffsetMatch(&match7, p1, 0, NULL, c15); | 159 CheckBaseWithIndexAndDisplacement(&match7, p1, 0, NULL, d15); |
146 | 160 |
147 // (O0 + S0) -> [p1, 0, O0, NULL] | 161 // (B0 + S0) -> [p1, 0, B0, NULL] |
148 ScaledWithOffset32Matcher match8(graph()->NewNode(a_op, o0, s0)); | 162 BaseWithIndexAndDisplacement32Matcher match8(graph()->NewNode(a_op, b0, s0)); |
149 CheckScaledWithOffsetMatch(&match8, p1, 0, o0, NULL); | 163 CheckBaseWithIndexAndDisplacement(&match8, p1, 0, b0, NULL); |
150 | 164 |
151 // (S0 + O0) -> [p1, 0, O0, NULL] | 165 // (S0 + B0) -> [p1, 0, B0, NULL] |
152 s0 = graph()->NewNode(s_op, p1, c0); | 166 s0 = graph()->NewNode(s_op, p1, d0); |
153 ScaledWithOffset32Matcher match9(graph()->NewNode(a_op, s0, o0)); | 167 BaseWithIndexAndDisplacement32Matcher match9(graph()->NewNode(a_op, s0, b0)); |
154 CheckScaledWithOffsetMatch(&match9, p1, 0, o0, NULL); | 168 CheckBaseWithIndexAndDisplacement(&match9, p1, 0, b0, NULL); |
155 | 169 |
156 // (C15 + S0) -> [P1, 0, NULL, C15] | 170 // (D15 + S0) -> [P1, 0, NULL, D15] |
157 s0 = graph()->NewNode(s_op, p1, c0); | 171 s0 = graph()->NewNode(s_op, p1, d0); |
158 ScaledWithOffset32Matcher match10(graph()->NewNode(a_op, c15, s0)); | 172 BaseWithIndexAndDisplacement32Matcher match10( |
159 CheckScaledWithOffsetMatch(&match10, p1, 0, NULL, c15); | 173 graph()->NewNode(a_op, d15, s0)); |
160 | 174 CheckBaseWithIndexAndDisplacement(&match10, p1, 0, NULL, d15); |
161 // (S0 + C15) -> [P1, 0, NULL, C15] | 175 |
162 s0 = graph()->NewNode(s_op, p1, c0); | 176 // (S0 + D15) -> [P1, 0, NULL, D15] |
163 ScaledWithOffset32Matcher match11(graph()->NewNode(a_op, s0, c15)); | 177 s0 = graph()->NewNode(s_op, p1, d0); |
164 CheckScaledWithOffsetMatch(&match11, p1, 0, NULL, c15); | 178 BaseWithIndexAndDisplacement32Matcher match11( |
165 | 179 graph()->NewNode(a_op, s0, d15)); |
166 // (O0 + M2) -> [p1, 1, O0, NULL] | 180 CheckBaseWithIndexAndDisplacement(&match11, p1, 0, NULL, d15); |
167 ScaledWithOffset32Matcher match12(graph()->NewNode(a_op, o0, m2)); | 181 |
168 CheckScaledWithOffsetMatch(&match12, p1, 1, o0, NULL); | 182 // (B0 + M2) -> [p1, 1, B0, NULL] |
169 | 183 BaseWithIndexAndDisplacement32Matcher match12(graph()->NewNode(a_op, b0, m2)); |
170 // (M2 + O0) -> [p1, 1, O0, NULL] | 184 CheckBaseWithIndexAndDisplacement(&match12, p1, 1, b0, NULL); |
171 m2 = graph()->NewNode(m_op, p1, c2); | 185 |
172 ScaledWithOffset32Matcher match13(graph()->NewNode(a_op, m2, o0)); | 186 // (M2 + B0) -> [p1, 1, B0, NULL] |
173 CheckScaledWithOffsetMatch(&match13, p1, 1, o0, NULL); | 187 m2 = graph()->NewNode(m_op, p1, d2); |
174 | 188 BaseWithIndexAndDisplacement32Matcher match13(graph()->NewNode(a_op, m2, b0)); |
175 // (C15 + M2) -> [P1, 1, NULL, C15] | 189 CheckBaseWithIndexAndDisplacement(&match13, p1, 1, b0, NULL); |
176 m2 = graph()->NewNode(m_op, p1, c2); | 190 |
177 ScaledWithOffset32Matcher match14(graph()->NewNode(a_op, c15, m2)); | 191 // (D15 + M2) -> [P1, 1, NULL, D15] |
178 CheckScaledWithOffsetMatch(&match14, p1, 1, NULL, c15); | 192 m2 = graph()->NewNode(m_op, p1, d2); |
179 | 193 BaseWithIndexAndDisplacement32Matcher match14( |
180 // (M2 + C15) -> [P1, 1, NULL, C15] | 194 graph()->NewNode(a_op, d15, m2)); |
181 m2 = graph()->NewNode(m_op, p1, c2); | 195 CheckBaseWithIndexAndDisplacement(&match14, p1, 1, NULL, d15); |
182 ScaledWithOffset32Matcher match15(graph()->NewNode(a_op, m2, c15)); | 196 |
183 CheckScaledWithOffsetMatch(&match15, p1, 1, NULL, c15); | 197 // (M2 + D15) -> [P1, 1, NULL, D15] |
184 | 198 m2 = graph()->NewNode(m_op, p1, d2); |
185 // (O0 + S1) -> [p1, 1, O0, NULL] | 199 BaseWithIndexAndDisplacement32Matcher match15( |
186 ScaledWithOffset32Matcher match16(graph()->NewNode(a_op, o0, s1)); | 200 graph()->NewNode(a_op, m2, d15)); |
187 CheckScaledWithOffsetMatch(&match16, p1, 1, o0, NULL); | 201 CheckBaseWithIndexAndDisplacement(&match15, p1, 1, NULL, d15); |
188 | 202 |
189 // (S1 + O0) -> [p1, 1, O0, NULL] | 203 // (B0 + S1) -> [p1, 1, B0, NULL] |
190 s1 = graph()->NewNode(s_op, p1, c1); | 204 BaseWithIndexAndDisplacement32Matcher match16(graph()->NewNode(a_op, b0, s1)); |
191 ScaledWithOffset32Matcher match17(graph()->NewNode(a_op, s1, o0)); | 205 CheckBaseWithIndexAndDisplacement(&match16, p1, 1, b0, NULL); |
192 CheckScaledWithOffsetMatch(&match17, p1, 1, o0, NULL); | 206 |
193 | 207 // (S1 + B0) -> [p1, 1, B0, NULL] |
194 // (C15 + S1) -> [P1, 1, NULL, C15] | 208 s1 = graph()->NewNode(s_op, p1, d1); |
195 s1 = graph()->NewNode(s_op, p1, c1); | 209 BaseWithIndexAndDisplacement32Matcher match17(graph()->NewNode(a_op, s1, b0)); |
196 ScaledWithOffset32Matcher match18(graph()->NewNode(a_op, c15, s1)); | 210 CheckBaseWithIndexAndDisplacement(&match17, p1, 1, b0, NULL); |
197 CheckScaledWithOffsetMatch(&match18, p1, 1, NULL, c15); | 211 |
198 | 212 // (D15 + S1) -> [P1, 1, NULL, D15] |
199 // (S1 + C15) -> [P1, 1, NULL, C15] | 213 s1 = graph()->NewNode(s_op, p1, d1); |
200 s1 = graph()->NewNode(s_op, p1, c1); | 214 BaseWithIndexAndDisplacement32Matcher match18( |
201 ScaledWithOffset32Matcher match19(graph()->NewNode(a_op, s1, c15)); | 215 graph()->NewNode(a_op, d15, s1)); |
202 CheckScaledWithOffsetMatch(&match19, p1, 1, NULL, c15); | 216 CheckBaseWithIndexAndDisplacement(&match18, p1, 1, NULL, d15); |
203 | 217 |
204 // (O0 + M4) -> [p1, 2, O0, NULL] | 218 // (S1 + D15) -> [P1, 1, NULL, D15] |
205 ScaledWithOffset32Matcher match20(graph()->NewNode(a_op, o0, m4)); | 219 s1 = graph()->NewNode(s_op, p1, d1); |
206 CheckScaledWithOffsetMatch(&match20, p1, 2, o0, NULL); | 220 BaseWithIndexAndDisplacement32Matcher match19( |
207 | 221 graph()->NewNode(a_op, s1, d15)); |
208 // (M4 + O0) -> [p1, 2, O0, NULL] | 222 CheckBaseWithIndexAndDisplacement(&match19, p1, 1, NULL, d15); |
209 m4 = graph()->NewNode(m_op, p1, c4); | 223 |
210 ScaledWithOffset32Matcher match21(graph()->NewNode(a_op, m4, o0)); | 224 // (B0 + M4) -> [p1, 2, B0, NULL] |
211 CheckScaledWithOffsetMatch(&match21, p1, 2, o0, NULL); | 225 BaseWithIndexAndDisplacement32Matcher match20(graph()->NewNode(a_op, b0, m4)); |
212 | 226 CheckBaseWithIndexAndDisplacement(&match20, p1, 2, b0, NULL); |
213 // (C15 + M4) -> [p1, 2, NULL, C15] | 227 |
214 m4 = graph()->NewNode(m_op, p1, c4); | 228 // (M4 + B0) -> [p1, 2, B0, NULL] |
215 ScaledWithOffset32Matcher match22(graph()->NewNode(a_op, c15, m4)); | 229 m4 = graph()->NewNode(m_op, p1, d4); |
216 CheckScaledWithOffsetMatch(&match22, p1, 2, NULL, c15); | 230 BaseWithIndexAndDisplacement32Matcher match21(graph()->NewNode(a_op, m4, b0)); |
217 | 231 CheckBaseWithIndexAndDisplacement(&match21, p1, 2, b0, NULL); |
218 // (M4 + C15) -> [p1, 2, NULL, C15] | 232 |
219 m4 = graph()->NewNode(m_op, p1, c4); | 233 // (D15 + M4) -> [p1, 2, NULL, D15] |
220 ScaledWithOffset32Matcher match23(graph()->NewNode(a_op, m4, c15)); | 234 m4 = graph()->NewNode(m_op, p1, d4); |
221 CheckScaledWithOffsetMatch(&match23, p1, 2, NULL, c15); | 235 BaseWithIndexAndDisplacement32Matcher match22( |
222 | 236 graph()->NewNode(a_op, d15, m4)); |
223 // (O0 + S2) -> [p1, 2, O0, NULL] | 237 CheckBaseWithIndexAndDisplacement(&match22, p1, 2, NULL, d15); |
224 ScaledWithOffset32Matcher match24(graph()->NewNode(a_op, o0, s2)); | 238 |
225 CheckScaledWithOffsetMatch(&match24, p1, 2, o0, NULL); | 239 // (M4 + D15) -> [p1, 2, NULL, D15] |
226 | 240 m4 = graph()->NewNode(m_op, p1, d4); |
227 // (S2 + O0) -> [p1, 2, O0, NULL] | 241 BaseWithIndexAndDisplacement32Matcher match23( |
228 s2 = graph()->NewNode(s_op, p1, c2); | 242 graph()->NewNode(a_op, m4, d15)); |
229 ScaledWithOffset32Matcher match25(graph()->NewNode(a_op, s2, o0)); | 243 CheckBaseWithIndexAndDisplacement(&match23, p1, 2, NULL, d15); |
230 CheckScaledWithOffsetMatch(&match25, p1, 2, o0, NULL); | 244 |
231 | 245 // (B0 + S2) -> [p1, 2, B0, NULL] |
232 // (C15 + S2) -> [p1, 2, NULL, C15] | 246 BaseWithIndexAndDisplacement32Matcher match24(graph()->NewNode(a_op, b0, s2)); |
233 s2 = graph()->NewNode(s_op, p1, c2); | 247 CheckBaseWithIndexAndDisplacement(&match24, p1, 2, b0, NULL); |
234 ScaledWithOffset32Matcher match26(graph()->NewNode(a_op, c15, s2)); | 248 |
235 CheckScaledWithOffsetMatch(&match26, p1, 2, NULL, c15); | 249 // (S2 + B0) -> [p1, 2, B0, NULL] |
236 | 250 s2 = graph()->NewNode(s_op, p1, d2); |
237 // (S2 + C15) -> [p1, 2, NULL, C15] | 251 BaseWithIndexAndDisplacement32Matcher match25(graph()->NewNode(a_op, s2, b0)); |
238 s2 = graph()->NewNode(s_op, p1, c2); | 252 CheckBaseWithIndexAndDisplacement(&match25, p1, 2, b0, NULL); |
239 ScaledWithOffset32Matcher match27(graph()->NewNode(a_op, s2, c15)); | 253 |
240 CheckScaledWithOffsetMatch(&match27, p1, 2, NULL, c15); | 254 // (D15 + S2) -> [p1, 2, NULL, D15] |
241 | 255 s2 = graph()->NewNode(s_op, p1, d2); |
242 // (O0 + M8) -> [p1, 2, O0, NULL] | 256 BaseWithIndexAndDisplacement32Matcher match26( |
243 ScaledWithOffset32Matcher match28(graph()->NewNode(a_op, o0, m8)); | 257 graph()->NewNode(a_op, d15, s2)); |
244 CheckScaledWithOffsetMatch(&match28, p1, 3, o0, NULL); | 258 CheckBaseWithIndexAndDisplacement(&match26, p1, 2, NULL, d15); |
245 | 259 |
246 // (M8 + O0) -> [p1, 2, O0, NULL] | 260 // (S2 + D15) -> [p1, 2, NULL, D15] |
247 m8 = graph()->NewNode(m_op, p1, c8); | 261 s2 = graph()->NewNode(s_op, p1, d2); |
248 ScaledWithOffset32Matcher match29(graph()->NewNode(a_op, m8, o0)); | 262 BaseWithIndexAndDisplacement32Matcher match27( |
249 CheckScaledWithOffsetMatch(&match29, p1, 3, o0, NULL); | 263 graph()->NewNode(a_op, s2, d15)); |
250 | 264 CheckBaseWithIndexAndDisplacement(&match27, p1, 2, NULL, d15); |
251 // (C15 + M8) -> [p1, 2, NULL, C15] | 265 |
252 m8 = graph()->NewNode(m_op, p1, c8); | 266 // (B0 + M8) -> [p1, 2, B0, NULL] |
253 ScaledWithOffset32Matcher match30(graph()->NewNode(a_op, c15, m8)); | 267 BaseWithIndexAndDisplacement32Matcher match28(graph()->NewNode(a_op, b0, m8)); |
254 CheckScaledWithOffsetMatch(&match30, p1, 3, NULL, c15); | 268 CheckBaseWithIndexAndDisplacement(&match28, p1, 3, b0, NULL); |
255 | 269 |
256 // (M8 + C15) -> [p1, 2, NULL, C15] | 270 // (M8 + B0) -> [p1, 2, B0, NULL] |
257 m8 = graph()->NewNode(m_op, p1, c8); | 271 m8 = graph()->NewNode(m_op, p1, d8); |
258 ScaledWithOffset32Matcher match31(graph()->NewNode(a_op, m8, c15)); | 272 BaseWithIndexAndDisplacement32Matcher match29(graph()->NewNode(a_op, m8, b0)); |
259 CheckScaledWithOffsetMatch(&match31, p1, 3, NULL, c15); | 273 CheckBaseWithIndexAndDisplacement(&match29, p1, 3, b0, NULL); |
260 | 274 |
261 // (O0 + S3) -> [p1, 2, O0, NULL] | 275 // (D15 + M8) -> [p1, 2, NULL, D15] |
262 ScaledWithOffset32Matcher match32(graph()->NewNode(a_op, o0, s3)); | 276 m8 = graph()->NewNode(m_op, p1, d8); |
263 CheckScaledWithOffsetMatch(&match32, p1, 3, o0, NULL); | 277 BaseWithIndexAndDisplacement32Matcher match30( |
264 | 278 graph()->NewNode(a_op, d15, m8)); |
265 // (S3 + O0) -> [p1, 2, O0, NULL] | 279 CheckBaseWithIndexAndDisplacement(&match30, p1, 3, NULL, d15); |
266 s3 = graph()->NewNode(s_op, p1, c3); | 280 |
267 ScaledWithOffset32Matcher match33(graph()->NewNode(a_op, s3, o0)); | 281 // (M8 + D15) -> [p1, 2, NULL, D15] |
268 CheckScaledWithOffsetMatch(&match33, p1, 3, o0, NULL); | 282 m8 = graph()->NewNode(m_op, p1, d8); |
269 | 283 BaseWithIndexAndDisplacement32Matcher match31( |
270 // (C15 + S3) -> [p1, 2, NULL, C15] | 284 graph()->NewNode(a_op, m8, d15)); |
271 s3 = graph()->NewNode(s_op, p1, c3); | 285 CheckBaseWithIndexAndDisplacement(&match31, p1, 3, NULL, d15); |
272 ScaledWithOffset32Matcher match34(graph()->NewNode(a_op, c15, s3)); | 286 |
273 CheckScaledWithOffsetMatch(&match34, p1, 3, NULL, c15); | 287 // (B0 + S3) -> [p1, 2, B0, NULL] |
274 | 288 BaseWithIndexAndDisplacement32Matcher match32(graph()->NewNode(a_op, b0, s3)); |
275 // (S3 + C15) -> [p1, 2, NULL, C15] | 289 CheckBaseWithIndexAndDisplacement(&match32, p1, 3, b0, NULL); |
276 s3 = graph()->NewNode(s_op, p1, c3); | 290 |
277 ScaledWithOffset32Matcher match35(graph()->NewNode(a_op, s3, c15)); | 291 // (S3 + B0) -> [p1, 2, B0, NULL] |
278 CheckScaledWithOffsetMatch(&match35, p1, 3, NULL, c15); | 292 s3 = graph()->NewNode(s_op, p1, d3); |
| 293 BaseWithIndexAndDisplacement32Matcher match33(graph()->NewNode(a_op, s3, b0)); |
| 294 CheckBaseWithIndexAndDisplacement(&match33, p1, 3, b0, NULL); |
| 295 |
| 296 // (D15 + S3) -> [p1, 2, NULL, D15] |
| 297 s3 = graph()->NewNode(s_op, p1, d3); |
| 298 BaseWithIndexAndDisplacement32Matcher match34( |
| 299 graph()->NewNode(a_op, d15, s3)); |
| 300 CheckBaseWithIndexAndDisplacement(&match34, p1, 3, NULL, d15); |
| 301 |
| 302 // (S3 + D15) -> [p1, 2, NULL, D15] |
| 303 s3 = graph()->NewNode(s_op, p1, d3); |
| 304 BaseWithIndexAndDisplacement32Matcher match35( |
| 305 graph()->NewNode(a_op, s3, d15)); |
| 306 CheckBaseWithIndexAndDisplacement(&match35, p1, 3, NULL, d15); |
279 | 307 |
280 // 2 INPUT - NEGATIVE CASES | 308 // 2 INPUT - NEGATIVE CASES |
281 | 309 |
282 // (M3 + O1) -> [O0, 0, M3, NULL] | 310 // (M3 + B1) -> [B0, 0, M3, NULL] |
283 ScaledWithOffset32Matcher match36(graph()->NewNode(a_op, o1, m3)); | 311 BaseWithIndexAndDisplacement32Matcher match36(graph()->NewNode(a_op, b1, m3)); |
284 CheckScaledWithOffsetMatch(&match36, m3, 0, o1, NULL); | 312 CheckBaseWithIndexAndDisplacement(&match36, m3, 0, b1, NULL); |
285 | 313 |
286 // (S4 + O1) -> [O0, 0, S4, NULL] | 314 // (S4 + B1) -> [B0, 0, S4, NULL] |
287 ScaledWithOffset32Matcher match37(graph()->NewNode(a_op, o1, s4)); | 315 BaseWithIndexAndDisplacement32Matcher match37(graph()->NewNode(a_op, b1, s4)); |
288 CheckScaledWithOffsetMatch(&match37, s4, 0, o1, NULL); | 316 CheckBaseWithIndexAndDisplacement(&match37, s4, 0, b1, NULL); |
289 | 317 |
290 // 3 INPUT | 318 // 3 INPUT |
291 | 319 |
292 // (C15 + S3) + O0 -> [p1, 2, o0, c15] | 320 // (D15 + S3) + B0 -> [p1, 2, b0, d15] |
293 s3 = graph()->NewNode(s_op, p1, c3); | 321 s3 = graph()->NewNode(s_op, p1, d3); |
294 ScaledWithOffset32Matcher match38( | 322 BaseWithIndexAndDisplacement32Matcher match38( |
295 graph()->NewNode(a_op, graph()->NewNode(a_op, c15, s3), o0)); | 323 graph()->NewNode(a_op, graph()->NewNode(a_op, d15, s3), b0)); |
296 CheckScaledWithOffsetMatch(&match38, p1, 3, o0, c15); | 324 CheckBaseWithIndexAndDisplacement(&match38, p1, 3, b0, d15); |
297 | 325 |
298 // (O0 + C15) + S3 -> [p1, 2, o0, c15] | 326 // (B0 + D15) + S3 -> [p1, 2, b0, d15] |
299 s3 = graph()->NewNode(s_op, p1, c3); | 327 s3 = graph()->NewNode(s_op, p1, d3); |
300 ScaledWithOffset32Matcher match39( | 328 BaseWithIndexAndDisplacement32Matcher match39( |
301 graph()->NewNode(a_op, graph()->NewNode(a_op, o0, c15), s3)); | 329 graph()->NewNode(a_op, graph()->NewNode(a_op, b0, d15), s3)); |
302 CheckScaledWithOffsetMatch(&match39, p1, 3, o0, c15); | 330 CheckBaseWithIndexAndDisplacement(&match39, p1, 3, b0, d15); |
303 | 331 |
304 // (S3 + O0) + C15 -> [p1, 2, o0, c15] | 332 // (S3 + B0) + D15 -> [p1, 2, b0, d15] |
305 s3 = graph()->NewNode(s_op, p1, c3); | 333 s3 = graph()->NewNode(s_op, p1, d3); |
306 ScaledWithOffset32Matcher match40( | 334 BaseWithIndexAndDisplacement32Matcher match40( |
307 graph()->NewNode(a_op, graph()->NewNode(a_op, s3, o0), c15)); | 335 graph()->NewNode(a_op, graph()->NewNode(a_op, s3, b0), d15)); |
308 CheckScaledWithOffsetMatch(&match40, p1, 3, o0, c15); | 336 CheckBaseWithIndexAndDisplacement(&match40, p1, 3, b0, d15); |
309 | 337 |
310 // C15 + (S3 + O0) -> [p1, 2, o0, c15] | 338 // D15 + (S3 + B0) -> [p1, 2, b0, d15] |
311 s3 = graph()->NewNode(s_op, p1, c3); | 339 s3 = graph()->NewNode(s_op, p1, d3); |
312 ScaledWithOffset32Matcher match41( | 340 BaseWithIndexAndDisplacement32Matcher match41( |
313 graph()->NewNode(a_op, c15, graph()->NewNode(a_op, s3, o0))); | 341 graph()->NewNode(a_op, d15, graph()->NewNode(a_op, s3, b0))); |
314 CheckScaledWithOffsetMatch(&match41, p1, 3, o0, c15); | 342 CheckBaseWithIndexAndDisplacement(&match41, p1, 3, b0, d15); |
315 | 343 |
316 // O0 + (C15 + S3) -> [p1, 2, o0, c15] | 344 // B0 + (D15 + S3) -> [p1, 2, b0, d15] |
317 s3 = graph()->NewNode(s_op, p1, c3); | 345 s3 = graph()->NewNode(s_op, p1, d3); |
318 ScaledWithOffset32Matcher match42( | 346 BaseWithIndexAndDisplacement32Matcher match42( |
319 graph()->NewNode(a_op, o0, graph()->NewNode(a_op, c15, s3))); | 347 graph()->NewNode(a_op, b0, graph()->NewNode(a_op, d15, s3))); |
320 CheckScaledWithOffsetMatch(&match42, p1, 3, o0, c15); | 348 CheckBaseWithIndexAndDisplacement(&match42, p1, 3, b0, d15); |
321 | 349 |
322 // S3 + (O0 + C15) -> [p1, 2, o0, c15] | 350 // S3 + (B0 + D15) -> [p1, 2, b0, d15] |
323 s3 = graph()->NewNode(s_op, p1, c3); | 351 s3 = graph()->NewNode(s_op, p1, d3); |
324 ScaledWithOffset32Matcher match43( | 352 BaseWithIndexAndDisplacement32Matcher match43( |
325 graph()->NewNode(a_op, s3, graph()->NewNode(a_op, o0, c15))); | 353 graph()->NewNode(a_op, s3, graph()->NewNode(a_op, b0, d15))); |
326 CheckScaledWithOffsetMatch(&match43, p1, 3, o0, c15); | 354 CheckBaseWithIndexAndDisplacement(&match43, p1, 3, b0, d15); |
| 355 |
| 356 // Check that scales that require using the base address work dorrectly. |
327 } | 357 } |
328 | 358 |
329 | 359 |
330 TEST_F(NodeMatcherTest, ScaledWithOffset64Matcher) { | 360 TEST_F(NodeMatcherTest, ScaledWithOffset64Matcher) { |
331 graph()->SetStart(graph()->NewNode(common()->Start(0))); | 361 graph()->SetStart(graph()->NewNode(common()->Start(0))); |
332 | 362 |
333 const Operator* c0_op = common()->Int64Constant(0); | 363 const Operator* d0_op = common()->Int64Constant(0); |
334 Node* c0 = graph()->NewNode(c0_op); | 364 Node* d0 = graph()->NewNode(d0_op); |
335 USE(c0); | 365 USE(d0); |
336 const Operator* c1_op = common()->Int64Constant(1); | 366 const Operator* d1_op = common()->Int64Constant(1); |
337 Node* c1 = graph()->NewNode(c1_op); | 367 Node* d1 = graph()->NewNode(d1_op); |
338 USE(c1); | 368 USE(d1); |
339 const Operator* c2_op = common()->Int64Constant(2); | 369 const Operator* d2_op = common()->Int64Constant(2); |
340 Node* c2 = graph()->NewNode(c2_op); | 370 Node* d2 = graph()->NewNode(d2_op); |
341 USE(c2); | 371 USE(d2); |
342 const Operator* c3_op = common()->Int64Constant(3); | 372 const Operator* d3_op = common()->Int64Constant(3); |
343 Node* c3 = graph()->NewNode(c3_op); | 373 Node* d3 = graph()->NewNode(d3_op); |
344 USE(c3); | 374 USE(d3); |
345 const Operator* c4_op = common()->Int64Constant(4); | 375 const Operator* d4_op = common()->Int64Constant(4); |
346 Node* c4 = graph()->NewNode(c4_op); | 376 Node* d4 = graph()->NewNode(d4_op); |
347 USE(c4); | 377 USE(d4); |
348 const Operator* c8_op = common()->Int64Constant(8); | 378 const Operator* d5_op = common()->Int64Constant(5); |
349 Node* c8 = graph()->NewNode(c8_op); | 379 Node* d5 = graph()->NewNode(d5_op); |
350 USE(c8); | 380 USE(d5); |
351 const Operator* c15_op = common()->Int64Constant(15); | 381 const Operator* d7_op = common()->Int64Constant(7); |
352 Node* c15 = graph()->NewNode(c15_op); | 382 Node* d7 = graph()->NewNode(d7_op); |
353 USE(c15); | 383 USE(d7); |
354 | 384 const Operator* d8_op = common()->Int64Constant(8); |
355 const Operator* o0_op = common()->Parameter(0); | 385 Node* d8 = graph()->NewNode(d8_op); |
356 Node* o0 = graph()->NewNode(o0_op, graph()->start()); | 386 USE(d8); |
357 USE(o0); | 387 const Operator* d9_op = common()->Int64Constant(9); |
358 const Operator* o1_op = common()->Parameter(1); | 388 Node* d9 = graph()->NewNode(d9_op); |
359 Node* o1 = graph()->NewNode(o1_op, graph()->start()); | 389 USE(d8); |
360 USE(o0); | 390 const Operator* d15_op = common()->Int64Constant(15); |
| 391 Node* d15 = graph()->NewNode(d15_op); |
| 392 USE(d15); |
| 393 |
| 394 const Operator* b0_op = common()->Parameter(0); |
| 395 Node* b0 = graph()->NewNode(b0_op, graph()->start()); |
| 396 USE(b0); |
| 397 const Operator* b1_op = common()->Parameter(1); |
| 398 Node* b1 = graph()->NewNode(b1_op, graph()->start()); |
| 399 USE(b0); |
361 | 400 |
362 const Operator* p1_op = common()->Parameter(3); | 401 const Operator* p1_op = common()->Parameter(3); |
363 Node* p1 = graph()->NewNode(p1_op, graph()->start()); | 402 Node* p1 = graph()->NewNode(p1_op, graph()->start()); |
364 USE(p1); | 403 USE(p1); |
365 | 404 |
366 const Operator* a_op = machine()->Int64Add(); | 405 const Operator* a_op = machine()->Int64Add(); |
367 USE(a_op); | 406 USE(a_op); |
368 | 407 |
369 const Operator* m_op = machine()->Int64Mul(); | 408 const Operator* m_op = machine()->Int64Mul(); |
370 Node* m1 = graph()->NewNode(m_op, p1, c1); | 409 Node* m1 = graph()->NewNode(m_op, p1, d1); |
371 Node* m2 = graph()->NewNode(m_op, p1, c2); | 410 Node* m2 = graph()->NewNode(m_op, p1, d2); |
372 Node* m4 = graph()->NewNode(m_op, p1, c4); | 411 Node* m3 = graph()->NewNode(m_op, p1, d3); |
373 Node* m8 = graph()->NewNode(m_op, p1, c8); | 412 Node* m4 = graph()->NewNode(m_op, p1, d4); |
374 Node* m3 = graph()->NewNode(m_op, p1, c3); | 413 Node* m5 = graph()->NewNode(m_op, p1, d5); |
| 414 Node* m7 = graph()->NewNode(m_op, p1, d7); |
| 415 Node* m8 = graph()->NewNode(m_op, p1, d8); |
| 416 Node* m9 = graph()->NewNode(m_op, p1, d9); |
375 USE(m1); | 417 USE(m1); |
376 USE(m2); | 418 USE(m2); |
| 419 USE(m3); |
377 USE(m4); | 420 USE(m4); |
| 421 USE(m5); |
| 422 USE(m7); |
378 USE(m8); | 423 USE(m8); |
379 USE(m3); | 424 USE(m9); |
380 | 425 |
381 const Operator* s_op = machine()->Word64Shl(); | 426 const Operator* s_op = machine()->Word64Shl(); |
382 Node* s0 = graph()->NewNode(s_op, p1, c0); | 427 Node* s0 = graph()->NewNode(s_op, p1, d0); |
383 Node* s1 = graph()->NewNode(s_op, p1, c1); | 428 Node* s1 = graph()->NewNode(s_op, p1, d1); |
384 Node* s2 = graph()->NewNode(s_op, p1, c2); | 429 Node* s2 = graph()->NewNode(s_op, p1, d2); |
385 Node* s3 = graph()->NewNode(s_op, p1, c3); | 430 Node* s3 = graph()->NewNode(s_op, p1, d3); |
386 Node* s4 = graph()->NewNode(s_op, p1, c4); | 431 Node* s4 = graph()->NewNode(s_op, p1, d4); |
387 USE(s0); | 432 USE(s0); |
388 USE(s1); | 433 USE(s1); |
389 USE(s2); | 434 USE(s2); |
390 USE(s3); | 435 USE(s3); |
391 USE(s4); | 436 USE(s4); |
392 | 437 |
393 // 1 INPUT | 438 // 1 INPUT |
394 | 439 |
395 // Only relevant test cases is checking for non-match. | 440 // Only relevant test dases is Checking for non-match. |
396 ScaledWithOffset64Matcher match0(c15); | 441 BaseWithIndexAndDisplacement64Matcher match0(d15); |
397 EXPECT_FALSE(match0.matches()); | 442 EXPECT_FALSE(match0.matches()); |
398 | 443 |
399 // 2 INPUT | 444 // 2 INPUT |
400 | 445 |
401 // (O0 + O1) -> [O0, 0, O1, NULL] | 446 // (B0 + B1) -> [B0, 0, B1, NULL] |
402 ScaledWithOffset64Matcher match1(graph()->NewNode(a_op, o0, o1)); | 447 BaseWithIndexAndDisplacement64Matcher match1(graph()->NewNode(a_op, b0, b1)); |
403 CheckScaledWithOffsetMatch(&match1, o1, 0, o0, NULL); | 448 CheckBaseWithIndexAndDisplacement(&match1, b1, 0, b0, NULL); |
404 | 449 |
405 // (O0 + C15) -> [NULL, 0, O0, C15] | 450 // (B0 + D15) -> [NULL, 0, B0, D15] |
406 ScaledWithOffset64Matcher match2(graph()->NewNode(a_op, o0, c15)); | 451 BaseWithIndexAndDisplacement64Matcher match2(graph()->NewNode(a_op, b0, d15)); |
407 CheckScaledWithOffsetMatch(&match2, NULL, 0, o0, c15); | 452 CheckBaseWithIndexAndDisplacement(&match2, NULL, 0, b0, d15); |
408 | 453 |
409 // (C15 + O0) -> [NULL, 0, O0, C15] | 454 // (D15 + B0) -> [NULL, 0, B0, D15] |
410 ScaledWithOffset64Matcher match3(graph()->NewNode(a_op, c15, o0)); | 455 BaseWithIndexAndDisplacement64Matcher match3(graph()->NewNode(a_op, d15, b0)); |
411 CheckScaledWithOffsetMatch(&match3, NULL, 0, o0, c15); | 456 CheckBaseWithIndexAndDisplacement(&match3, NULL, 0, b0, d15); |
412 | 457 |
413 // (O0 + M1) -> [p1, 0, O0, NULL] | 458 // (B0 + M1) -> [p1, 0, B0, NULL] |
414 ScaledWithOffset64Matcher match4(graph()->NewNode(a_op, o0, m1)); | 459 BaseWithIndexAndDisplacement64Matcher match4(graph()->NewNode(a_op, b0, m1)); |
415 CheckScaledWithOffsetMatch(&match4, p1, 0, o0, NULL); | 460 CheckBaseWithIndexAndDisplacement(&match4, p1, 0, b0, NULL); |
416 | 461 |
417 // (M1 + O0) -> [p1, 0, O0, NULL] | 462 // (M1 + B0) -> [p1, 0, B0, NULL] |
418 m1 = graph()->NewNode(m_op, p1, c1); | 463 m1 = graph()->NewNode(m_op, p1, d1); |
419 ScaledWithOffset64Matcher match5(graph()->NewNode(a_op, m1, o0)); | 464 BaseWithIndexAndDisplacement64Matcher match5(graph()->NewNode(a_op, m1, b0)); |
420 CheckScaledWithOffsetMatch(&match5, p1, 0, o0, NULL); | 465 CheckBaseWithIndexAndDisplacement(&match5, p1, 0, b0, NULL); |
421 | 466 |
422 // (C15 + M1) -> [P1, 0, NULL, C15] | 467 // (D15 + M1) -> [P1, 0, NULL, D15] |
423 m1 = graph()->NewNode(m_op, p1, c1); | 468 m1 = graph()->NewNode(m_op, p1, d1); |
424 ScaledWithOffset64Matcher match6(graph()->NewNode(a_op, c15, m1)); | 469 BaseWithIndexAndDisplacement64Matcher match6(graph()->NewNode(a_op, d15, m1)); |
425 CheckScaledWithOffsetMatch(&match6, p1, 0, NULL, c15); | 470 CheckBaseWithIndexAndDisplacement(&match6, p1, 0, NULL, d15); |
426 | 471 |
427 // (M1 + C15) -> [P1, 0, NULL, C15] | 472 // (M1 + D15) -> [P1, 0, NULL, D15] |
428 m1 = graph()->NewNode(m_op, p1, c1); | 473 m1 = graph()->NewNode(m_op, p1, d1); |
429 ScaledWithOffset64Matcher match7(graph()->NewNode(a_op, m1, c15)); | 474 BaseWithIndexAndDisplacement64Matcher match7(graph()->NewNode(a_op, m1, d15)); |
430 CheckScaledWithOffsetMatch(&match7, p1, 0, NULL, c15); | 475 CheckBaseWithIndexAndDisplacement(&match7, p1, 0, NULL, d15); |
431 | 476 |
432 // (O0 + S0) -> [p1, 0, O0, NULL] | 477 // (B0 + S0) -> [p1, 0, B0, NULL] |
433 ScaledWithOffset64Matcher match8(graph()->NewNode(a_op, o0, s0)); | 478 BaseWithIndexAndDisplacement64Matcher match8(graph()->NewNode(a_op, b0, s0)); |
434 CheckScaledWithOffsetMatch(&match8, p1, 0, o0, NULL); | 479 CheckBaseWithIndexAndDisplacement(&match8, p1, 0, b0, NULL); |
435 | 480 |
436 // (S0 + O0) -> [p1, 0, O0, NULL] | 481 // (S0 + B0) -> [p1, 0, B0, NULL] |
437 s0 = graph()->NewNode(s_op, p1, c0); | 482 s0 = graph()->NewNode(s_op, p1, d0); |
438 ScaledWithOffset64Matcher match9(graph()->NewNode(a_op, s0, o0)); | 483 BaseWithIndexAndDisplacement64Matcher match9(graph()->NewNode(a_op, s0, b0)); |
439 CheckScaledWithOffsetMatch(&match9, p1, 0, o0, NULL); | 484 CheckBaseWithIndexAndDisplacement(&match9, p1, 0, b0, NULL); |
440 | 485 |
441 // (C15 + S0) -> [P1, 0, NULL, C15] | 486 // (D15 + S0) -> [P1, 0, NULL, D15] |
442 s0 = graph()->NewNode(s_op, p1, c0); | 487 s0 = graph()->NewNode(s_op, p1, d0); |
443 ScaledWithOffset64Matcher match10(graph()->NewNode(a_op, c15, s0)); | 488 BaseWithIndexAndDisplacement64Matcher match10( |
444 CheckScaledWithOffsetMatch(&match10, p1, 0, NULL, c15); | 489 graph()->NewNode(a_op, d15, s0)); |
445 | 490 CheckBaseWithIndexAndDisplacement(&match10, p1, 0, NULL, d15); |
446 // (S0 + C15) -> [P1, 0, NULL, C15] | 491 |
447 s0 = graph()->NewNode(s_op, p1, c0); | 492 // (S0 + D15) -> [P1, 0, NULL, D15] |
448 ScaledWithOffset64Matcher match11(graph()->NewNode(a_op, s0, c15)); | 493 s0 = graph()->NewNode(s_op, p1, d0); |
449 CheckScaledWithOffsetMatch(&match11, p1, 0, NULL, c15); | 494 BaseWithIndexAndDisplacement64Matcher match11( |
450 | 495 graph()->NewNode(a_op, s0, d15)); |
451 // (O0 + M2) -> [p1, 1, O0, NULL] | 496 CheckBaseWithIndexAndDisplacement(&match11, p1, 0, NULL, d15); |
452 ScaledWithOffset64Matcher match12(graph()->NewNode(a_op, o0, m2)); | 497 |
453 CheckScaledWithOffsetMatch(&match12, p1, 1, o0, NULL); | 498 // (B0 + M2) -> [p1, 1, B0, NULL] |
454 | 499 BaseWithIndexAndDisplacement64Matcher match12(graph()->NewNode(a_op, b0, m2)); |
455 // (M2 + O0) -> [p1, 1, O0, NULL] | 500 CheckBaseWithIndexAndDisplacement(&match12, p1, 1, b0, NULL); |
456 m2 = graph()->NewNode(m_op, p1, c2); | 501 |
457 ScaledWithOffset64Matcher match13(graph()->NewNode(a_op, m2, o0)); | 502 // (M2 + B0) -> [p1, 1, B0, NULL] |
458 CheckScaledWithOffsetMatch(&match13, p1, 1, o0, NULL); | 503 m2 = graph()->NewNode(m_op, p1, d2); |
459 | 504 BaseWithIndexAndDisplacement64Matcher match13(graph()->NewNode(a_op, m2, b0)); |
460 // (C15 + M2) -> [P1, 1, NULL, C15] | 505 CheckBaseWithIndexAndDisplacement(&match13, p1, 1, b0, NULL); |
461 m2 = graph()->NewNode(m_op, p1, c2); | 506 |
462 ScaledWithOffset64Matcher match14(graph()->NewNode(a_op, c15, m2)); | 507 // (D15 + M2) -> [P1, 1, NULL, D15] |
463 CheckScaledWithOffsetMatch(&match14, p1, 1, NULL, c15); | 508 m2 = graph()->NewNode(m_op, p1, d2); |
464 | 509 BaseWithIndexAndDisplacement64Matcher match14( |
465 // (M2 + C15) -> [P1, 1, NULL, C15] | 510 graph()->NewNode(a_op, d15, m2)); |
466 m2 = graph()->NewNode(m_op, p1, c2); | 511 CheckBaseWithIndexAndDisplacement(&match14, p1, 1, NULL, d15); |
467 ScaledWithOffset64Matcher match15(graph()->NewNode(a_op, m2, c15)); | 512 |
468 CheckScaledWithOffsetMatch(&match15, p1, 1, NULL, c15); | 513 // (M2 + D15) -> [P1, 1, NULL, D15] |
469 | 514 m2 = graph()->NewNode(m_op, p1, d2); |
470 // (O0 + S1) -> [p1, 1, O0, NULL] | 515 BaseWithIndexAndDisplacement64Matcher match15( |
471 ScaledWithOffset64Matcher match16(graph()->NewNode(a_op, o0, s1)); | 516 graph()->NewNode(a_op, m2, d15)); |
472 CheckScaledWithOffsetMatch(&match16, p1, 1, o0, NULL); | 517 CheckBaseWithIndexAndDisplacement(&match15, p1, 1, NULL, d15); |
473 | 518 |
474 // (S1 + O0) -> [p1, 1, O0, NULL] | 519 // (B0 + S1) -> [p1, 1, B0, NULL] |
475 s1 = graph()->NewNode(s_op, p1, c1); | 520 BaseWithIndexAndDisplacement64Matcher match16(graph()->NewNode(a_op, b0, s1)); |
476 ScaledWithOffset64Matcher match17(graph()->NewNode(a_op, s1, o0)); | 521 CheckBaseWithIndexAndDisplacement(&match16, p1, 1, b0, NULL); |
477 CheckScaledWithOffsetMatch(&match17, p1, 1, o0, NULL); | 522 |
478 | 523 // (S1 + B0) -> [p1, 1, B0, NULL] |
479 // (C15 + S1) -> [P1, 1, NULL, C15] | 524 s1 = graph()->NewNode(s_op, p1, d1); |
480 s1 = graph()->NewNode(s_op, p1, c1); | 525 BaseWithIndexAndDisplacement64Matcher match17(graph()->NewNode(a_op, s1, b0)); |
481 ScaledWithOffset64Matcher match18(graph()->NewNode(a_op, c15, s1)); | 526 CheckBaseWithIndexAndDisplacement(&match17, p1, 1, b0, NULL); |
482 CheckScaledWithOffsetMatch(&match18, p1, 1, NULL, c15); | 527 |
483 | 528 // (D15 + S1) -> [P1, 1, NULL, D15] |
484 // (S1 + C15) -> [P1, 1, NULL, C15] | 529 s1 = graph()->NewNode(s_op, p1, d1); |
485 s1 = graph()->NewNode(s_op, p1, c1); | 530 BaseWithIndexAndDisplacement64Matcher match18( |
486 ScaledWithOffset64Matcher match19(graph()->NewNode(a_op, s1, c15)); | 531 graph()->NewNode(a_op, d15, s1)); |
487 CheckScaledWithOffsetMatch(&match19, p1, 1, NULL, c15); | 532 CheckBaseWithIndexAndDisplacement(&match18, p1, 1, NULL, d15); |
488 | 533 |
489 // (O0 + M4) -> [p1, 2, O0, NULL] | 534 // (S1 + D15) -> [P1, 1, NULL, D15] |
490 ScaledWithOffset64Matcher match20(graph()->NewNode(a_op, o0, m4)); | 535 s1 = graph()->NewNode(s_op, p1, d1); |
491 CheckScaledWithOffsetMatch(&match20, p1, 2, o0, NULL); | 536 BaseWithIndexAndDisplacement64Matcher match19( |
492 | 537 graph()->NewNode(a_op, s1, d15)); |
493 // (M4 + O0) -> [p1, 2, O0, NULL] | 538 CheckBaseWithIndexAndDisplacement(&match19, p1, 1, NULL, d15); |
494 m4 = graph()->NewNode(m_op, p1, c4); | 539 |
495 ScaledWithOffset64Matcher match21(graph()->NewNode(a_op, m4, o0)); | 540 // (B0 + M4) -> [p1, 2, B0, NULL] |
496 CheckScaledWithOffsetMatch(&match21, p1, 2, o0, NULL); | 541 BaseWithIndexAndDisplacement64Matcher match20(graph()->NewNode(a_op, b0, m4)); |
497 | 542 CheckBaseWithIndexAndDisplacement(&match20, p1, 2, b0, NULL); |
498 // (C15 + M4) -> [p1, 2, NULL, C15] | 543 |
499 m4 = graph()->NewNode(m_op, p1, c4); | 544 // (M4 + B0) -> [p1, 2, B0, NULL] |
500 ScaledWithOffset64Matcher match22(graph()->NewNode(a_op, c15, m4)); | 545 m4 = graph()->NewNode(m_op, p1, d4); |
501 CheckScaledWithOffsetMatch(&match22, p1, 2, NULL, c15); | 546 BaseWithIndexAndDisplacement64Matcher match21(graph()->NewNode(a_op, m4, b0)); |
502 | 547 CheckBaseWithIndexAndDisplacement(&match21, p1, 2, b0, NULL); |
503 // (M4 + C15) -> [p1, 2, NULL, C15] | 548 |
504 m4 = graph()->NewNode(m_op, p1, c4); | 549 // (D15 + M4) -> [p1, 2, NULL, D15] |
505 ScaledWithOffset64Matcher match23(graph()->NewNode(a_op, m4, c15)); | 550 m4 = graph()->NewNode(m_op, p1, d4); |
506 CheckScaledWithOffsetMatch(&match23, p1, 2, NULL, c15); | 551 BaseWithIndexAndDisplacement64Matcher match22( |
507 | 552 graph()->NewNode(a_op, d15, m4)); |
508 // (O0 + S2) -> [p1, 2, O0, NULL] | 553 CheckBaseWithIndexAndDisplacement(&match22, p1, 2, NULL, d15); |
509 ScaledWithOffset64Matcher match24(graph()->NewNode(a_op, o0, s2)); | 554 |
510 CheckScaledWithOffsetMatch(&match24, p1, 2, o0, NULL); | 555 // (M4 + D15) -> [p1, 2, NULL, D15] |
511 | 556 m4 = graph()->NewNode(m_op, p1, d4); |
512 // (S2 + O0) -> [p1, 2, O0, NULL] | 557 BaseWithIndexAndDisplacement64Matcher match23( |
513 s2 = graph()->NewNode(s_op, p1, c2); | 558 graph()->NewNode(a_op, m4, d15)); |
514 ScaledWithOffset64Matcher match25(graph()->NewNode(a_op, s2, o0)); | 559 CheckBaseWithIndexAndDisplacement(&match23, p1, 2, NULL, d15); |
515 CheckScaledWithOffsetMatch(&match25, p1, 2, o0, NULL); | 560 |
516 | 561 // (B0 + S2) -> [p1, 2, B0, NULL] |
517 // (C15 + S2) -> [p1, 2, NULL, C15] | 562 BaseWithIndexAndDisplacement64Matcher match24(graph()->NewNode(a_op, b0, s2)); |
518 s2 = graph()->NewNode(s_op, p1, c2); | 563 CheckBaseWithIndexAndDisplacement(&match24, p1, 2, b0, NULL); |
519 ScaledWithOffset64Matcher match26(graph()->NewNode(a_op, c15, s2)); | 564 |
520 CheckScaledWithOffsetMatch(&match26, p1, 2, NULL, c15); | 565 // (S2 + B0) -> [p1, 2, B0, NULL] |
521 | 566 s2 = graph()->NewNode(s_op, p1, d2); |
522 // (S2 + C15) -> [p1, 2, NULL, C15] | 567 BaseWithIndexAndDisplacement64Matcher match25(graph()->NewNode(a_op, s2, b0)); |
523 s2 = graph()->NewNode(s_op, p1, c2); | 568 CheckBaseWithIndexAndDisplacement(&match25, p1, 2, b0, NULL); |
524 ScaledWithOffset64Matcher match27(graph()->NewNode(a_op, s2, c15)); | 569 |
525 CheckScaledWithOffsetMatch(&match27, p1, 2, NULL, c15); | 570 // (D15 + S2) -> [p1, 2, NULL, D15] |
526 | 571 s2 = graph()->NewNode(s_op, p1, d2); |
527 // (O0 + M8) -> [p1, 2, O0, NULL] | 572 BaseWithIndexAndDisplacement64Matcher match26( |
528 ScaledWithOffset64Matcher match28(graph()->NewNode(a_op, o0, m8)); | 573 graph()->NewNode(a_op, d15, s2)); |
529 CheckScaledWithOffsetMatch(&match28, p1, 3, o0, NULL); | 574 CheckBaseWithIndexAndDisplacement(&match26, p1, 2, NULL, d15); |
530 | 575 |
531 // (M8 + O0) -> [p1, 2, O0, NULL] | 576 // (S2 + D15) -> [p1, 2, NULL, D15] |
532 m8 = graph()->NewNode(m_op, p1, c8); | 577 s2 = graph()->NewNode(s_op, p1, d2); |
533 ScaledWithOffset64Matcher match29(graph()->NewNode(a_op, m8, o0)); | 578 BaseWithIndexAndDisplacement64Matcher match27( |
534 CheckScaledWithOffsetMatch(&match29, p1, 3, o0, NULL); | 579 graph()->NewNode(a_op, s2, d15)); |
535 | 580 CheckBaseWithIndexAndDisplacement(&match27, p1, 2, NULL, d15); |
536 // (C15 + M8) -> [p1, 2, NULL, C15] | 581 |
537 m8 = graph()->NewNode(m_op, p1, c8); | 582 // (B0 + M8) -> [p1, 2, B0, NULL] |
538 ScaledWithOffset64Matcher match30(graph()->NewNode(a_op, c15, m8)); | 583 BaseWithIndexAndDisplacement64Matcher match28(graph()->NewNode(a_op, b0, m8)); |
539 CheckScaledWithOffsetMatch(&match30, p1, 3, NULL, c15); | 584 CheckBaseWithIndexAndDisplacement(&match28, p1, 3, b0, NULL); |
540 | 585 |
541 // (M8 + C15) -> [p1, 2, NULL, C15] | 586 // (M8 + B0) -> [p1, 2, B0, NULL] |
542 m8 = graph()->NewNode(m_op, p1, c8); | 587 m8 = graph()->NewNode(m_op, p1, d8); |
543 ScaledWithOffset64Matcher match31(graph()->NewNode(a_op, m8, c15)); | 588 BaseWithIndexAndDisplacement64Matcher match29(graph()->NewNode(a_op, m8, b0)); |
544 CheckScaledWithOffsetMatch(&match31, p1, 3, NULL, c15); | 589 CheckBaseWithIndexAndDisplacement(&match29, p1, 3, b0, NULL); |
545 | 590 |
546 // (O0 + S3) -> [p1, 2, O0, NULL] | 591 // (D15 + M8) -> [p1, 2, NULL, D15] |
547 ScaledWithOffset64Matcher match64(graph()->NewNode(a_op, o0, s3)); | 592 m8 = graph()->NewNode(m_op, p1, d8); |
548 CheckScaledWithOffsetMatch(&match64, p1, 3, o0, NULL); | 593 BaseWithIndexAndDisplacement64Matcher match30( |
549 | 594 graph()->NewNode(a_op, d15, m8)); |
550 // (S3 + O0) -> [p1, 2, O0, NULL] | 595 CheckBaseWithIndexAndDisplacement(&match30, p1, 3, NULL, d15); |
551 s3 = graph()->NewNode(s_op, p1, c3); | 596 |
552 ScaledWithOffset64Matcher match33(graph()->NewNode(a_op, s3, o0)); | 597 // (M8 + D15) -> [p1, 2, NULL, D15] |
553 CheckScaledWithOffsetMatch(&match33, p1, 3, o0, NULL); | 598 m8 = graph()->NewNode(m_op, p1, d8); |
554 | 599 BaseWithIndexAndDisplacement64Matcher match31( |
555 // (C15 + S3) -> [p1, 2, NULL, C15] | 600 graph()->NewNode(a_op, m8, d15)); |
556 s3 = graph()->NewNode(s_op, p1, c3); | 601 CheckBaseWithIndexAndDisplacement(&match31, p1, 3, NULL, d15); |
557 ScaledWithOffset64Matcher match34(graph()->NewNode(a_op, c15, s3)); | 602 |
558 CheckScaledWithOffsetMatch(&match34, p1, 3, NULL, c15); | 603 // (B0 + S3) -> [p1, 2, B0, NULL] |
559 | 604 BaseWithIndexAndDisplacement64Matcher match64(graph()->NewNode(a_op, b0, s3)); |
560 // (S3 + C15) -> [p1, 2, NULL, C15] | 605 CheckBaseWithIndexAndDisplacement(&match64, p1, 3, b0, NULL); |
561 s3 = graph()->NewNode(s_op, p1, c3); | 606 |
562 ScaledWithOffset64Matcher match35(graph()->NewNode(a_op, s3, c15)); | 607 // (S3 + B0) -> [p1, 2, B0, NULL] |
563 CheckScaledWithOffsetMatch(&match35, p1, 3, NULL, c15); | 608 s3 = graph()->NewNode(s_op, p1, d3); |
| 609 BaseWithIndexAndDisplacement64Matcher match33(graph()->NewNode(a_op, s3, b0)); |
| 610 CheckBaseWithIndexAndDisplacement(&match33, p1, 3, b0, NULL); |
| 611 |
| 612 // (D15 + S3) -> [p1, 2, NULL, D15] |
| 613 s3 = graph()->NewNode(s_op, p1, d3); |
| 614 BaseWithIndexAndDisplacement64Matcher match34( |
| 615 graph()->NewNode(a_op, d15, s3)); |
| 616 CheckBaseWithIndexAndDisplacement(&match34, p1, 3, NULL, d15); |
| 617 |
| 618 // (S3 + D15) -> [p1, 2, NULL, D15] |
| 619 s3 = graph()->NewNode(s_op, p1, d3); |
| 620 BaseWithIndexAndDisplacement64Matcher match35( |
| 621 graph()->NewNode(a_op, s3, d15)); |
| 622 CheckBaseWithIndexAndDisplacement(&match35, p1, 3, NULL, d15); |
564 | 623 |
565 // 2 INPUT - NEGATIVE CASES | 624 // 2 INPUT - NEGATIVE CASES |
566 | 625 |
567 // (M3 + O1) -> [O0, 0, M3, NULL] | 626 // (M3 + B1) -> [B0, 0, M3, NULL] |
568 ScaledWithOffset64Matcher match36(graph()->NewNode(a_op, o1, m3)); | 627 BaseWithIndexAndDisplacement64Matcher match36(graph()->NewNode(a_op, b1, m3)); |
569 CheckScaledWithOffsetMatch(&match36, m3, 0, o1, NULL); | 628 CheckBaseWithIndexAndDisplacement(&match36, m3, 0, b1, NULL); |
570 | 629 |
571 // (S4 + O1) -> [O0, 0, S4, NULL] | 630 // (S4 + B1) -> [B0, 0, S4, NULL] |
572 ScaledWithOffset64Matcher match37(graph()->NewNode(a_op, o1, s4)); | 631 BaseWithIndexAndDisplacement64Matcher match37(graph()->NewNode(a_op, b1, s4)); |
573 CheckScaledWithOffsetMatch(&match37, s4, 0, o1, NULL); | 632 CheckBaseWithIndexAndDisplacement(&match37, s4, 0, b1, NULL); |
574 | 633 |
575 // 3 INPUT | 634 // 3 INPUT |
576 | 635 |
577 // (C15 + S3) + O0 -> [p1, 2, o0, c15] | 636 // (D15 + S3) + B0 -> [p1, 2, b0, d15] |
578 s3 = graph()->NewNode(s_op, p1, c3); | 637 s3 = graph()->NewNode(s_op, p1, d3); |
579 ScaledWithOffset64Matcher match38( | 638 BaseWithIndexAndDisplacement64Matcher match38( |
580 graph()->NewNode(a_op, graph()->NewNode(a_op, c15, s3), o0)); | 639 graph()->NewNode(a_op, graph()->NewNode(a_op, d15, s3), b0)); |
581 CheckScaledWithOffsetMatch(&match38, p1, 3, o0, c15); | 640 CheckBaseWithIndexAndDisplacement(&match38, p1, 3, b0, d15); |
582 | 641 |
583 // (O0 + C15) + S3 -> [p1, 2, o0, c15] | 642 // (B0 + D15) + S3 -> [p1, 2, b0, d15] |
584 s3 = graph()->NewNode(s_op, p1, c3); | 643 s3 = graph()->NewNode(s_op, p1, d3); |
585 ScaledWithOffset64Matcher match39( | 644 BaseWithIndexAndDisplacement64Matcher match39( |
586 graph()->NewNode(a_op, graph()->NewNode(a_op, o0, c15), s3)); | 645 graph()->NewNode(a_op, graph()->NewNode(a_op, b0, d15), s3)); |
587 CheckScaledWithOffsetMatch(&match39, p1, 3, o0, c15); | 646 CheckBaseWithIndexAndDisplacement(&match39, p1, 3, b0, d15); |
588 | 647 |
589 // (S3 + O0) + C15 -> [p1, 2, o0, c15] | 648 // (S3 + B0) + D15 -> [p1, 2, b0, d15] |
590 s3 = graph()->NewNode(s_op, p1, c3); | 649 s3 = graph()->NewNode(s_op, p1, d3); |
591 ScaledWithOffset64Matcher match40( | 650 BaseWithIndexAndDisplacement64Matcher match40( |
592 graph()->NewNode(a_op, graph()->NewNode(a_op, s3, o0), c15)); | 651 graph()->NewNode(a_op, graph()->NewNode(a_op, s3, b0), d15)); |
593 CheckScaledWithOffsetMatch(&match40, p1, 3, o0, c15); | 652 CheckBaseWithIndexAndDisplacement(&match40, p1, 3, b0, d15); |
594 | 653 |
595 // C15 + (S3 + O0) -> [p1, 2, o0, c15] | 654 // D15 + (S3 + B0) -> [p1, 2, b0, d15] |
596 s3 = graph()->NewNode(s_op, p1, c3); | 655 s3 = graph()->NewNode(s_op, p1, d3); |
597 ScaledWithOffset64Matcher match41( | 656 BaseWithIndexAndDisplacement64Matcher match41( |
598 graph()->NewNode(a_op, c15, graph()->NewNode(a_op, s3, o0))); | 657 graph()->NewNode(a_op, d15, graph()->NewNode(a_op, s3, b0))); |
599 CheckScaledWithOffsetMatch(&match41, p1, 3, o0, c15); | 658 CheckBaseWithIndexAndDisplacement(&match41, p1, 3, b0, d15); |
600 | 659 |
601 // O0 + (C15 + S3) -> [p1, 2, o0, c15] | 660 // B0 + (D15 + S3) -> [p1, 2, b0, d15] |
602 s3 = graph()->NewNode(s_op, p1, c3); | 661 s3 = graph()->NewNode(s_op, p1, d3); |
603 ScaledWithOffset64Matcher match42( | 662 BaseWithIndexAndDisplacement64Matcher match42( |
604 graph()->NewNode(a_op, o0, graph()->NewNode(a_op, c15, s3))); | 663 graph()->NewNode(a_op, b0, graph()->NewNode(a_op, d15, s3))); |
605 CheckScaledWithOffsetMatch(&match42, p1, 3, o0, c15); | 664 CheckBaseWithIndexAndDisplacement(&match42, p1, 3, b0, d15); |
606 | 665 |
607 // S3 + (O0 + C15) -> [p1, 2, o0, c15] | 666 // S3 + (B0 + D15) -> [p1, 2, b0, d15] |
608 s3 = graph()->NewNode(s_op, p1, c3); | 667 s3 = graph()->NewNode(s_op, p1, d3); |
609 ScaledWithOffset64Matcher match43( | 668 BaseWithIndexAndDisplacement64Matcher match43( |
610 graph()->NewNode(a_op, s3, graph()->NewNode(a_op, o0, c15))); | 669 graph()->NewNode(a_op, s3, graph()->NewNode(a_op, b0, d15))); |
611 CheckScaledWithOffsetMatch(&match43, p1, 3, o0, c15); | 670 CheckBaseWithIndexAndDisplacement(&match43, p1, 3, b0, d15); |
| 671 |
| 672 // 2 INPUT with non-power of 2 scale |
| 673 |
| 674 // (M3 + D15) -> [p1, 1, p1, D15] |
| 675 m3 = graph()->NewNode(m_op, p1, d3); |
| 676 BaseWithIndexAndDisplacement64Matcher match44( |
| 677 graph()->NewNode(a_op, m3, d15)); |
| 678 CheckBaseWithIndexAndDisplacement(&match44, p1, 1, p1, d15); |
| 679 |
| 680 // (M5 + D15) -> [p1, 2, p1, D15] |
| 681 m5 = graph()->NewNode(m_op, p1, d5); |
| 682 BaseWithIndexAndDisplacement64Matcher match45( |
| 683 graph()->NewNode(a_op, m5, d15)); |
| 684 CheckBaseWithIndexAndDisplacement(&match45, p1, 2, p1, d15); |
| 685 |
| 686 // (M9 + D15) -> [p1, 3, p1, D15] |
| 687 m9 = graph()->NewNode(m_op, p1, d9); |
| 688 BaseWithIndexAndDisplacement64Matcher match46( |
| 689 graph()->NewNode(a_op, m9, d15)); |
| 690 CheckBaseWithIndexAndDisplacement(&match46, p1, 3, p1, d15); |
| 691 |
| 692 // 3 INPUT negative cases: non-power of 2 scale but with a base |
| 693 |
| 694 // ((M3 + B0) + D15) -> [m3, 0, b0, D15] |
| 695 m3 = graph()->NewNode(m_op, p1, d3); |
| 696 Node* temp = graph()->NewNode(a_op, m3, b0); |
| 697 BaseWithIndexAndDisplacement64Matcher match47( |
| 698 graph()->NewNode(a_op, temp, d15)); |
| 699 CheckBaseWithIndexAndDisplacement(&match47, m3, 0, b0, d15); |
| 700 |
| 701 // (M3 + (B0 + D15)) -> [m3, 0, b0, D15] |
| 702 m3 = graph()->NewNode(m_op, p1, d3); |
| 703 temp = graph()->NewNode(a_op, d15, b0); |
| 704 BaseWithIndexAndDisplacement64Matcher match48( |
| 705 graph()->NewNode(a_op, m3, temp)); |
| 706 CheckBaseWithIndexAndDisplacement(&match48, m3, 0, b0, d15); |
| 707 |
| 708 // ((B0 + M3) + D15) -> [m3, 0, b0, D15] |
| 709 m3 = graph()->NewNode(m_op, p1, d3); |
| 710 temp = graph()->NewNode(a_op, b0, m3); |
| 711 BaseWithIndexAndDisplacement64Matcher match49( |
| 712 graph()->NewNode(a_op, temp, d15)); |
| 713 CheckBaseWithIndexAndDisplacement(&match49, m3, 0, b0, d15); |
| 714 |
| 715 // (M3 + (D15 + B0)) -> [m3, 0, b0, D15] |
| 716 m3 = graph()->NewNode(m_op, p1, d3); |
| 717 temp = graph()->NewNode(a_op, b0, d15); |
| 718 BaseWithIndexAndDisplacement64Matcher match50( |
| 719 graph()->NewNode(a_op, m3, temp)); |
| 720 CheckBaseWithIndexAndDisplacement(&match50, m3, 0, b0, d15); |
612 } | 721 } |
613 | 722 |
614 | 723 |
615 } // namespace compiler | 724 } // namespace compiler |
616 } // namespace internal | 725 } // namespace internal |
617 } // namespace v8 | 726 } // namespace v8 |
OLD | NEW |