OLD | NEW |
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 1451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1462 __ j(not_equal, &exit); | 1462 __ j(not_equal, &exit); |
1463 __ vorpd(xmm6, xmm4, xmm5); | 1463 __ vorpd(xmm6, xmm4, xmm5); |
1464 __ movd(rdx, xmm6); | 1464 __ movd(rdx, xmm6); |
1465 __ cmpl(rdx, Immediate(0x0fff0fff)); | 1465 __ cmpl(rdx, Immediate(0x0fff0fff)); |
1466 __ j(not_equal, &exit); | 1466 __ j(not_equal, &exit); |
1467 __ vxorpd(xmm6, xmm4, xmm5); | 1467 __ vxorpd(xmm6, xmm4, xmm5); |
1468 __ movd(rdx, xmm6); | 1468 __ movd(rdx, xmm6); |
1469 __ cmpl(rdx, Immediate(0x0ff00ff0)); | 1469 __ cmpl(rdx, Immediate(0x0ff00ff0)); |
1470 __ j(not_equal, &exit); | 1470 __ j(not_equal, &exit); |
1471 | 1471 |
| 1472 // Test vsqrtsd |
| 1473 __ movl(rax, Immediate(15)); |
| 1474 __ movq(rdx, V8_UINT64_C(0x4004000000000000)); // 2.5 |
| 1475 __ vmovq(xmm4, rdx); |
| 1476 __ vmulsd(xmm5, xmm4, xmm4); |
| 1477 __ vmovsd(Operand(rsp, 0), xmm5); |
| 1478 __ vsqrtsd(xmm6, xmm5, xmm5); |
| 1479 __ vmovq(rcx, xmm6); |
| 1480 __ cmpq(rcx, rdx); |
| 1481 __ j(not_equal, &exit); |
| 1482 __ vsqrtsd(xmm7, xmm7, Operand(rsp, 0)); |
| 1483 __ vmovq(rcx, xmm7); |
| 1484 __ cmpq(rcx, rdx); |
| 1485 __ j(not_equal, &exit); |
| 1486 |
1472 __ movl(rdx, Immediate(6)); | 1487 __ movl(rdx, Immediate(6)); |
1473 __ vcvtlsi2sd(xmm6, xmm6, rdx); | 1488 __ vcvtlsi2sd(xmm6, xmm6, rdx); |
1474 __ movl(Operand(rsp, 0), Immediate(5)); | 1489 __ movl(Operand(rsp, 0), Immediate(5)); |
1475 __ vcvtlsi2sd(xmm7, xmm7, Operand(rsp, 0)); | 1490 __ vcvtlsi2sd(xmm7, xmm7, Operand(rsp, 0)); |
1476 __ vsubsd(xmm7, xmm6, xmm7); // xmm7 is 1.0 | 1491 __ vsubsd(xmm7, xmm6, xmm7); // xmm7 is 1.0 |
1477 __ vmulsd(xmm1, xmm1, xmm7); | 1492 __ vmulsd(xmm1, xmm1, xmm7); |
1478 | 1493 |
1479 __ movq(rdx, V8_INT64_C(0x3ff0000000000000)); // 1.0 | 1494 __ movq(rdx, V8_INT64_C(0x3ff0000000000000)); // 1.0 |
1480 __ vmovq(xmm7, rdx); | 1495 __ vmovq(xmm7, rdx); |
1481 __ vmulsd(xmm1, xmm1, xmm7); | 1496 __ vmulsd(xmm1, xmm1, xmm7); |
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2199 | 2214 |
2200 F1 f = FUNCTION_CAST<F1>(code->entry()); | 2215 F1 f = FUNCTION_CAST<F1>(code->entry()); |
2201 for (int i = 0; i < kNumCases; ++i) { | 2216 for (int i = 0; i < kNumCases; ++i) { |
2202 int res = f(i); | 2217 int res = f(i); |
2203 PrintF("f(%d) = %d\n", i, res); | 2218 PrintF("f(%d) = %d\n", i, res); |
2204 CHECK_EQ(values[i], res); | 2219 CHECK_EQ(values[i], res); |
2205 } | 2220 } |
2206 } | 2221 } |
2207 | 2222 |
2208 #undef __ | 2223 #undef __ |
OLD | NEW |