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

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

Issue 1420653005: [x64] Implemennt vroundsd AVX instruction. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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 | « src/x64/macro-assembler-x64.cc ('k') | test/cctest/test-disasm-x64.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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 1466 matching lines...) Expand 10 before | Expand all | Expand 10 after
1477 __ vmovsd(Operand(rsp, 0), xmm5); 1477 __ vmovsd(Operand(rsp, 0), xmm5);
1478 __ vsqrtsd(xmm6, xmm5, xmm5); 1478 __ vsqrtsd(xmm6, xmm5, xmm5);
1479 __ vmovq(rcx, xmm6); 1479 __ vmovq(rcx, xmm6);
1480 __ cmpq(rcx, rdx); 1480 __ cmpq(rcx, rdx);
1481 __ j(not_equal, &exit); 1481 __ j(not_equal, &exit);
1482 __ vsqrtsd(xmm7, xmm7, Operand(rsp, 0)); 1482 __ vsqrtsd(xmm7, xmm7, Operand(rsp, 0));
1483 __ vmovq(rcx, xmm7); 1483 __ vmovq(rcx, xmm7);
1484 __ cmpq(rcx, rdx); 1484 __ cmpq(rcx, rdx);
1485 __ j(not_equal, &exit); 1485 __ j(not_equal, &exit);
1486 1486
1487 // Test vroundsd
1488 __ movl(rax, Immediate(16));
1489 __ movq(rdx, V8_UINT64_C(0x4002000000000000)); // 2.25
1490 __ vmovq(xmm4, rdx);
1491 __ vroundsd(xmm5, xmm4, xmm4, kRoundUp);
1492 __ movq(rcx, V8_UINT64_C(0x4008000000000000)); // 3.0
1493 __ vmovq(xmm6, rcx);
1494 __ vucomisd(xmm5, xmm6);
1495 __ j(not_equal, &exit);
1496
1487 __ movl(rdx, Immediate(6)); 1497 __ movl(rdx, Immediate(6));
1488 __ vcvtlsi2sd(xmm6, xmm6, rdx); 1498 __ vcvtlsi2sd(xmm6, xmm6, rdx);
1489 __ movl(Operand(rsp, 0), Immediate(5)); 1499 __ movl(Operand(rsp, 0), Immediate(5));
1490 __ vcvtlsi2sd(xmm7, xmm7, Operand(rsp, 0)); 1500 __ vcvtlsi2sd(xmm7, xmm7, Operand(rsp, 0));
1491 __ vsubsd(xmm7, xmm6, xmm7); // xmm7 is 1.0 1501 __ vsubsd(xmm7, xmm6, xmm7); // xmm7 is 1.0
1492 __ vmulsd(xmm1, xmm1, xmm7); 1502 __ vmulsd(xmm1, xmm1, xmm7);
1493 1503
1494 __ movq(rdx, V8_INT64_C(0x3ff0000000000000)); // 1.0 1504 __ movq(rdx, V8_INT64_C(0x3ff0000000000000)); // 1.0
1495 __ vmovq(xmm7, rdx); 1505 __ vmovq(xmm7, rdx);
1496 __ vmulsd(xmm1, xmm1, xmm7); 1506 __ vmulsd(xmm1, xmm1, xmm7);
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after
2214 2224
2215 F1 f = FUNCTION_CAST<F1>(code->entry()); 2225 F1 f = FUNCTION_CAST<F1>(code->entry());
2216 for (int i = 0; i < kNumCases; ++i) { 2226 for (int i = 0; i < kNumCases; ++i) {
2217 int res = f(i); 2227 int res = f(i);
2218 PrintF("f(%d) = %d\n", i, res); 2228 PrintF("f(%d) = %d\n", i, res);
2219 CHECK_EQ(values[i], res); 2229 CHECK_EQ(values[i], res);
2220 } 2230 }
2221 } 2231 }
2222 2232
2223 #undef __ 2233 #undef __
OLDNEW
« no previous file with comments | « src/x64/macro-assembler-x64.cc ('k') | test/cctest/test-disasm-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698