Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 1237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1248 uint32_t srcA0; | 1248 uint32_t srcA0; |
| 1249 uint32_t srcA1; | 1249 uint32_t srcA1; |
| 1250 uint32_t dstA0; | 1250 uint32_t dstA0; |
| 1251 uint32_t dstA1; | 1251 uint32_t dstA1; |
| 1252 uint32_t dstA2; | 1252 uint32_t dstA2; |
| 1253 uint32_t dstA3; | 1253 uint32_t dstA3; |
| 1254 uint32_t dstA4; | 1254 uint32_t dstA4; |
| 1255 uint32_t dstA5; | 1255 uint32_t dstA5; |
| 1256 uint32_t dstA6; | 1256 uint32_t dstA6; |
| 1257 uint32_t dstA7; | 1257 uint32_t dstA7; |
| 1258 uint32_t vmov_src[4], vmov_dst[4]; | 1258 uint64_t vmov_to_scalar1, vmov_to_scalar2; |
| 1259 uint32_t veor_src[4], veor_dst[4]; | 1259 uint32_t vmov_from_scalar_s8, vmov_from_scalar_u8; |
| 1260 uint32_t vmov_from_scalar_s16, vmov_from_scalar_u16; | |
| 1261 uint32_t vmov_from_scalar_32; | |
| 1262 uint32_t vmov_src[4], vmov_dst[4], vmvn[4]; | |
| 1263 int32_t vcvt_s32_f32[4]; | |
| 1264 uint32_t vcvt_u32_f32[4]; | |
| 1265 float vcvt_f32_s32[4], vcvt_f32_u32[4]; | |
| 1266 uint32_t vdup1[4], vdup2[4], vdup3[4], vdup4[4]; | |
| 1267 uint32_t veor[4]; | |
| 1268 uint32_t vadd8[4], vadd16[4], vadd32[4]; | |
| 1269 uint32_t vsub8[4], vsub16[4], vsub32[4]; | |
| 1270 uint32_t vtst[4], vceq[4], vbsl[4], vtbl[2], vtbx[2]; | |
| 1271 float vaddf[4], vsubf[4]; | |
| 1260 } T; | 1272 } T; |
| 1261 T t; | 1273 T t; |
| 1262 | 1274 |
| 1263 // Create a function that accepts &t, and loads, manipulates, and stores | 1275 // Create a function that accepts &t, and loads, manipulates, and stores |
| 1264 // the doubles and floats. | 1276 // the doubles and floats. |
| 1265 Assembler assm(isolate, NULL, 0); | 1277 Assembler assm(isolate, NULL, 0); |
| 1266 | 1278 |
| 1267 | 1279 |
| 1268 if (CpuFeatures::IsSupported(NEON)) { | 1280 if (CpuFeatures::IsSupported(NEON)) { |
| 1269 CpuFeatureScope scope(&assm, NEON); | 1281 CpuFeatureScope scope(&assm, NEON); |
| 1270 | 1282 |
| 1271 __ stm(db_w, sp, r4.bit() | lr.bit()); | 1283 __ stm(db_w, sp, r4.bit() | r5.bit() | lr.bit()); |
| 1272 // Move 32 bytes with neon. | 1284 // Move 32 bytes with neon. |
| 1273 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, src0)))); | 1285 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, src0)))); |
| 1274 __ vld1(Neon8, NeonListOperand(d0, 4), NeonMemOperand(r4)); | 1286 __ vld1(Neon8, NeonListOperand(d0, 4), NeonMemOperand(r4)); |
| 1275 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, dst0)))); | 1287 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, dst0)))); |
| 1276 __ vst1(Neon8, NeonListOperand(d0, 4), NeonMemOperand(r4)); | 1288 __ vst1(Neon8, NeonListOperand(d0, 4), NeonMemOperand(r4)); |
| 1277 | 1289 |
| 1278 // Expand 8 bytes into 8 words(16 bits). | 1290 // Expand 8 bytes into 8 words(16 bits). |
| 1279 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, srcA0)))); | 1291 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, srcA0)))); |
| 1280 __ vld1(Neon8, NeonListOperand(d0), NeonMemOperand(r4)); | 1292 __ vld1(Neon8, NeonListOperand(d0), NeonMemOperand(r4)); |
| 1281 __ vmovl(NeonU8, q0, d0); | 1293 __ vmovl(NeonU8, q0, d0); |
| 1282 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, dstA0)))); | 1294 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, dstA0)))); |
| 1283 __ vst1(Neon8, NeonListOperand(d0, 2), NeonMemOperand(r4)); | 1295 __ vst1(Neon8, NeonListOperand(d0, 2), NeonMemOperand(r4)); |
| 1284 | 1296 |
| 1285 // The same expansion, but with different source and destination registers. | 1297 // The same expansion, but with different source and destination registers. |
| 1286 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, srcA0)))); | 1298 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, srcA0)))); |
| 1287 __ vld1(Neon8, NeonListOperand(d1), NeonMemOperand(r4)); | 1299 __ vld1(Neon8, NeonListOperand(d1), NeonMemOperand(r4)); |
| 1288 __ vmovl(NeonU8, q1, d1); | 1300 __ vmovl(NeonU8, q1, d1); |
| 1289 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, dstA4)))); | 1301 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, dstA4)))); |
| 1290 __ vst1(Neon8, NeonListOperand(d2, 2), NeonMemOperand(r4)); | 1302 __ vst1(Neon8, NeonListOperand(d2, 2), NeonMemOperand(r4)); |
| 1291 | 1303 |
| 1292 // Test vmov for q-registers. | 1304 // ARM core register to scalar. |
| 1305 __ mov(r4, Operand(0xFFFFFFF8)); | |
| 1306 __ vmov(d0, 0); | |
| 1307 __ vmov(NeonS8, d0, 1, r4); | |
| 1308 __ vmov(NeonS16, d0, 1, r4); | |
| 1309 __ vmov(NeonS32, d0, 1, r4); | |
| 1310 __ vstr(d0, r0, offsetof(T, vmov_to_scalar1)); | |
| 1311 __ vmov(d0, 0); | |
| 1312 __ vmov(NeonS8, d0, 3, r4); | |
| 1313 __ vmov(NeonS16, d0, 3, r4); | |
| 1314 __ vstr(d0, r0, offsetof(T, vmov_to_scalar2)); | |
| 1315 | |
| 1316 // Scalar to ARM core register. | |
| 1317 __ mov(r4, Operand(0xFFFFFF00)); | |
| 1318 __ mov(r5, Operand(0xFFFFFFFF)); | |
| 1319 __ vmov(d0, r4, r5); | |
| 1320 __ vmov(NeonS8, r4, d0, 1); | |
| 1321 __ str(r4, MemOperand(r0, offsetof(T, vmov_from_scalar_s8))); | |
| 1322 __ vmov(NeonU8, r4, d0, 1); | |
| 1323 __ str(r4, MemOperand(r0, offsetof(T, vmov_from_scalar_u8))); | |
| 1324 __ vmov(NeonS16, r4, d0, 1); | |
| 1325 __ str(r4, MemOperand(r0, offsetof(T, vmov_from_scalar_s16))); | |
| 1326 __ vmov(NeonU16, r4, d0, 1); | |
| 1327 __ str(r4, MemOperand(r0, offsetof(T, vmov_from_scalar_u16))); | |
| 1328 __ vmov(NeonS32, r4, d0, 1); | |
| 1329 __ str(r4, MemOperand(r0, offsetof(T, vmov_from_scalar_32))); | |
| 1330 | |
| 1331 // vmov for q-registers. | |
| 1293 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vmov_src)))); | 1332 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vmov_src)))); |
| 1294 __ vld1(Neon8, NeonListOperand(d0, 2), NeonMemOperand(r4)); | 1333 __ vld1(Neon8, NeonListOperand(q0), NeonMemOperand(r4)); |
| 1295 __ vmov(q1, q0); | 1334 __ vmov(q1, q0); |
| 1296 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vmov_dst)))); | 1335 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vmov_dst)))); |
| 1297 __ vst1(Neon8, NeonListOperand(d2, 2), NeonMemOperand(r4)); | 1336 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); |
| 1298 | 1337 |
| 1299 // Test veor for q-registers. | 1338 // vmvn. |
| 1300 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, veor_src)))); | 1339 __ mov(r4, Operand(0xFF)); |
| 1301 __ vld1(Neon8, NeonListOperand(d0, 2), NeonMemOperand(r4)); | 1340 __ vdup(Neon16, q0, r4); |
| 1302 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, veor_dst)))); | 1341 __ vmvn(q1, q0); |
| 1303 __ vld1(Neon8, NeonListOperand(d2, 2), NeonMemOperand(r4)); | 1342 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vmvn)))); |
| 1343 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); | |
| 1344 | |
| 1345 // vcvt for q-registers. | |
| 1346 __ vmov(s0, -1.5); | |
| 1347 __ vmov(s1, -1); | |
| 1348 __ vmov(s2, 1); | |
| 1349 __ vmov(s3, 1.5); | |
| 1350 __ vcvt_s32_f32(q1, q0); | |
| 1351 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vcvt_s32_f32)))); | |
| 1352 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); | |
| 1353 __ vcvt_u32_f32(q1, q0); | |
| 1354 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vcvt_u32_f32)))); | |
| 1355 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); | |
| 1356 __ mov(r4, Operand(-1)); | |
| 1357 __ mov(r5, Operand(1)); | |
| 1358 __ vmov(d0, r4, r5); | |
| 1359 __ vmov(d1, d0); // q0 = [-1, 1, -1, 1] | |
|
Rodolph Perfetta (ARM)
2016/12/14 12:06:31
Could you add test with large integer to test the
bbudge
2016/12/14 19:14:48
Done.
| |
| 1360 __ vcvt_f32_s32(q1, q0); | |
| 1361 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vcvt_f32_s32)))); | |
| 1362 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); | |
| 1363 __ vcvt_f32_u32(q1, q0); | |
| 1364 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vcvt_f32_u32)))); | |
| 1365 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); | |
| 1366 | |
| 1367 // int vdup. | |
| 1368 __ mov(r4, Operand(0xa)); | |
| 1369 __ vdup(Neon8, q0, r4); | |
| 1370 __ vdup(Neon16, q1, r4); | |
| 1371 __ vdup(Neon32, q2, r4); | |
| 1372 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vdup1)))); | |
| 1373 __ vst1(Neon8, NeonListOperand(q0), NeonMemOperand(r4)); | |
| 1374 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vdup2)))); | |
| 1375 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); | |
| 1376 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vdup3)))); | |
| 1377 __ vst1(Neon8, NeonListOperand(q2), NeonMemOperand(r4)); | |
| 1378 // float vdup. | |
| 1379 __ vmov(s0, -1.0); | |
| 1380 __ vdup(q0, s0); | |
| 1381 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vdup4)))); | |
| 1382 __ vst1(Neon8, NeonListOperand(q0), NeonMemOperand(r4)); | |
| 1383 | |
| 1384 // veor. | |
| 1385 __ mov(r4, Operand(0x00aa)); | |
| 1386 __ vdup(Neon16, q0, r4); | |
| 1387 __ mov(r4, Operand(0x0055)); | |
| 1388 __ vdup(Neon16, q1, r4); | |
| 1304 __ veor(q1, q1, q0); | 1389 __ veor(q1, q1, q0); |
| 1305 __ vst1(Neon8, NeonListOperand(d2, 2), NeonMemOperand(r4)); | 1390 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, veor)))); |
| 1391 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); | |
| 1392 | |
| 1393 // vadd(integer). | |
| 1394 __ mov(r4, Operand(0x81)); | |
| 1395 __ vdup(Neon8, q0, r4); | |
| 1396 __ mov(r4, Operand(0x82)); | |
| 1397 __ vdup(Neon8, q1, r4); | |
| 1398 __ vadd(Neon8, q1, q1, q0); | |
| 1399 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vadd8)))); | |
| 1400 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); | |
| 1401 __ mov(r4, Operand(0x8001)); | |
| 1402 __ vdup(Neon16, q0, r4); | |
| 1403 __ mov(r4, Operand(0x8002)); | |
| 1404 __ vdup(Neon16, q1, r4); | |
| 1405 __ vadd(Neon16, q1, q1, q0); | |
| 1406 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vadd16)))); | |
| 1407 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); | |
| 1408 __ mov(r4, Operand(0x80000001)); | |
| 1409 __ vdup(Neon32, q0, r4); | |
| 1410 __ mov(r4, Operand(0x80000002)); | |
| 1411 __ vdup(Neon32, q1, r4); | |
| 1412 __ vadd(Neon32, q1, q1, q0); | |
| 1413 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vadd32)))); | |
| 1414 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); | |
| 1415 | |
| 1416 // vadd(float). | |
| 1417 __ vmov(s4, 1.0); | |
| 1418 __ vdup(q0, s4); | |
| 1419 __ vdup(q1, s4); | |
| 1420 __ vadd(q1, q1, q0); | |
| 1421 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vaddf)))); | |
| 1422 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); | |
| 1423 | |
| 1424 // vsub(integer). | |
| 1425 __ mov(r4, Operand(0x01)); | |
| 1426 __ vdup(Neon8, q0, r4); | |
| 1427 __ mov(r4, Operand(0x02)); | |
| 1428 __ vdup(Neon8, q1, r4); | |
| 1429 __ vsub(Neon8, q1, q0, q1); | |
| 1430 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vsub8)))); | |
| 1431 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); | |
| 1432 __ mov(r4, Operand(0x0001)); | |
| 1433 __ vdup(Neon16, q0, r4); | |
| 1434 __ mov(r4, Operand(0x0002)); | |
| 1435 __ vdup(Neon16, q1, r4); | |
| 1436 __ vsub(Neon16, q1, q0, q1); | |
| 1437 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vsub16)))); | |
| 1438 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); | |
| 1439 __ mov(r4, Operand(0x00000001)); | |
| 1440 __ vdup(Neon32, q0, r4); | |
| 1441 __ mov(r4, Operand(0x00000002)); | |
| 1442 __ vdup(Neon32, q1, r4); | |
| 1443 __ vsub(Neon32, q1, q0, q1); | |
| 1444 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vsub32)))); | |
| 1445 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); | |
| 1446 | |
| 1447 // vsub(float). | |
| 1448 __ vmov(s4, 2.0); | |
| 1449 __ vdup(q0, s4); | |
| 1450 __ vmov(s4, 1.0); | |
| 1451 __ vdup(q1, s4); | |
| 1452 __ vsub(q1, q1, q0); | |
| 1453 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vsubf)))); | |
| 1454 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); | |
| 1455 | |
| 1456 // vceq. | |
| 1457 __ mov(r4, Operand(0x03)); | |
| 1458 __ vdup(Neon8, q0, r4); | |
| 1459 __ mov(r4, Operand(0x03)); | |
| 1460 __ vdup(Neon16, q1, r4); | |
| 1461 __ vceq(Neon8, q1, q0, q1); | |
| 1462 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vceq)))); | |
| 1463 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); | |
| 1464 | |
| 1465 // vtst. | |
| 1466 __ mov(r4, Operand(0x03)); | |
| 1467 __ vdup(Neon8, q0, r4); | |
| 1468 __ mov(r4, Operand(0x02)); | |
| 1469 __ vdup(Neon16, q1, r4); | |
| 1470 __ vtst(Neon8, q1, q0, q1); | |
| 1471 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vtst)))); | |
| 1472 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); | |
| 1473 | |
| 1474 // vbsl. | |
| 1475 __ mov(r4, Operand(0x00ff)); | |
| 1476 __ vdup(Neon16, q0, r4); | |
| 1477 __ mov(r4, Operand(0x01)); | |
| 1478 __ vdup(Neon8, q1, r4); | |
| 1479 __ mov(r4, Operand(0x02)); | |
| 1480 __ vdup(Neon8, q2, r4); | |
| 1481 __ vbsl(q0, q1, q2); | |
| 1482 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vbsl)))); | |
| 1483 __ vst1(Neon8, NeonListOperand(q0), NeonMemOperand(r4)); | |
| 1484 | |
| 1485 // vtb[l/x]. | |
| 1486 __ mov(r4, Operand(0x06040200)); | |
| 1487 __ mov(r5, Operand(0xff050301)); | |
| 1488 __ vmov(d2, r4, r5); // d2 = ff05030106040200 | |
| 1489 __ vtbl(d0, NeonListOperand(d2, 1), d2); | |
| 1490 __ vstr(d0, r0, offsetof(T, vtbl)); | |
| 1491 __ vtbx(d2, NeonListOperand(d2, 1), d2); | |
| 1492 __ vstr(d2, r0, offsetof(T, vtbx)); | |
| 1306 | 1493 |
| 1307 // Restore and return. | 1494 // Restore and return. |
| 1308 __ ldm(ia_w, sp, r4.bit() | pc.bit()); | 1495 __ ldm(ia_w, sp, r4.bit() | r5.bit() | pc.bit()); |
| 1309 | 1496 |
| 1310 CodeDesc desc; | 1497 CodeDesc desc; |
| 1311 assm.GetCode(&desc); | 1498 assm.GetCode(&desc); |
| 1312 Handle<Code> code = isolate->factory()->NewCode( | 1499 Handle<Code> code = isolate->factory()->NewCode( |
| 1313 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 1500 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
| 1314 #ifdef DEBUG | 1501 #ifdef DEBUG |
| 1315 OFStream os(stdout); | 1502 OFStream os(stdout); |
| 1316 code->Print(os); | 1503 code->Print(os); |
| 1317 #endif | 1504 #endif |
| 1318 F3 f = FUNCTION_CAST<F3>(code->entry()); | 1505 F3 f = FUNCTION_CAST<F3>(code->entry()); |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 1337 t.dstA0 = 0; | 1524 t.dstA0 = 0; |
| 1338 t.dstA1 = 0; | 1525 t.dstA1 = 0; |
| 1339 t.dstA2 = 0; | 1526 t.dstA2 = 0; |
| 1340 t.dstA3 = 0; | 1527 t.dstA3 = 0; |
| 1341 t.dstA4 = 0; | 1528 t.dstA4 = 0; |
| 1342 t.dstA5 = 0; | 1529 t.dstA5 = 0; |
| 1343 t.dstA6 = 0; | 1530 t.dstA6 = 0; |
| 1344 t.dstA7 = 0; | 1531 t.dstA7 = 0; |
| 1345 t.vmov_src[0] = t.vmov_src[1] = t.vmov_src[2] = t.vmov_src[3] = 1; | 1532 t.vmov_src[0] = t.vmov_src[1] = t.vmov_src[2] = t.vmov_src[3] = 1; |
| 1346 t.vmov_dst[0] = t.vmov_dst[1] = t.vmov_dst[2] = t.vmov_dst[3] = 0; | 1533 t.vmov_dst[0] = t.vmov_dst[1] = t.vmov_dst[2] = t.vmov_dst[3] = 0; |
| 1347 t.veor_src[0] = t.veor_src[1] = t.veor_src[2] = t.veor_src[3] = 0xAA; | |
| 1348 t.veor_dst[0] = t.veor_dst[1] = t.veor_dst[2] = t.veor_dst[3] = 0x55; | |
| 1349 Object* dummy = CALL_GENERATED_CODE(isolate, f, &t, 0, 0, 0, 0); | 1534 Object* dummy = CALL_GENERATED_CODE(isolate, f, &t, 0, 0, 0, 0); |
| 1350 USE(dummy); | 1535 USE(dummy); |
| 1351 CHECK_EQ(0x01020304u, t.dst0); | 1536 CHECK_EQ(0x01020304u, t.dst0); |
| 1352 CHECK_EQ(0x11121314u, t.dst1); | 1537 CHECK_EQ(0x11121314u, t.dst1); |
| 1353 CHECK_EQ(0x21222324u, t.dst2); | 1538 CHECK_EQ(0x21222324u, t.dst2); |
| 1354 CHECK_EQ(0x31323334u, t.dst3); | 1539 CHECK_EQ(0x31323334u, t.dst3); |
| 1355 CHECK_EQ(0x41424344u, t.dst4); | 1540 CHECK_EQ(0x41424344u, t.dst4); |
| 1356 CHECK_EQ(0x51525354u, t.dst5); | 1541 CHECK_EQ(0x51525354u, t.dst5); |
| 1357 CHECK_EQ(0x61626364u, t.dst6); | 1542 CHECK_EQ(0x61626364u, t.dst6); |
| 1358 CHECK_EQ(0x71727374u, t.dst7); | 1543 CHECK_EQ(0x71727374u, t.dst7); |
| 1359 CHECK_EQ(0x00430044u, t.dstA0); | 1544 CHECK_EQ(0x00430044u, t.dstA0); |
| 1360 CHECK_EQ(0x00410042u, t.dstA1); | 1545 CHECK_EQ(0x00410042u, t.dstA1); |
| 1361 CHECK_EQ(0x00830084u, t.dstA2); | 1546 CHECK_EQ(0x00830084u, t.dstA2); |
| 1362 CHECK_EQ(0x00810082u, t.dstA3); | 1547 CHECK_EQ(0x00810082u, t.dstA3); |
| 1363 CHECK_EQ(0x00430044u, t.dstA4); | 1548 CHECK_EQ(0x00430044u, t.dstA4); |
| 1364 CHECK_EQ(0x00410042u, t.dstA5); | 1549 CHECK_EQ(0x00410042u, t.dstA5); |
| 1365 CHECK_EQ(0x00830084u, t.dstA6); | 1550 CHECK_EQ(0x00830084u, t.dstA6); |
| 1366 CHECK_EQ(0x00810082u, t.dstA7); | 1551 CHECK_EQ(0x00810082u, t.dstA7); |
| 1552 CHECK_EQ(0xfffffff8fff8f800u, t.vmov_to_scalar1); | |
| 1553 CHECK_EQ(0xfff80000f8000000u, t.vmov_to_scalar2); | |
| 1554 CHECK_EQ(0xFFFFFFFFu, t.vmov_from_scalar_s8); | |
| 1555 CHECK_EQ(0xFFu, t.vmov_from_scalar_u8); | |
| 1556 CHECK_EQ(0xFFFFFFFFu, t.vmov_from_scalar_s16); | |
| 1557 CHECK_EQ(0xFFFFu, t.vmov_from_scalar_u16); | |
| 1558 CHECK_EQ(0xFFFFFFFFu, t.vmov_from_scalar_32); | |
| 1367 CHECK_EQ(1u, t.vmov_dst[0]); | 1559 CHECK_EQ(1u, t.vmov_dst[0]); |
| 1368 CHECK_EQ(1u, t.vmov_dst[1]); | 1560 CHECK_EQ(1u, t.vmov_dst[1]); |
| 1369 CHECK_EQ(1u, t.vmov_dst[2]); | 1561 CHECK_EQ(1u, t.vmov_dst[2]); |
| 1370 CHECK_EQ(1u, t.vmov_dst[3]); | 1562 CHECK_EQ(1u, t.vmov_dst[3]); |
| 1371 CHECK_EQ(0xFFu, t.veor_dst[0]); | 1563 CHECK_EQ(-2, t.vcvt_s32_f32[0]); |
|
Rodolph Perfetta (ARM)
2016/12/14 12:06:31
it should return -1
bbudge
2016/12/14 19:14:48
Done.
| |
| 1372 CHECK_EQ(0xFFu, t.veor_dst[1]); | 1564 CHECK_EQ(-1, t.vcvt_s32_f32[1]); |
| 1373 CHECK_EQ(0xFFu, t.veor_dst[2]); | 1565 CHECK_EQ(1, t.vcvt_s32_f32[2]); |
| 1374 CHECK_EQ(0xFFu, t.veor_dst[3]); | 1566 CHECK_EQ(2, t.vcvt_s32_f32[3]); |
|
Rodolph Perfetta (ARM)
2016/12/14 12:06:31
1
bbudge
2016/12/14 19:14:48
Done.
| |
| 1567 CHECK_EQ(0u, t.vcvt_u32_f32[0]); | |
| 1568 CHECK_EQ(0u, t.vcvt_u32_f32[1]); | |
| 1569 CHECK_EQ(1u, t.vcvt_u32_f32[2]); | |
| 1570 CHECK_EQ(2u, t.vcvt_u32_f32[3]); | |
| 1571 CHECK_EQ(-1.f, t.vcvt_f32_s32[0]); | |
| 1572 CHECK_EQ(1.f, t.vcvt_f32_s32[1]); | |
| 1573 CHECK_EQ(-1.f, t.vcvt_f32_s32[2]); | |
| 1574 CHECK_EQ(1.f, t.vcvt_f32_s32[3]); | |
| 1575 CHECK_EQ(static_cast<float>(0xFFFFFFFFu), t.vcvt_f32_u32[0]); | |
| 1576 CHECK_EQ(1.f, t.vcvt_f32_u32[1]); | |
| 1577 CHECK_EQ(static_cast<float>(0xFFFFFFFFu), t.vcvt_f32_u32[2]); | |
| 1578 CHECK_EQ(1.f, t.vcvt_f32_u32[3]); | |
| 1579 for (int i = 0; i < 4; i++) CHECK_EQ(0xFF00FF00, t.vmvn[i]); | |
| 1580 for (int i = 0; i < 4; i++) CHECK_EQ(0x0a0a0a0au, t.vdup1[i]); | |
| 1581 for (int i = 0; i < 4; i++) CHECK_EQ(0x000a000au, t.vdup2[i]); | |
| 1582 for (int i = 0; i < 4; i++) CHECK_EQ(0x0000000au, t.vdup3[i]); | |
| 1583 for (int i = 0; i < 4; i++) CHECK_EQ(0xbf800000u, t.vdup4[i]); // -1.0f | |
| 1584 for (int i = 0; i < 4; i++) CHECK_EQ(0x00ff00ffu, t.veor[i]); | |
| 1585 for (int i = 0; i < 4; i++) CHECK_EQ(2.0, t.vaddf[i]); | |
| 1586 for (int i = 0; i < 4; i++) CHECK_EQ(0x03030303u, t.vadd8[i]); | |
| 1587 for (int i = 0; i < 4; i++) CHECK_EQ(0x00030003u, t.vadd16[i]); | |
| 1588 for (int i = 0; i < 4; i++) CHECK_EQ(0x00000003u, t.vadd32[i]); | |
| 1589 for (int i = 0; i < 4; i++) CHECK_EQ(-1.0, t.vsubf[i]); | |
| 1590 for (int i = 0; i < 4; i++) CHECK_EQ(0xffffffffu, t.vsub8[i]); | |
| 1591 for (int i = 0; i < 4; i++) CHECK_EQ(0xffffffffu, t.vsub16[i]); | |
| 1592 for (int i = 0; i < 4; i++) CHECK_EQ(0xffffffffu, t.vsub32[i]); | |
| 1593 for (int i = 0; i < 4; i++) CHECK_EQ(0x00ff00ffu, t.vceq[i]); | |
| 1594 for (int i = 0; i < 4; i++) CHECK_EQ(0x00ff00ffu, t.vtst[i]); | |
| 1595 for (int i = 0; i < 4; i++) CHECK_EQ(0x02010201u, t.vbsl[i]); | |
| 1596 CHECK_EQ(0x05010400u, t.vtbl[0]); | |
| 1597 CHECK_EQ(0x00030602u, t.vtbl[1]); | |
| 1598 CHECK_EQ(0x05010400u, t.vtbx[0]); | |
| 1599 CHECK_EQ(0xff030602u, t.vtbx[1]); | |
| 1375 } | 1600 } |
| 1376 } | 1601 } |
| 1377 | 1602 |
| 1378 | 1603 |
| 1379 TEST(16) { | 1604 TEST(16) { |
| 1380 // Test the pkh, uxtb, uxtab and uxtb16 instructions. | 1605 // Test the pkh, uxtb, uxtab and uxtb16 instructions. |
| 1381 CcTest::InitializeVM(); | 1606 CcTest::InitializeVM(); |
| 1382 Isolate* isolate = CcTest::i_isolate(); | 1607 Isolate* isolate = CcTest::i_isolate(); |
| 1383 HandleScope scope(isolate); | 1608 HandleScope scope(isolate); |
| 1384 | 1609 |
| (...skipping 1571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2956 const uint32_t test_2 = 0x89abcdef; | 3181 const uint32_t test_2 = 0x89abcdef; |
| 2957 __ mov(r4, Operand(test_1)); | 3182 __ mov(r4, Operand(test_1)); |
| 2958 __ mov(r5, Operand(test_2)); | 3183 __ mov(r5, Operand(test_2)); |
| 2959 // TODO(bbudge) replace with vdup when implemented. | 3184 // TODO(bbudge) replace with vdup when implemented. |
| 2960 __ vmov(d8, r4, r4); | 3185 __ vmov(d8, r4, r4); |
| 2961 __ vmov(d9, r4, r4); // q4 = [1.0, 1.0] | 3186 __ vmov(d9, r4, r4); // q4 = [1.0, 1.0] |
| 2962 __ vmov(d10, r5, r5); | 3187 __ vmov(d10, r5, r5); |
| 2963 __ vmov(d11, r5, r5); // q5 = [-1.0, -1.0] | 3188 __ vmov(d11, r5, r5); // q5 = [-1.0, -1.0] |
| 2964 __ vswp(q4, q5); | 3189 __ vswp(q4, q5); |
| 2965 __ add(r6, r0, Operand(static_cast<int32_t>(offsetof(T, vswp_q4)))); | 3190 __ add(r6, r0, Operand(static_cast<int32_t>(offsetof(T, vswp_q4)))); |
| 2966 __ vst1(Neon8, NeonListOperand(d8, 2), NeonMemOperand(r6)); | 3191 __ vst1(Neon8, NeonListOperand(q4), NeonMemOperand(r6)); |
| 2967 __ add(r6, r0, Operand(static_cast<int32_t>(offsetof(T, vswp_q5)))); | 3192 __ add(r6, r0, Operand(static_cast<int32_t>(offsetof(T, vswp_q5)))); |
| 2968 __ vst1(Neon8, NeonListOperand(d10, 2), NeonMemOperand(r6)); | 3193 __ vst1(Neon8, NeonListOperand(q5), NeonMemOperand(r6)); |
| 2969 | 3194 |
| 2970 __ ldm(ia_w, sp, r4.bit() | r5.bit() | r6.bit() | r7.bit() | pc.bit()); | 3195 __ ldm(ia_w, sp, r4.bit() | r5.bit() | r6.bit() | r7.bit() | pc.bit()); |
| 2971 __ bx(lr); | 3196 __ bx(lr); |
| 2972 | 3197 |
| 2973 CodeDesc desc; | 3198 CodeDesc desc; |
| 2974 assm.GetCode(&desc); | 3199 assm.GetCode(&desc); |
| 2975 Handle<Code> code = isolate->factory()->NewCode( | 3200 Handle<Code> code = isolate->factory()->NewCode( |
| 2976 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 3201 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
| 2977 #ifdef DEBUG | 3202 #ifdef DEBUG |
| 2978 OFStream os(stdout); | 3203 OFStream os(stdout); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3048 HandleScope scope(isolate); | 3273 HandleScope scope(isolate); |
| 3049 | 3274 |
| 3050 Assembler assm(isolate, NULL, 0); | 3275 Assembler assm(isolate, NULL, 0); |
| 3051 __ mov(r0, Operand(isolate->factory()->infinity_value())); | 3276 __ mov(r0, Operand(isolate->factory()->infinity_value())); |
| 3052 __ BlockConstPoolFor(1019); | 3277 __ BlockConstPoolFor(1019); |
| 3053 for (int i = 0; i < 1019; ++i) __ nop(); | 3278 for (int i = 0; i < 1019; ++i) __ nop(); |
| 3054 __ vldr(d0, MemOperand(r0, 0)); | 3279 __ vldr(d0, MemOperand(r0, 0)); |
| 3055 } | 3280 } |
| 3056 | 3281 |
| 3057 #undef __ | 3282 #undef __ |
| OLD | NEW |