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

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

Issue 1416663004: [x64] Replace movaps with appropriate vmov* instructions when AVX is enabled. (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 1266 matching lines...) Expand 10 before | Expand all | Expand 10 after
1277 { 1277 {
1278 CpuFeatureScope avx_scope(&assm, AVX); 1278 CpuFeatureScope avx_scope(&assm, AVX);
1279 Label exit; 1279 Label exit;
1280 // arguments in xmm0, xmm1 and xmm2 1280 // arguments in xmm0, xmm1 and xmm2
1281 __ subq(rsp, Immediate(kDoubleSize * 2)); // For memory operand 1281 __ subq(rsp, Immediate(kDoubleSize * 2)); // For memory operand
1282 1282
1283 __ movl(rdx, Immediate(0xc2f64000)); // -123.125 1283 __ movl(rdx, Immediate(0xc2f64000)); // -123.125
1284 __ vmovd(xmm4, rdx); 1284 __ vmovd(xmm4, rdx);
1285 __ vmovss(Operand(rsp, 0), xmm4); 1285 __ vmovss(Operand(rsp, 0), xmm4);
1286 __ vmovss(xmm5, Operand(rsp, 0)); 1286 __ vmovss(xmm5, Operand(rsp, 0));
1287 __ vmovd(rcx, xmm5); 1287 __ vmovaps(xmm6, xmm5);
1288 __ vmovd(rcx, xmm6);
1288 __ cmpl(rcx, rdx); 1289 __ cmpl(rcx, rdx);
1289 __ movl(rax, Immediate(9)); 1290 __ movl(rax, Immediate(9));
1290 __ j(not_equal, &exit); 1291 __ j(not_equal, &exit);
1291 1292
1292 __ movl(rax, Immediate(0)); 1293 __ movl(rax, Immediate(0));
1293 __ vmaxss(xmm3, xmm0, xmm1); 1294 __ vmaxss(xmm3, xmm0, xmm1);
1294 __ vucomiss(xmm3, xmm1); 1295 __ vucomiss(xmm3, xmm1);
1295 __ j(parity_even, &exit); 1296 __ j(parity_even, &exit);
1296 __ j(not_equal, &exit); 1297 __ j(not_equal, &exit);
1297 __ movl(rax, Immediate(1)); 1298 __ movl(rax, Immediate(1));
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
1361 { 1362 {
1362 CpuFeatureScope avx_scope(&assm, AVX); 1363 CpuFeatureScope avx_scope(&assm, AVX);
1363 Label exit; 1364 Label exit;
1364 // arguments in xmm0, xmm1 and xmm2 1365 // arguments in xmm0, xmm1 and xmm2
1365 __ subq(rsp, Immediate(kDoubleSize * 2)); // For memory operand 1366 __ subq(rsp, Immediate(kDoubleSize * 2)); // For memory operand
1366 __ movl(rax, Immediate(0)); 1367 __ movl(rax, Immediate(0));
1367 1368
1368 __ vmaxsd(xmm4, xmm0, xmm1); 1369 __ vmaxsd(xmm4, xmm0, xmm1);
1369 __ vmovsd(Operand(rsp, kDoubleSize), xmm4); 1370 __ vmovsd(Operand(rsp, kDoubleSize), xmm4);
1370 __ vmovsd(xmm5, Operand(rsp, kDoubleSize)); 1371 __ vmovsd(xmm5, Operand(rsp, kDoubleSize));
1371 __ vmovsd(xmm6, xmm5); 1372 __ vmovsd(xmm6, xmm6, xmm5);
1372 __ vmovapd(xmm3, xmm6); 1373 __ vmovapd(xmm3, xmm6);
1373 1374
1374 // Test vcvtss2sd & vcvtsd2ss 1375 // Test vcvtss2sd & vcvtsd2ss
1375 __ movl(rax, Immediate(9)); 1376 __ movl(rax, Immediate(9));
1376 __ movq(rdx, V8_INT64_C(0x426D1A0000000000)); 1377 __ movq(rdx, V8_INT64_C(0x426D1A0000000000));
1377 __ movq(Operand(rsp, 0), rdx); 1378 __ movq(Operand(rsp, 0), rdx);
1378 __ vcvtsd2ss(xmm6, xmm6, Operand(rsp, 0)); 1379 __ vcvtsd2ss(xmm6, xmm6, Operand(rsp, 0));
1379 __ vcvtss2sd(xmm7, xmm6, xmm6); 1380 __ vcvtss2sd(xmm7, xmm6, xmm6);
1380 __ vcvtsd2ss(xmm8, xmm7, xmm7); 1381 __ vcvtsd2ss(xmm8, xmm7, xmm7);
1381 __ vmovss(Operand(rsp, 0), xmm8); 1382 __ vmovss(Operand(rsp, 0), xmm8);
(...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after
2152 2153
2153 F1 f = FUNCTION_CAST<F1>(code->entry()); 2154 F1 f = FUNCTION_CAST<F1>(code->entry());
2154 for (int i = 0; i < kNumCases; ++i) { 2155 for (int i = 0; i < kNumCases; ++i) {
2155 int res = f(i); 2156 int res = f(i);
2156 PrintF("f(%d) = %d\n", i, res); 2157 PrintF("f(%d) = %d\n", i, res);
2157 CHECK_EQ(values[i], res); 2158 CHECK_EQ(values[i], res);
2158 } 2159 }
2159 } 2160 }
2160 2161
2161 #undef __ 2162 #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