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

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

Issue 2773303002: [ARM] Implement widening and narrowing integer moves, vmovl, vqmovn. (Closed)
Patch Set: Add some disassembler tests for vmovl. Created 3 years, 8 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 1263 matching lines...) Expand 10 before | Expand all | Expand 10 after
1274 uint32_t dst4; 1274 uint32_t dst4;
1275 uint32_t dst5; 1275 uint32_t dst5;
1276 uint32_t dst6; 1276 uint32_t dst6;
1277 uint32_t dst7; 1277 uint32_t dst7;
1278 uint32_t srcA0; 1278 uint32_t srcA0;
1279 uint32_t srcA1; 1279 uint32_t srcA1;
1280 uint32_t dstA0; 1280 uint32_t dstA0;
1281 uint32_t dstA1; 1281 uint32_t dstA1;
1282 uint32_t dstA2; 1282 uint32_t dstA2;
1283 uint32_t dstA3; 1283 uint32_t dstA3;
1284 uint32_t dstA4;
1285 uint32_t dstA5;
1286 uint32_t dstA6;
1287 uint32_t dstA7;
1288 uint32_t lane_test[4]; 1284 uint32_t lane_test[4];
1289 uint64_t vmov_to_scalar1, vmov_to_scalar2; 1285 uint64_t vmov_to_scalar1, vmov_to_scalar2;
1290 uint32_t vmov_from_scalar_s8, vmov_from_scalar_u8; 1286 uint32_t vmov_from_scalar_s8, vmov_from_scalar_u8;
1291 uint32_t vmov_from_scalar_s16, vmov_from_scalar_u16; 1287 uint32_t vmov_from_scalar_s16, vmov_from_scalar_u16;
1292 uint32_t vmov_from_scalar_32; 1288 uint32_t vmov_from_scalar_32;
1293 uint32_t vmov[4], vmvn[4]; 1289 uint32_t vmov[4], vmvn[4];
1290 uint32_t vmovl_s8[4], vmovl_u16[4], vmovl_s32[4];
1291 uint32_t vqmovn_s8[2], vqmovn_u16[2], vqmovn_s32[2];
1294 int32_t vcvt_s32_f32[4]; 1292 int32_t vcvt_s32_f32[4];
1295 uint32_t vcvt_u32_f32[4]; 1293 uint32_t vcvt_u32_f32[4];
1296 float vcvt_f32_s32[4], vcvt_f32_u32[4]; 1294 float vcvt_f32_s32[4], vcvt_f32_u32[4];
1297 uint32_t vdup8[4], vdup16[4], vdup32[4]; 1295 uint32_t vdup8[4], vdup16[4], vdup32[4];
1298 float vabsf[4], vnegf[4]; 1296 float vabsf[4], vnegf[4];
1299 uint32_t vabs_s8[4], vabs_s16[4], vabs_s32[4]; 1297 uint32_t vabs_s8[4], vabs_s16[4], vabs_s32[4];
1300 uint32_t vneg_s8[4], vneg_s16[4], vneg_s32[4]; 1298 uint32_t vneg_s8[4], vneg_s16[4], vneg_s32[4];
1301 uint32_t veor[4], vand[4], vorr[4]; 1299 uint32_t veor[4], vand[4], vorr[4];
1302 float vdupf[4], vaddf[4], vsubf[4], vmulf[4]; 1300 float vdupf[4], vaddf[4], vsubf[4], vmulf[4];
1303 uint32_t vmin_s8[4], vmin_u16[4], vmin_s32[4]; 1301 uint32_t vmin_s8[4], vmin_u16[4], vmin_s32[4];
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
1347 // Expand 8 bytes into 8 words(16 bits). 1345 // Expand 8 bytes into 8 words(16 bits).
1348 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, srcA0)))); 1346 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, srcA0))));
1349 __ vld1(Neon8, NeonListOperand(d0), NeonMemOperand(r4)); 1347 __ vld1(Neon8, NeonListOperand(d0), NeonMemOperand(r4));
1350 __ vmovl(NeonU8, q0, d0); 1348 __ vmovl(NeonU8, q0, d0);
1351 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, dstA0)))); 1349 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, dstA0))));
1352 __ vst1(Neon8, NeonListOperand(d0, 2), NeonMemOperand(r4)); 1350 __ vst1(Neon8, NeonListOperand(d0, 2), NeonMemOperand(r4));
1353 1351
1354 // The same expansion, but with different source and destination registers. 1352 // The same expansion, but with different source and destination registers.
1355 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, srcA0)))); 1353 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, srcA0))));
1356 __ vld1(Neon8, NeonListOperand(d1), NeonMemOperand(r4)); 1354 __ vld1(Neon8, NeonListOperand(d1), NeonMemOperand(r4));
1357 __ vmovl(NeonU8, q1, d1); 1355 __ vmovl(NeonS8, q1, d1);
1358 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, dstA4)))); 1356 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vmovl_s8))));
1359 __ vst1(Neon8, NeonListOperand(d2, 2), NeonMemOperand(r4)); 1357 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4));
1358 __ vmovl(NeonU16, q2, d3);
1359 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vmovl_u16))));
1360 __ vst1(Neon8, NeonListOperand(q2), NeonMemOperand(r4));
1361 __ vmovl(NeonS32, q3, d4);
1362 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vmovl_s32))));
1363 __ vst1(Neon8, NeonListOperand(q3), NeonMemOperand(r4));
1364 // Narrow what we widened.
1365 __ vqmovn(NeonU16, d0, q2);
1366 __ vstr(d0, r0, offsetof(T, vqmovn_u16));
1367 __ vmov(d1, d0);
1368 __ vqmovn(NeonS8, d2, q0);
1369 __ vstr(d2, r0, offsetof(T, vqmovn_s8));
1370 __ vqmovn(NeonS32, d4, q3);
1371 __ vstr(d4, r0, offsetof(T, vqmovn_s32));
1360 1372
1361 // ARM core register to scalar. 1373 // ARM core register to scalar.
1362 __ mov(r4, Operand(0xfffffff8)); 1374 __ mov(r4, Operand(0xfffffff8));
1363 __ vmov(d0, 0); 1375 __ vmov(d0, 0);
1364 __ vmov(NeonS8, d0, 1, r4); 1376 __ vmov(NeonS8, d0, 1, r4);
1365 __ vmov(NeonS16, d0, 1, r4); 1377 __ vmov(NeonS16, d0, 1, r4);
1366 __ vmov(NeonS32, d0, 1, r4); 1378 __ vmov(NeonS32, d0, 1, r4);
1367 __ vstr(d0, r0, offsetof(T, vmov_to_scalar1)); 1379 __ vstr(d0, r0, offsetof(T, vmov_to_scalar1));
1368 __ vmov(d0, 0); 1380 __ vmov(d0, 0);
1369 __ vmov(NeonS8, d0, 3, r4); 1381 __ vmov(NeonS8, d0, 3, r4);
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after
1980 t.dst4 = 0; 1992 t.dst4 = 0;
1981 t.dst5 = 0; 1993 t.dst5 = 0;
1982 t.dst6 = 0; 1994 t.dst6 = 0;
1983 t.dst7 = 0; 1995 t.dst7 = 0;
1984 t.srcA0 = 0x41424344; 1996 t.srcA0 = 0x41424344;
1985 t.srcA1 = 0x81828384; 1997 t.srcA1 = 0x81828384;
1986 t.dstA0 = 0; 1998 t.dstA0 = 0;
1987 t.dstA1 = 0; 1999 t.dstA1 = 0;
1988 t.dstA2 = 0; 2000 t.dstA2 = 0;
1989 t.dstA3 = 0; 2001 t.dstA3 = 0;
1990 t.dstA4 = 0;
1991 t.dstA5 = 0;
1992 t.dstA6 = 0;
1993 t.dstA7 = 0;
1994 t.lane_test[0] = 0x03020100; 2002 t.lane_test[0] = 0x03020100;
1995 t.lane_test[1] = 0x07060504; 2003 t.lane_test[1] = 0x07060504;
1996 t.lane_test[2] = 0x0b0a0908; 2004 t.lane_test[2] = 0x0b0a0908;
1997 t.lane_test[3] = 0x0f0e0d0c; 2005 t.lane_test[3] = 0x0f0e0d0c;
1998 Object* dummy = CALL_GENERATED_CODE(isolate, f, &t, 0, 0, 0, 0); 2006 Object* dummy = CALL_GENERATED_CODE(isolate, f, &t, 0, 0, 0, 0);
1999 USE(dummy); 2007 USE(dummy);
2000 2008
2001 CHECK_EQ(0x01020304u, t.dst0); 2009 CHECK_EQ(0x01020304u, t.dst0);
2002 CHECK_EQ(0x11121314u, t.dst1); 2010 CHECK_EQ(0x11121314u, t.dst1);
2003 CHECK_EQ(0x21222324u, t.dst2); 2011 CHECK_EQ(0x21222324u, t.dst2);
2004 CHECK_EQ(0x31323334u, t.dst3); 2012 CHECK_EQ(0x31323334u, t.dst3);
2005 CHECK_EQ(0x41424344u, t.dst4); 2013 CHECK_EQ(0x41424344u, t.dst4);
2006 CHECK_EQ(0x51525354u, t.dst5); 2014 CHECK_EQ(0x51525354u, t.dst5);
2007 CHECK_EQ(0x61626364u, t.dst6); 2015 CHECK_EQ(0x61626364u, t.dst6);
2008 CHECK_EQ(0x71727374u, t.dst7); 2016 CHECK_EQ(0x71727374u, t.dst7);
2009 CHECK_EQ(0x00430044u, t.dstA0); 2017 CHECK_EQ(0x00430044u, t.dstA0);
2010 CHECK_EQ(0x00410042u, t.dstA1); 2018 CHECK_EQ(0x00410042u, t.dstA1);
2011 CHECK_EQ(0x00830084u, t.dstA2); 2019 CHECK_EQ(0x00830084u, t.dstA2);
2012 CHECK_EQ(0x00810082u, t.dstA3); 2020 CHECK_EQ(0x00810082u, t.dstA3);
2013 CHECK_EQ(0x00430044u, t.dstA4); 2021
2014 CHECK_EQ(0x00410042u, t.dstA5); 2022 CHECK_EQ_32X4(vmovl_s8, 0x00430044u, 0x00410042u, 0xff83ff84u, 0xff81ff82u);
2015 CHECK_EQ(0x00830084u, t.dstA6); 2023 CHECK_EQ_32X4(vmovl_u16, 0xff84u, 0xff83u, 0xff82u, 0xff81u);
2016 CHECK_EQ(0x00810082u, t.dstA7); 2024 CHECK_EQ_32X4(vmovl_s32, 0xff84u, 0x0u, 0xff83u, 0x0u);
2025 CHECK_EQ_32X2(vqmovn_u16, 0xff83ff84u, 0xff81ff82u);
2026 CHECK_EQ_32X2(vqmovn_s8, 0x81828384u, 0x81828384u);
2027 CHECK_EQ_32X2(vqmovn_s32, 0xff84u, 0xff83u);
2017 2028
2018 CHECK_EQ(0xfffffff8fff8f800u, t.vmov_to_scalar1); 2029 CHECK_EQ(0xfffffff8fff8f800u, t.vmov_to_scalar1);
2019 CHECK_EQ(0xfff80000f8000000u, t.vmov_to_scalar2); 2030 CHECK_EQ(0xfff80000f8000000u, t.vmov_to_scalar2);
2020 CHECK_EQ(0xFFFFFFFFu, t.vmov_from_scalar_s8); 2031 CHECK_EQ(0xFFFFFFFFu, t.vmov_from_scalar_s8);
2021 CHECK_EQ(0xFFu, t.vmov_from_scalar_u8); 2032 CHECK_EQ(0xFFu, t.vmov_from_scalar_u8);
2022 CHECK_EQ(0xFFFFFFFFu, t.vmov_from_scalar_s16); 2033 CHECK_EQ(0xFFFFFFFFu, t.vmov_from_scalar_s16);
2023 CHECK_EQ(0xFFFFu, t.vmov_from_scalar_u16); 2034 CHECK_EQ(0xFFFFu, t.vmov_from_scalar_u16);
2024 CHECK_EQ(0xFFFFFFFFu, t.vmov_from_scalar_32); 2035 CHECK_EQ(0xFFFFFFFFu, t.vmov_from_scalar_32);
2025 2036
2026 CHECK_EQ_32X4(vmov, 0x03020100u, 0x07060504u, 0x0b0a0908u, 0x0f0e0d0cu); 2037 CHECK_EQ_32X4(vmov, 0x03020100u, 0x07060504u, 0x0b0a0908u, 0x0f0e0d0cu);
(...skipping 1806 matching lines...) Expand 10 before | Expand all | Expand 10 after
3833 HandleScope scope(isolate); 3844 HandleScope scope(isolate);
3834 3845
3835 Assembler assm(isolate, NULL, 0); 3846 Assembler assm(isolate, NULL, 0);
3836 __ mov(r0, Operand(isolate->factory()->infinity_value())); 3847 __ mov(r0, Operand(isolate->factory()->infinity_value()));
3837 __ BlockConstPoolFor(1019); 3848 __ BlockConstPoolFor(1019);
3838 for (int i = 0; i < 1019; ++i) __ nop(); 3849 for (int i = 0; i < 1019; ++i) __ nop();
3839 __ vldr(d0, MemOperand(r0, 0)); 3850 __ vldr(d0, MemOperand(r0, 0));
3840 } 3851 }
3841 3852
3842 #undef __ 3853 #undef __
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698