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 1335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1346 Isolate* isolate = reinterpret_cast<Isolate*>(CcTest::isolate()); | 1346 Isolate* isolate = reinterpret_cast<Isolate*>(CcTest::isolate()); |
1347 HandleScope scope(isolate); | 1347 HandleScope scope(isolate); |
1348 v8::internal::byte buffer[1024]; | 1348 v8::internal::byte buffer[1024]; |
1349 Assembler assm(isolate, buffer, sizeof(buffer)); | 1349 Assembler assm(isolate, buffer, sizeof(buffer)); |
1350 { | 1350 { |
1351 CpuFeatureScope avx_scope(&assm, AVX); | 1351 CpuFeatureScope avx_scope(&assm, AVX); |
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(xmm3, xmm0, xmm1); | 1356 __ vmaxsd(xmm4, xmm0, xmm1); |
| 1357 __ subq(rsp, Immediate(kDoubleSize * 2)); // For memory operand |
| 1358 __ vmovsd(Operand(rsp, kDoubleSize), xmm4); |
| 1359 __ vmovsd(xmm5, Operand(rsp, kDoubleSize)); |
| 1360 __ vmovsd(xmm6, xmm5); |
| 1361 __ vmovapd(xmm3, xmm6); |
| 1362 __ addq(rsp, Immediate(kDoubleSize * 2)); |
| 1363 |
1357 __ vucomisd(xmm3, xmm1); | 1364 __ vucomisd(xmm3, xmm1); |
1358 __ j(parity_even, &exit); | 1365 __ j(parity_even, &exit); |
1359 __ j(not_equal, &exit); | 1366 __ j(not_equal, &exit); |
1360 __ movl(rax, Immediate(1)); | 1367 __ movl(rax, Immediate(1)); |
1361 | 1368 |
1362 __ vminsd(xmm3, xmm1, xmm2); | 1369 __ vminsd(xmm3, xmm1, xmm2); |
1363 __ vucomisd(xmm3, xmm1); | 1370 __ vucomisd(xmm3, xmm1); |
1364 __ j(parity_even, &exit); | 1371 __ j(parity_even, &exit); |
1365 __ j(not_equal, &exit); | 1372 __ j(not_equal, &exit); |
1366 __ movl(rax, Immediate(2)); | 1373 __ movl(rax, Immediate(2)); |
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2069 | 2076 |
2070 F1 f = FUNCTION_CAST<F1>(code->entry()); | 2077 F1 f = FUNCTION_CAST<F1>(code->entry()); |
2071 for (int i = 0; i < kNumCases; ++i) { | 2078 for (int i = 0; i < kNumCases; ++i) { |
2072 int res = f(i); | 2079 int res = f(i); |
2073 PrintF("f(%d) = %d\n", i, res); | 2080 PrintF("f(%d) = %d\n", i, res); |
2074 CHECK_EQ(values[i], res); | 2081 CHECK_EQ(values[i], res); |
2075 } | 2082 } |
2076 } | 2083 } |
2077 | 2084 |
2078 #undef __ | 2085 #undef __ |
OLD | NEW |