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 uint32_t vmov_src[4], vmov_dst[4], vmvn[4]; |
1259 uint32_t veor_src[4], veor_dst[4]; | 1259 int32_t vcvt_s32_f32[4]; |
1260 uint32_t vcvt_u32_f32[4]; | |
1261 float vcvt_f32_s32[4], vcvt_f32_u32[4]; | |
1262 uint32_t vdup1[4], vdup2[4], vdup3[4], vdup4[4]; | |
1263 uint32_t veor[4], vadd[4], vsub[4]; | |
1264 uint32_t vtst[4], vceq[4], vbsl[4], vtbl[2], vtbx[2]; | |
1265 float vaddf[4], vsubf[4]; | |
1260 } T; | 1266 } T; |
1261 T t; | 1267 T t; |
1262 | 1268 |
1263 // Create a function that accepts &t, and loads, manipulates, and stores | 1269 // Create a function that accepts &t, and loads, manipulates, and stores |
1264 // the doubles and floats. | 1270 // the doubles and floats. |
1265 Assembler assm(isolate, NULL, 0); | 1271 Assembler assm(isolate, NULL, 0); |
1266 | 1272 |
1267 | 1273 |
1268 if (CpuFeatures::IsSupported(NEON)) { | 1274 if (CpuFeatures::IsSupported(NEON)) { |
1269 CpuFeatureScope scope(&assm, NEON); | 1275 CpuFeatureScope scope(&assm, NEON); |
1270 | 1276 |
1271 __ stm(db_w, sp, r4.bit() | lr.bit()); | 1277 __ stm(db_w, sp, r4.bit() | r5.bit() | lr.bit()); |
1272 // Move 32 bytes with neon. | 1278 // Move 32 bytes with neon. |
1273 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, src0)))); | 1279 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, src0)))); |
1274 __ vld1(Neon8, NeonListOperand(d0, 4), NeonMemOperand(r4)); | 1280 __ vld1(Neon8, NeonListOperand(d0, 4), NeonMemOperand(r4)); |
1275 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, dst0)))); | 1281 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, dst0)))); |
1276 __ vst1(Neon8, NeonListOperand(d0, 4), NeonMemOperand(r4)); | 1282 __ vst1(Neon8, NeonListOperand(d0, 4), NeonMemOperand(r4)); |
1277 | 1283 |
1278 // Expand 8 bytes into 8 words(16 bits). | 1284 // Expand 8 bytes into 8 words(16 bits). |
1279 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, srcA0)))); | 1285 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, srcA0)))); |
1280 __ vld1(Neon8, NeonListOperand(d0), NeonMemOperand(r4)); | 1286 __ vld1(Neon8, NeonListOperand(d0), NeonMemOperand(r4)); |
1281 __ vmovl(NeonU8, q0, d0); | 1287 __ vmovl(NeonU8, q0, d0); |
1282 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, dstA0)))); | 1288 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, dstA0)))); |
1283 __ vst1(Neon8, NeonListOperand(d0, 2), NeonMemOperand(r4)); | 1289 __ vst1(Neon8, NeonListOperand(d0, 2), NeonMemOperand(r4)); |
1284 | 1290 |
1285 // The same expansion, but with different source and destination registers. | 1291 // The same expansion, but with different source and destination registers. |
1286 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, srcA0)))); | 1292 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, srcA0)))); |
1287 __ vld1(Neon8, NeonListOperand(d1), NeonMemOperand(r4)); | 1293 __ vld1(Neon8, NeonListOperand(d1), NeonMemOperand(r4)); |
1288 __ vmovl(NeonU8, q1, d1); | 1294 __ vmovl(NeonU8, q1, d1); |
1289 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, dstA4)))); | 1295 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, dstA4)))); |
1290 __ vst1(Neon8, NeonListOperand(d2, 2), NeonMemOperand(r4)); | 1296 __ vst1(Neon8, NeonListOperand(d2, 2), NeonMemOperand(r4)); |
1291 | 1297 |
1292 // Test vmov for q-registers. | 1298 // vmov for q-registers. |
1293 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vmov_src)))); | 1299 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vmov_src)))); |
1294 __ vld1(Neon8, NeonListOperand(d0, 2), NeonMemOperand(r4)); | 1300 __ vld1(Neon8, NeonListOperand(q0), NeonMemOperand(r4)); |
1295 __ vmov(q1, q0); | 1301 __ vmov(q1, q0); |
1296 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vmov_dst)))); | 1302 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vmov_dst)))); |
1297 __ vst1(Neon8, NeonListOperand(d2, 2), NeonMemOperand(r4)); | 1303 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); |
1298 | 1304 |
1299 // Test veor for q-registers. | 1305 // vmvn. |
1300 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, veor_src)))); | 1306 __ mov(r4, Operand(0xFF)); |
1301 __ vld1(Neon8, NeonListOperand(d0, 2), NeonMemOperand(r4)); | 1307 __ vdup(q0, r4, Neon16); |
1302 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, veor_dst)))); | 1308 __ vmvn(q1, q0); |
1303 __ vld1(Neon8, NeonListOperand(d2, 2), NeonMemOperand(r4)); | 1309 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vmvn)))); |
1310 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); | |
1311 | |
1312 // vcvt for q-registers. | |
1313 __ vmov(s0, -1.5); | |
1314 __ vmov(s1, -1); | |
1315 __ vmov(s2, 1); | |
1316 __ vmov(s3, 1.5); | |
1317 __ vcvt_s32_f32(q1, q0); | |
1318 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vcvt_s32_f32)))); | |
1319 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); | |
1320 __ vcvt_u32_f32(q1, q0); | |
1321 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vcvt_u32_f32)))); | |
1322 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); | |
1323 __ mov(r4, Operand(-1)); | |
1324 __ mov(r5, Operand(1)); | |
1325 __ vmov(d0, r4, r5); | |
1326 __ vmov(d1, d0); // q0 = [-1, 1, -1, 1] | |
1327 __ vcvt_f32_s32(q1, q0); | |
1328 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vcvt_f32_s32)))); | |
1329 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); | |
1330 __ vcvt_f32_u32(q1, q0); | |
1331 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vcvt_f32_u32)))); | |
1332 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); | |
1333 | |
1334 // int vdup. | |
1335 __ mov(r4, Operand(0xa)); | |
1336 __ vdup(q0, r4, Neon8); | |
1337 __ vdup(q1, r4, Neon16); | |
1338 __ vdup(q2, r4, Neon32); | |
1339 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vdup1)))); | |
1340 __ vst1(Neon8, NeonListOperand(q0), NeonMemOperand(r4)); | |
1341 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vdup2)))); | |
1342 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); | |
1343 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vdup3)))); | |
1344 __ vst1(Neon8, NeonListOperand(q2), NeonMemOperand(r4)); | |
1345 // float vdup. | |
1346 __ vmov(s0, -1.0); | |
1347 __ vdup(q0, s0); | |
1348 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vdup4)))); | |
1349 __ vst1(Neon8, NeonListOperand(q0), NeonMemOperand(r4)); | |
1350 | |
1351 // veor. | |
1352 __ mov(r4, Operand(0x00aa)); | |
1353 __ vdup(q0, r4, Neon16); | |
1354 __ mov(r4, Operand(0x0055)); | |
1355 __ vdup(q1, r4, Neon16); | |
1304 __ veor(q1, q1, q0); | 1356 __ veor(q1, q1, q0); |
1305 __ vst1(Neon8, NeonListOperand(d2, 2), NeonMemOperand(r4)); | 1357 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, veor)))); |
1358 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); | |
1359 | |
1360 // vadd(integer). | |
1361 __ mov(r4, Operand(0x8001)); | |
1362 __ vdup(q0, r4, Neon16); | |
1363 __ mov(r4, Operand(0x8002)); | |
1364 __ vdup(q1, r4, Neon16); | |
1365 __ vadd(q1, q1, q0, Neon16); | |
1366 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vadd)))); | |
1367 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); | |
1368 | |
1369 // vadd(float). | |
1370 __ vmov(s4, 1.0); | |
1371 __ vdup(q0, s4); | |
1372 __ vdup(q1, s4); | |
1373 __ vadd(q1, q1, q0); | |
1374 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vaddf)))); | |
1375 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); | |
1376 | |
1377 // vsub(integer). | |
Rodolph Perfetta (ARM)
2016/12/08 18:08:28
It would be nice to have test for each NeonSize fo
bbudge
2016/12/10 21:33:04
Done. Here and for similar instructions.
| |
1378 __ mov(r4, Operand(0x0001)); | |
1379 __ vdup(q0, r4, Neon16); | |
1380 __ mov(r4, Operand(0x0002)); | |
1381 __ vdup(q1, r4, Neon16); | |
1382 __ vsub(q1, q0, q1, Neon16); | |
1383 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vsub)))); | |
1384 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); | |
1385 | |
1386 // vsub(float). | |
1387 __ vmov(s4, 2.0); | |
1388 __ vdup(q0, s4); | |
1389 __ vmov(s4, 1.0); | |
1390 __ vdup(q1, s4); | |
1391 __ vsub(q1, q1, q0); | |
1392 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vsubf)))); | |
1393 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); | |
1394 | |
1395 // vceq. | |
1396 __ mov(r4, Operand(0x03)); | |
1397 __ vdup(q0, r4, Neon8); | |
1398 __ mov(r4, Operand(0x03)); | |
1399 __ vdup(q1, r4, Neon16); | |
1400 __ vceq(q1, q0, q1, Neon8); | |
1401 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vceq)))); | |
1402 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); | |
1403 | |
1404 // vtst. | |
1405 __ mov(r4, Operand(0x03)); | |
1406 __ vdup(q0, r4, Neon8); | |
1407 __ mov(r4, Operand(0x02)); | |
1408 __ vdup(q1, r4, Neon16); | |
1409 __ vtst(q1, q0, q1, Neon8); | |
1410 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vtst)))); | |
1411 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); | |
1412 | |
1413 // vbsl. | |
1414 __ mov(r4, Operand(0x00ff)); | |
1415 __ vdup(q0, r4, Neon16); | |
1416 __ mov(r4, Operand(0x01)); | |
1417 __ vdup(q1, r4, Neon8); | |
1418 __ mov(r4, Operand(0x02)); | |
1419 __ vdup(q2, r4, Neon8); | |
1420 __ vbsl(q0, q1, q2); | |
1421 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vbsl)))); | |
1422 __ vst1(Neon8, NeonListOperand(q0), NeonMemOperand(r4)); | |
1423 | |
1424 // vtb[l/x]. | |
1425 __ mov(r4, Operand(0x06040200)); | |
1426 __ mov(r5, Operand(0xff050301)); | |
1427 __ vmov(d2, r4, r5); // d2 = ff05030106040200 | |
1428 __ vtbl(d0, NeonListOperand(d2, 1), d2); | |
1429 __ vstr(d0, r0, offsetof(T, vtbl)); | |
1430 __ vtbx(d2, NeonListOperand(d2, 1), d2); | |
1431 __ vstr(d2, r0, offsetof(T, vtbx)); | |
1306 | 1432 |
1307 // Restore and return. | 1433 // Restore and return. |
1308 __ ldm(ia_w, sp, r4.bit() | pc.bit()); | 1434 __ ldm(ia_w, sp, r4.bit() | r5.bit() | pc.bit()); |
1309 | 1435 |
1310 CodeDesc desc; | 1436 CodeDesc desc; |
1311 assm.GetCode(&desc); | 1437 assm.GetCode(&desc); |
1312 Handle<Code> code = isolate->factory()->NewCode( | 1438 Handle<Code> code = isolate->factory()->NewCode( |
1313 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 1439 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
1314 #ifdef DEBUG | 1440 #ifdef DEBUG |
1315 OFStream os(stdout); | 1441 OFStream os(stdout); |
1316 code->Print(os); | 1442 code->Print(os); |
1317 #endif | 1443 #endif |
1318 F3 f = FUNCTION_CAST<F3>(code->entry()); | 1444 F3 f = FUNCTION_CAST<F3>(code->entry()); |
(...skipping 18 matching lines...) Expand all Loading... | |
1337 t.dstA0 = 0; | 1463 t.dstA0 = 0; |
1338 t.dstA1 = 0; | 1464 t.dstA1 = 0; |
1339 t.dstA2 = 0; | 1465 t.dstA2 = 0; |
1340 t.dstA3 = 0; | 1466 t.dstA3 = 0; |
1341 t.dstA4 = 0; | 1467 t.dstA4 = 0; |
1342 t.dstA5 = 0; | 1468 t.dstA5 = 0; |
1343 t.dstA6 = 0; | 1469 t.dstA6 = 0; |
1344 t.dstA7 = 0; | 1470 t.dstA7 = 0; |
1345 t.vmov_src[0] = t.vmov_src[1] = t.vmov_src[2] = t.vmov_src[3] = 1; | 1471 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; | 1472 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); | 1473 Object* dummy = CALL_GENERATED_CODE(isolate, f, &t, 0, 0, 0, 0); |
1350 USE(dummy); | 1474 USE(dummy); |
1351 CHECK_EQ(0x01020304u, t.dst0); | 1475 CHECK_EQ(0x01020304u, t.dst0); |
1352 CHECK_EQ(0x11121314u, t.dst1); | 1476 CHECK_EQ(0x11121314u, t.dst1); |
1353 CHECK_EQ(0x21222324u, t.dst2); | 1477 CHECK_EQ(0x21222324u, t.dst2); |
1354 CHECK_EQ(0x31323334u, t.dst3); | 1478 CHECK_EQ(0x31323334u, t.dst3); |
1355 CHECK_EQ(0x41424344u, t.dst4); | 1479 CHECK_EQ(0x41424344u, t.dst4); |
1356 CHECK_EQ(0x51525354u, t.dst5); | 1480 CHECK_EQ(0x51525354u, t.dst5); |
1357 CHECK_EQ(0x61626364u, t.dst6); | 1481 CHECK_EQ(0x61626364u, t.dst6); |
1358 CHECK_EQ(0x71727374u, t.dst7); | 1482 CHECK_EQ(0x71727374u, t.dst7); |
1359 CHECK_EQ(0x00430044u, t.dstA0); | 1483 CHECK_EQ(0x00430044u, t.dstA0); |
1360 CHECK_EQ(0x00410042u, t.dstA1); | 1484 CHECK_EQ(0x00410042u, t.dstA1); |
1361 CHECK_EQ(0x00830084u, t.dstA2); | 1485 CHECK_EQ(0x00830084u, t.dstA2); |
1362 CHECK_EQ(0x00810082u, t.dstA3); | 1486 CHECK_EQ(0x00810082u, t.dstA3); |
1363 CHECK_EQ(0x00430044u, t.dstA4); | 1487 CHECK_EQ(0x00430044u, t.dstA4); |
1364 CHECK_EQ(0x00410042u, t.dstA5); | 1488 CHECK_EQ(0x00410042u, t.dstA5); |
1365 CHECK_EQ(0x00830084u, t.dstA6); | 1489 CHECK_EQ(0x00830084u, t.dstA6); |
1366 CHECK_EQ(0x00810082u, t.dstA7); | 1490 CHECK_EQ(0x00810082u, t.dstA7); |
1367 CHECK_EQ(1u, t.vmov_dst[0]); | 1491 CHECK_EQ(1u, t.vmov_dst[0]); |
1368 CHECK_EQ(1u, t.vmov_dst[1]); | 1492 CHECK_EQ(1u, t.vmov_dst[1]); |
1369 CHECK_EQ(1u, t.vmov_dst[2]); | 1493 CHECK_EQ(1u, t.vmov_dst[2]); |
1370 CHECK_EQ(1u, t.vmov_dst[3]); | 1494 CHECK_EQ(1u, t.vmov_dst[3]); |
1371 CHECK_EQ(0xFFu, t.veor_dst[0]); | 1495 CHECK_EQ(-1, t.vcvt_s32_f32[0]); |
1372 CHECK_EQ(0xFFu, t.veor_dst[1]); | 1496 CHECK_EQ(-1, t.vcvt_s32_f32[1]); |
1373 CHECK_EQ(0xFFu, t.veor_dst[2]); | 1497 CHECK_EQ(1, t.vcvt_s32_f32[2]); |
1374 CHECK_EQ(0xFFu, t.veor_dst[3]); | 1498 CHECK_EQ(1, t.vcvt_s32_f32[3]); |
1499 CHECK_EQ(0xFFFFFFFFu, t.vcvt_u32_f32[0]); | |
1500 CHECK_EQ(0xFFFFFFFFu, t.vcvt_u32_f32[1]); | |
1501 CHECK_EQ(1u, t.vcvt_u32_f32[2]); | |
1502 CHECK_EQ(1u, t.vcvt_u32_f32[3]); | |
1503 CHECK_EQ(-1.f, t.vcvt_f32_s32[0]); | |
1504 CHECK_EQ(1.f, t.vcvt_f32_s32[1]); | |
1505 CHECK_EQ(-1.f, t.vcvt_f32_s32[2]); | |
1506 CHECK_EQ(1.f, t.vcvt_f32_s32[3]); | |
1507 CHECK_EQ(static_cast<float>(0xFFFFFFFFu), t.vcvt_f32_u32[0]); | |
1508 CHECK_EQ(1.f, t.vcvt_f32_u32[1]); | |
1509 CHECK_EQ(static_cast<float>(0xFFFFFFFFu), t.vcvt_f32_u32[2]); | |
1510 CHECK_EQ(1.f, t.vcvt_f32_u32[3]); | |
1511 for (int i = 0; i < 4; i++) CHECK_EQ(0xFF00FF00, t.vmvn[i]); | |
1512 for (int i = 0; i < 4; i++) CHECK_EQ(0x0a0a0a0au, t.vdup1[i]); | |
1513 for (int i = 0; i < 4; i++) CHECK_EQ(0x000a000au, t.vdup2[i]); | |
1514 for (int i = 0; i < 4; i++) CHECK_EQ(0x0000000au, t.vdup3[i]); | |
1515 for (int i = 0; i < 4; i++) CHECK_EQ(0xbf800000u, t.vdup4[i]); // -1.0f | |
1516 for (int i = 0; i < 4; i++) CHECK_EQ(0x00ff00ffu, t.veor[i]); | |
1517 for (int i = 0; i < 4; i++) CHECK_EQ(2.0, t.vaddf[i]); | |
1518 for (int i = 0; i < 4; i++) CHECK_EQ(0x00030003u, t.vadd[i]); | |
1519 for (int i = 0; i < 4; i++) CHECK_EQ(-1.0, t.vsubf[i]); | |
1520 for (int i = 0; i < 4; i++) CHECK_EQ(0xffffffffu, t.vsub[i]); | |
1521 for (int i = 0; i < 4; i++) CHECK_EQ(0x00ff00ffu, t.vceq[i]); | |
1522 for (int i = 0; i < 4; i++) CHECK_EQ(0x00ff00ffu, t.vtst[i]); | |
1523 for (int i = 0; i < 4; i++) CHECK_EQ(0x02010201u, t.vbsl[i]); | |
1524 CHECK_EQ(0x05010400u, t.vtbl[0]); | |
1525 CHECK_EQ(0x00030602u, t.vtbl[1]); | |
1526 CHECK_EQ(0x05010400u, t.vtbx[0]); | |
1527 CHECK_EQ(0xff030602u, t.vtbx[1]); | |
1375 } | 1528 } |
1376 } | 1529 } |
1377 | 1530 |
1378 | 1531 |
1379 TEST(16) { | 1532 TEST(16) { |
1380 // Test the pkh, uxtb, uxtab and uxtb16 instructions. | 1533 // Test the pkh, uxtb, uxtab and uxtb16 instructions. |
1381 CcTest::InitializeVM(); | 1534 CcTest::InitializeVM(); |
1382 Isolate* isolate = CcTest::i_isolate(); | 1535 Isolate* isolate = CcTest::i_isolate(); |
1383 HandleScope scope(isolate); | 1536 HandleScope scope(isolate); |
1384 | 1537 |
(...skipping 1571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2956 const uint32_t test_2 = 0x89abcdef; | 3109 const uint32_t test_2 = 0x89abcdef; |
2957 __ mov(r4, Operand(test_1)); | 3110 __ mov(r4, Operand(test_1)); |
2958 __ mov(r5, Operand(test_2)); | 3111 __ mov(r5, Operand(test_2)); |
2959 // TODO(bbudge) replace with vdup when implemented. | 3112 // TODO(bbudge) replace with vdup when implemented. |
2960 __ vmov(d8, r4, r4); | 3113 __ vmov(d8, r4, r4); |
2961 __ vmov(d9, r4, r4); // q4 = [1.0, 1.0] | 3114 __ vmov(d9, r4, r4); // q4 = [1.0, 1.0] |
2962 __ vmov(d10, r5, r5); | 3115 __ vmov(d10, r5, r5); |
2963 __ vmov(d11, r5, r5); // q5 = [-1.0, -1.0] | 3116 __ vmov(d11, r5, r5); // q5 = [-1.0, -1.0] |
2964 __ vswp(q4, q5); | 3117 __ vswp(q4, q5); |
2965 __ add(r6, r0, Operand(static_cast<int32_t>(offsetof(T, vswp_q4)))); | 3118 __ add(r6, r0, Operand(static_cast<int32_t>(offsetof(T, vswp_q4)))); |
2966 __ vst1(Neon8, NeonListOperand(d8, 2), NeonMemOperand(r6)); | 3119 __ vst1(Neon8, NeonListOperand(q4), NeonMemOperand(r6)); |
2967 __ add(r6, r0, Operand(static_cast<int32_t>(offsetof(T, vswp_q5)))); | 3120 __ add(r6, r0, Operand(static_cast<int32_t>(offsetof(T, vswp_q5)))); |
2968 __ vst1(Neon8, NeonListOperand(d10, 2), NeonMemOperand(r6)); | 3121 __ vst1(Neon8, NeonListOperand(q5), NeonMemOperand(r6)); |
2969 | 3122 |
2970 __ ldm(ia_w, sp, r4.bit() | r5.bit() | r6.bit() | r7.bit() | pc.bit()); | 3123 __ ldm(ia_w, sp, r4.bit() | r5.bit() | r6.bit() | r7.bit() | pc.bit()); |
2971 __ bx(lr); | 3124 __ bx(lr); |
2972 | 3125 |
2973 CodeDesc desc; | 3126 CodeDesc desc; |
2974 assm.GetCode(&desc); | 3127 assm.GetCode(&desc); |
2975 Handle<Code> code = isolate->factory()->NewCode( | 3128 Handle<Code> code = isolate->factory()->NewCode( |
2976 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 3129 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
2977 #ifdef DEBUG | 3130 #ifdef DEBUG |
2978 OFStream os(stdout); | 3131 OFStream os(stdout); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3048 HandleScope scope(isolate); | 3201 HandleScope scope(isolate); |
3049 | 3202 |
3050 Assembler assm(isolate, NULL, 0); | 3203 Assembler assm(isolate, NULL, 0); |
3051 __ mov(r0, Operand(isolate->factory()->infinity_value())); | 3204 __ mov(r0, Operand(isolate->factory()->infinity_value())); |
3052 __ BlockConstPoolFor(1019); | 3205 __ BlockConstPoolFor(1019); |
3053 for (int i = 0; i < 1019; ++i) __ nop(); | 3206 for (int i = 0; i < 1019; ++i) __ nop(); |
3054 __ vldr(d0, MemOperand(r0, 0)); | 3207 __ vldr(d0, MemOperand(r0, 0)); |
3055 } | 3208 } |
3056 | 3209 |
3057 #undef __ | 3210 #undef __ |
OLD | NEW |