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 1341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1352 Label exit; | 1352 Label exit; |
1353 // arguments in xmm0, xmm1 and xmm2 | 1353 // arguments in xmm0, xmm1 and xmm2 |
1354 __ movl(rax, Immediate(0)); | 1354 __ movl(rax, Immediate(0)); |
1355 | 1355 |
1356 __ vmaxsd(xmm4, xmm0, xmm1); | 1356 __ vmaxsd(xmm4, xmm0, xmm1); |
1357 __ subq(rsp, Immediate(kDoubleSize * 2)); // For memory operand | 1357 __ subq(rsp, Immediate(kDoubleSize * 2)); // For memory operand |
1358 __ vmovsd(Operand(rsp, kDoubleSize), xmm4); | 1358 __ vmovsd(Operand(rsp, kDoubleSize), xmm4); |
1359 __ vmovsd(xmm5, Operand(rsp, kDoubleSize)); | 1359 __ vmovsd(xmm5, Operand(rsp, kDoubleSize)); |
1360 __ vmovsd(xmm6, xmm5); | 1360 __ vmovsd(xmm6, xmm5); |
1361 __ vmovapd(xmm3, xmm6); | 1361 __ vmovapd(xmm3, xmm6); |
| 1362 |
| 1363 __ movl(rdx, Immediate(6)); |
| 1364 __ vcvtlsi2sd(xmm6, xmm6, rdx); |
| 1365 __ movl(Operand(rsp, 0), Immediate(5)); |
| 1366 __ vcvtlsi2sd(xmm7, xmm7, Operand(rsp, 0)); |
| 1367 __ vsubsd(xmm7, xmm6, xmm7); // xmm7 is 1.0 |
| 1368 __ vmulsd(xmm1, xmm1, xmm7); |
1362 __ addq(rsp, Immediate(kDoubleSize * 2)); | 1369 __ addq(rsp, Immediate(kDoubleSize * 2)); |
1363 | 1370 |
1364 __ vucomisd(xmm3, xmm1); | 1371 __ vucomisd(xmm3, xmm1); |
1365 __ j(parity_even, &exit); | 1372 __ j(parity_even, &exit); |
1366 __ j(not_equal, &exit); | 1373 __ j(not_equal, &exit); |
1367 __ movl(rax, Immediate(1)); | 1374 __ movl(rax, Immediate(1)); |
1368 | 1375 |
1369 __ vminsd(xmm3, xmm1, xmm2); | 1376 __ vminsd(xmm3, xmm1, xmm2); |
1370 __ vucomisd(xmm3, xmm1); | 1377 __ vucomisd(xmm3, xmm1); |
1371 __ j(parity_even, &exit); | 1378 __ j(parity_even, &exit); |
(...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2076 | 2083 |
2077 F1 f = FUNCTION_CAST<F1>(code->entry()); | 2084 F1 f = FUNCTION_CAST<F1>(code->entry()); |
2078 for (int i = 0; i < kNumCases; ++i) { | 2085 for (int i = 0; i < kNumCases; ++i) { |
2079 int res = f(i); | 2086 int res = f(i); |
2080 PrintF("f(%d) = %d\n", i, res); | 2087 PrintF("f(%d) = %d\n", i, res); |
2081 CHECK_EQ(values[i], res); | 2088 CHECK_EQ(values[i], res); |
2082 } | 2089 } |
2083 } | 2090 } |
2084 | 2091 |
2085 #undef __ | 2092 #undef __ |
OLD | NEW |