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

Side by Side Diff: test/cctest/compiler/test-run-machops.cc

Issue 1421163005: Implemented the ctz Turbo Fan operator for x64. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixed the comments Created 5 years, 1 month 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/x64/macro-assembler-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. Use of this 1 // Copyright 2014 the V8 project authors. All rights reserved. Use of this
2 // source code is governed by a BSD-style license that can be found in the 2 // source code is governed by a BSD-style license that can be found in the
3 // LICENSE file. 3 // LICENSE file.
4 4
5 // TODO(jochen): Remove this after the setting is turned on globally. 5 // TODO(jochen): Remove this after the setting is turned on globally.
6 #define V8_IMMINENT_DEPRECATION_WARNINGS 6 #define V8_IMMINENT_DEPRECATION_WARNINGS
7 7
8 #include <cmath> 8 #include <cmath>
9 #include <functional> 9 #include <functional>
10 #include <limits> 10 #include <limits>
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 CHECK_EQ(56, m.Call(uint64_t(0x0000000000000089))); 201 CHECK_EQ(56, m.Call(uint64_t(0x0000000000000089)));
202 CHECK_EQ(57, m.Call(uint64_t(0x0000000000000041))); 202 CHECK_EQ(57, m.Call(uint64_t(0x0000000000000041)));
203 CHECK_EQ(58, m.Call(uint64_t(0x0000000000000022))); 203 CHECK_EQ(58, m.Call(uint64_t(0x0000000000000022)));
204 CHECK_EQ(59, m.Call(uint64_t(0x0000000000000013))); 204 CHECK_EQ(59, m.Call(uint64_t(0x0000000000000013)));
205 CHECK_EQ(60, m.Call(uint64_t(0x0000000000000008))); 205 CHECK_EQ(60, m.Call(uint64_t(0x0000000000000008)));
206 CHECK_EQ(61, m.Call(uint64_t(0x0000000000000004))); 206 CHECK_EQ(61, m.Call(uint64_t(0x0000000000000004)));
207 CHECK_EQ(62, m.Call(uint64_t(0x0000000000000002))); 207 CHECK_EQ(62, m.Call(uint64_t(0x0000000000000002)));
208 CHECK_EQ(63, m.Call(uint64_t(0x0000000000000001))); 208 CHECK_EQ(63, m.Call(uint64_t(0x0000000000000001)));
209 CHECK_EQ(64, m.Call(uint64_t(0x0000000000000000))); 209 CHECK_EQ(64, m.Call(uint64_t(0x0000000000000000)));
210 } 210 }
211
212
213 TEST(RunWord64Ctz) {
214 RawMachineAssemblerTester<int32_t> m(kMachUint64);
215 if (!m.machine()->Word64Ctz().IsSupported()) {
216 return;
217 }
218
219 m.Return(m.AddNode(m.machine()->Word64Ctz().op(), m.Parameter(0)));
220
221 CHECK_EQ(64, m.Call(uint64_t(0x0000000000000000)));
222 CHECK_EQ(63, m.Call(uint64_t(0x8000000000000000)));
223 CHECK_EQ(62, m.Call(uint64_t(0x4000000000000000)));
224 CHECK_EQ(61, m.Call(uint64_t(0x2000000000000000)));
225 CHECK_EQ(60, m.Call(uint64_t(0x1000000000000000)));
226 CHECK_EQ(59, m.Call(uint64_t(0xa800000000000000)));
227 CHECK_EQ(58, m.Call(uint64_t(0xf400000000000000)));
228 CHECK_EQ(57, m.Call(uint64_t(0x6200000000000000)));
229 CHECK_EQ(56, m.Call(uint64_t(0x9100000000000000)));
230 CHECK_EQ(55, m.Call(uint64_t(0xcd80000000000000)));
231 CHECK_EQ(54, m.Call(uint64_t(0x0940000000000000)));
232 CHECK_EQ(53, m.Call(uint64_t(0xaf20000000000000)));
233 CHECK_EQ(52, m.Call(uint64_t(0xac10000000000000)));
234 CHECK_EQ(51, m.Call(uint64_t(0xe0b8000000000000)));
235 CHECK_EQ(50, m.Call(uint64_t(0x9ce4000000000000)));
236 CHECK_EQ(49, m.Call(uint64_t(0xc792000000000000)));
237 CHECK_EQ(48, m.Call(uint64_t(0xb8f1000000000000)));
238 CHECK_EQ(47, m.Call(uint64_t(0x3b9f800000000000)));
239 CHECK_EQ(46, m.Call(uint64_t(0xdb4c400000000000)));
240 CHECK_EQ(45, m.Call(uint64_t(0xe9a3200000000000)));
241 CHECK_EQ(44, m.Call(uint64_t(0xfca6100000000000)));
242 CHECK_EQ(43, m.Call(uint64_t(0x6c8a780000000000)));
243 CHECK_EQ(42, m.Call(uint64_t(0x8ce5a40000000000)));
244 CHECK_EQ(41, m.Call(uint64_t(0xcb7d020000000000)));
245 CHECK_EQ(40, m.Call(uint64_t(0xcb4dc10000000000)));
246 CHECK_EQ(39, m.Call(uint64_t(0xdfbec58000000000)));
247 CHECK_EQ(38, m.Call(uint64_t(0x27a9db4000000000)));
248 CHECK_EQ(37, m.Call(uint64_t(0xde3bcb2000000000)));
249 CHECK_EQ(36, m.Call(uint64_t(0xd7e8a61000000000)));
250 CHECK_EQ(35, m.Call(uint64_t(0x9afdbc8800000000)));
251 CHECK_EQ(34, m.Call(uint64_t(0x9afdbc8400000000)));
252 CHECK_EQ(33, m.Call(uint64_t(0x9afdbc8200000000)));
253 CHECK_EQ(32, m.Call(uint64_t(0x9afdbc8100000000)));
254 CHECK_EQ(31, m.Call(uint64_t(0x0000000080000000)));
255 CHECK_EQ(30, m.Call(uint64_t(0x0000000040000000)));
256 CHECK_EQ(29, m.Call(uint64_t(0x0000000020000000)));
257 CHECK_EQ(28, m.Call(uint64_t(0x0000000010000000)));
258 CHECK_EQ(27, m.Call(uint64_t(0x00000000a8000000)));
259 CHECK_EQ(26, m.Call(uint64_t(0x00000000f4000000)));
260 CHECK_EQ(25, m.Call(uint64_t(0x0000000062000000)));
261 CHECK_EQ(24, m.Call(uint64_t(0x0000000091000000)));
262 CHECK_EQ(23, m.Call(uint64_t(0x00000000cd800000)));
263 CHECK_EQ(22, m.Call(uint64_t(0x0000000009400000)));
264 CHECK_EQ(21, m.Call(uint64_t(0x00000000af200000)));
265 CHECK_EQ(20, m.Call(uint64_t(0x00000000ac100000)));
266 CHECK_EQ(19, m.Call(uint64_t(0x00000000e0b80000)));
267 CHECK_EQ(18, m.Call(uint64_t(0x000000009ce40000)));
268 CHECK_EQ(17, m.Call(uint64_t(0x00000000c7920000)));
269 CHECK_EQ(16, m.Call(uint64_t(0x00000000b8f10000)));
270 CHECK_EQ(15, m.Call(uint64_t(0x000000003b9f8000)));
271 CHECK_EQ(14, m.Call(uint64_t(0x00000000db4c4000)));
272 CHECK_EQ(13, m.Call(uint64_t(0x00000000e9a32000)));
273 CHECK_EQ(12, m.Call(uint64_t(0x00000000fca61000)));
274 CHECK_EQ(11, m.Call(uint64_t(0x000000006c8a7800)));
275 CHECK_EQ(10, m.Call(uint64_t(0x000000008ce5a400)));
276 CHECK_EQ(9, m.Call(uint64_t(0x00000000cb7d0200)));
277 CHECK_EQ(8, m.Call(uint64_t(0x00000000cb4dc100)));
278 CHECK_EQ(7, m.Call(uint64_t(0x00000000dfbec580)));
279 CHECK_EQ(6, m.Call(uint64_t(0x0000000027a9db40)));
280 CHECK_EQ(5, m.Call(uint64_t(0x00000000de3bcb20)));
281 CHECK_EQ(4, m.Call(uint64_t(0x00000000d7e8a610)));
282 CHECK_EQ(3, m.Call(uint64_t(0x000000009afdbc88)));
283 CHECK_EQ(2, m.Call(uint64_t(0x000000009afdbc84)));
284 CHECK_EQ(1, m.Call(uint64_t(0x000000009afdbc82)));
285 CHECK_EQ(0, m.Call(uint64_t(0x000000009afdbc81)));
286 }
211 #endif // V8_TARGET_ARCH_64_BIT 287 #endif // V8_TARGET_ARCH_64_BIT
212 288
213 289
214 static Node* Int32Input(RawMachineAssemblerTester<int32_t>* m, int index) { 290 static Node* Int32Input(RawMachineAssemblerTester<int32_t>* m, int index) {
215 switch (index) { 291 switch (index) {
216 case 0: 292 case 0:
217 return m->Parameter(0); 293 return m->Parameter(0);
218 case 1: 294 case 1:
219 return m->Parameter(1); 295 return m->Parameter(1);
220 case 2: 296 case 2:
(...skipping 5136 matching lines...) Expand 10 before | Expand all | Expand 10 after
5357 Node* call = r.AddNode(r.common()->Call(desc), phi); 5433 Node* call = r.AddNode(r.common()->Call(desc), phi);
5358 r.Return(call); 5434 r.Return(call);
5359 5435
5360 CHECK_EQ(33, r.Call(1)); 5436 CHECK_EQ(33, r.Call(1));
5361 CHECK_EQ(44, r.Call(0)); 5437 CHECK_EQ(44, r.Call(0));
5362 } 5438 }
5363 5439
5364 } // namespace compiler 5440 } // namespace compiler
5365 } // namespace internal 5441 } // namespace internal
5366 } // namespace v8 5442 } // namespace v8
OLDNEW
« no previous file with comments | « src/x64/macro-assembler-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698