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

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

Issue 1413013003: [x64] Implement vcvtqsi2sd AVX instruction. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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') | 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 1476 matching lines...) Expand 10 before | Expand all | Expand 10 after
1487 // Test vroundsd 1487 // Test vroundsd
1488 __ movl(rax, Immediate(16)); 1488 __ movl(rax, Immediate(16));
1489 __ movq(rdx, V8_UINT64_C(0x4002000000000000)); // 2.25 1489 __ movq(rdx, V8_UINT64_C(0x4002000000000000)); // 2.25
1490 __ vmovq(xmm4, rdx); 1490 __ vmovq(xmm4, rdx);
1491 __ vroundsd(xmm5, xmm4, xmm4, kRoundUp); 1491 __ vroundsd(xmm5, xmm4, xmm4, kRoundUp);
1492 __ movq(rcx, V8_UINT64_C(0x4008000000000000)); // 3.0 1492 __ movq(rcx, V8_UINT64_C(0x4008000000000000)); // 3.0
1493 __ vmovq(xmm6, rcx); 1493 __ vmovq(xmm6, rcx);
1494 __ vucomisd(xmm5, xmm6); 1494 __ vucomisd(xmm5, xmm6);
1495 __ j(not_equal, &exit); 1495 __ j(not_equal, &exit);
1496 1496
1497 // Test vcvtlsi2sd
1498 __ movl(rax, Immediate(17));
1497 __ movl(rdx, Immediate(6)); 1499 __ movl(rdx, Immediate(6));
1500 __ movq(rcx, V8_UINT64_C(0x4018000000000000)); // 6.0
1501 __ vmovq(xmm5, rcx);
1498 __ vcvtlsi2sd(xmm6, xmm6, rdx); 1502 __ vcvtlsi2sd(xmm6, xmm6, rdx);
1499 __ movl(Operand(rsp, 0), Immediate(5)); 1503 __ vucomisd(xmm5, xmm6);
1504 __ j(not_equal, &exit);
1505 __ movl(Operand(rsp, 0), rdx);
1500 __ vcvtlsi2sd(xmm7, xmm7, Operand(rsp, 0)); 1506 __ vcvtlsi2sd(xmm7, xmm7, Operand(rsp, 0));
1501 __ vsubsd(xmm7, xmm6, xmm7); // xmm7 is 1.0 1507 __ vucomisd(xmm5, xmm6);
1502 __ vmulsd(xmm1, xmm1, xmm7); 1508 __ j(not_equal, &exit);
1509
1510 // Test vcvtqsi2sd
1511 __ movl(rax, Immediate(18));
1512 __ movq(rdx, V8_UINT64_C(0x2000000000000000)); // 2 << 0x3c
1513 __ movq(rcx, V8_UINT64_C(0x43c0000000000000));
1514 __ vmovq(xmm5, rcx);
1515 __ vcvtqsi2sd(xmm6, xmm6, rdx);
1516 __ vucomisd(xmm5, xmm6);
1517 __ j(not_equal, &exit);
1503 1518
1504 __ movq(rdx, V8_INT64_C(0x3ff0000000000000)); // 1.0 1519 __ movq(rdx, V8_INT64_C(0x3ff0000000000000)); // 1.0
1505 __ vmovq(xmm7, rdx); 1520 __ vmovq(xmm7, rdx);
1506 __ vmulsd(xmm1, xmm1, xmm7); 1521 __ vmulsd(xmm1, xmm1, xmm7);
1507 __ movq(Operand(rsp, 0), rdx); 1522 __ movq(Operand(rsp, 0), rdx);
1508 __ vmovq(xmm6, Operand(rsp, 0)); 1523 __ vmovq(xmm6, Operand(rsp, 0));
1509 __ vmulsd(xmm1, xmm1, xmm6); 1524 __ vmulsd(xmm1, xmm1, xmm6);
1510 1525
1511 __ vucomisd(xmm3, xmm1); 1526 __ vucomisd(xmm3, xmm1);
1512 __ j(parity_even, &exit); 1527 __ j(parity_even, &exit);
(...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after
2224 2239
2225 F1 f = FUNCTION_CAST<F1>(code->entry()); 2240 F1 f = FUNCTION_CAST<F1>(code->entry());
2226 for (int i = 0; i < kNumCases; ++i) { 2241 for (int i = 0; i < kNumCases; ++i) {
2227 int res = f(i); 2242 int res = f(i);
2228 PrintF("f(%d) = %d\n", i, res); 2243 PrintF("f(%d) = %d\n", i, res);
2229 CHECK_EQ(values[i], res); 2244 CHECK_EQ(values[i], res);
2230 } 2245 }
2231 } 2246 }
2232 2247
2233 #undef __ 2248 #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