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

Side by Side Diff: test/cctest/test-disasm-x64.cc

Issue 133443009: A64: Synchronize with r17441. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « test/cctest/test-disasm-ia32.cc ('k') | test/cctest/test-heap.cc » ('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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 __ fmul(3); 328 __ fmul(3);
329 __ fdiv(3); 329 __ fdiv(3);
330 330
331 __ faddp(3); 331 __ faddp(3);
332 __ fsubp(3); 332 __ fsubp(3);
333 __ fmulp(3); 333 __ fmulp(3);
334 __ fdivp(3); 334 __ fdivp(3);
335 __ fcompp(); 335 __ fcompp();
336 __ fwait(); 336 __ fwait();
337 __ nop(); 337 __ nop();
338
339 // SSE instruction
338 { 340 {
339 if (CpuFeatures::IsSupported(SSE2)) { 341 __ cvttss2si(rdx, Operand(rbx, rcx, times_4, 10000));
340 CpuFeatures::Scope fscope(SSE2); 342 __ cvttss2si(rdx, xmm1);
341 __ cvttss2si(rdx, Operand(rbx, rcx, times_4, 10000)); 343 __ movaps(xmm0, xmm1);
342 __ cvttss2si(rdx, xmm1);
343 __ cvttsd2si(rdx, Operand(rbx, rcx, times_4, 10000));
344 __ cvttsd2si(rdx, xmm1);
345 __ cvttsd2siq(rdx, xmm1);
346 __ addsd(xmm1, xmm0);
347 __ mulsd(xmm1, xmm0);
348 __ subsd(xmm1, xmm0);
349 __ divsd(xmm1, xmm0);
350 __ movsd(xmm1, Operand(rbx, rcx, times_4, 10000));
351 __ movsd(Operand(rbx, rcx, times_4, 10000), xmm1);
352 __ ucomisd(xmm0, xmm1);
353 344
354 // 128 bit move instructions. 345 __ andps(xmm0, xmm1);
355 __ movdqa(xmm0, Operand(rbx, rcx, times_4, 10000)); 346 }
356 __ movdqa(Operand(rbx, rcx, times_4, 10000), xmm0); 347 // SSE 2 instructions
357 } 348 {
349 __ cvttsd2si(rdx, Operand(rbx, rcx, times_4, 10000));
350 __ cvttsd2si(rdx, xmm1);
351 __ cvttsd2siq(rdx, xmm1);
352 __ movsd(xmm1, Operand(rbx, rcx, times_4, 10000));
353 __ movsd(Operand(rbx, rcx, times_4, 10000), xmm1);
354 // 128 bit move instructions.
355 __ movdqa(xmm0, Operand(rbx, rcx, times_4, 10000));
356 __ movdqa(Operand(rbx, rcx, times_4, 10000), xmm0);
357
358 __ addsd(xmm1, xmm0);
359 __ mulsd(xmm1, xmm0);
360 __ subsd(xmm1, xmm0);
361 __ divsd(xmm1, xmm0);
362 __ ucomisd(xmm0, xmm1);
363
364 __ andpd(xmm0, xmm1);
358 } 365 }
359 366
360 // cmov. 367 // cmov.
361 { 368 {
362 if (CpuFeatures::IsSupported(CMOV)) { 369 __ cmovq(overflow, rax, Operand(rax, 0));
363 CpuFeatures::Scope use_cmov(CMOV); 370 __ cmovq(no_overflow, rax, Operand(rax, 1));
364 __ cmovq(overflow, rax, Operand(rax, 0)); 371 __ cmovq(below, rax, Operand(rax, 2));
365 __ cmovq(no_overflow, rax, Operand(rax, 1)); 372 __ cmovq(above_equal, rax, Operand(rax, 3));
366 __ cmovq(below, rax, Operand(rax, 2)); 373 __ cmovq(equal, rax, Operand(rbx, 0));
367 __ cmovq(above_equal, rax, Operand(rax, 3)); 374 __ cmovq(not_equal, rax, Operand(rbx, 1));
368 __ cmovq(equal, rax, Operand(rbx, 0)); 375 __ cmovq(below_equal, rax, Operand(rbx, 2));
369 __ cmovq(not_equal, rax, Operand(rbx, 1)); 376 __ cmovq(above, rax, Operand(rbx, 3));
370 __ cmovq(below_equal, rax, Operand(rbx, 2)); 377 __ cmovq(sign, rax, Operand(rcx, 0));
371 __ cmovq(above, rax, Operand(rbx, 3)); 378 __ cmovq(not_sign, rax, Operand(rcx, 1));
372 __ cmovq(sign, rax, Operand(rcx, 0)); 379 __ cmovq(parity_even, rax, Operand(rcx, 2));
373 __ cmovq(not_sign, rax, Operand(rcx, 1)); 380 __ cmovq(parity_odd, rax, Operand(rcx, 3));
374 __ cmovq(parity_even, rax, Operand(rcx, 2)); 381 __ cmovq(less, rax, Operand(rdx, 0));
375 __ cmovq(parity_odd, rax, Operand(rcx, 3)); 382 __ cmovq(greater_equal, rax, Operand(rdx, 1));
376 __ cmovq(less, rax, Operand(rdx, 0)); 383 __ cmovq(less_equal, rax, Operand(rdx, 2));
377 __ cmovq(greater_equal, rax, Operand(rdx, 1)); 384 __ cmovq(greater, rax, Operand(rdx, 3));
378 __ cmovq(less_equal, rax, Operand(rdx, 2)); 385 }
379 __ cmovq(greater, rax, Operand(rdx, 3)); 386
387 {
388 if (CpuFeatures::IsSupported(SSE4_1)) {
389 CpuFeatureScope scope(&assm, SSE4_1);
390 __ extractps(rax, xmm1, 0);
380 } 391 }
381 } 392 }
382 393
383 // andpd, etc.
384 {
385 if (CpuFeatures::IsSupported(SSE2)) {
386 CpuFeatures::Scope fscope(SSE2);
387 __ andpd(xmm0, xmm1);
388 __ andpd(xmm1, xmm2);
389
390 __ movaps(xmm0, xmm1);
391 __ movaps(xmm1, xmm2);
392 }
393 }
394
395 // Nop instructions 394 // Nop instructions
396 for (int i = 0; i < 16; i++) { 395 for (int i = 0; i < 16; i++) {
397 __ Nop(i); 396 __ Nop(i);
398 } 397 }
399 398
400 __ ret(0); 399 __ ret(0);
401 400
402 CodeDesc desc; 401 CodeDesc desc;
403 assm.GetCode(&desc); 402 assm.GetCode(&desc);
404 Object* code = CcTest::heap()->CreateCode( 403 Object* code = CcTest::heap()->CreateCode(
405 desc, 404 desc,
406 Code::ComputeFlags(Code::STUB), 405 Code::ComputeFlags(Code::STUB),
407 Handle<Code>())->ToObjectChecked(); 406 Handle<Code>())->ToObjectChecked();
408 CHECK(code->IsCode()); 407 CHECK(code->IsCode());
409 #ifdef OBJECT_PRINT 408 #ifdef OBJECT_PRINT
410 Code::cast(code)->Print(); 409 Code::cast(code)->Print();
411 byte* begin = Code::cast(code)->instruction_start(); 410 byte* begin = Code::cast(code)->instruction_start();
412 byte* end = begin + Code::cast(code)->instruction_size(); 411 byte* end = begin + Code::cast(code)->instruction_size();
413 disasm::Disassembler::Disassemble(stdout, begin, end); 412 disasm::Disassembler::Disassemble(stdout, begin, end);
414 #endif 413 #endif
415 } 414 }
416 415
417 #undef __ 416 #undef __
OLDNEW
« no previous file with comments | « test/cctest/test-disasm-ia32.cc ('k') | test/cctest/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698