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 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1214 (bit_cast<int64_t>(t.sub_result) >> 32) & 0x7fffffff); | 1214 (bit_cast<int64_t>(t.sub_result) >> 32) & 0x7fffffff); |
1215 CHECK_EQ(kArmNanLower32, bit_cast<int64_t>(t.sub_result) & 0xffffffffu); | 1215 CHECK_EQ(kArmNanLower32, bit_cast<int64_t>(t.sub_result) & 0xffffffffu); |
1216 CHECK_EQ(kArmNanUpper32, | 1216 CHECK_EQ(kArmNanUpper32, |
1217 (bit_cast<int64_t>(t.mul_result) >> 32) & 0x7fffffff); | 1217 (bit_cast<int64_t>(t.mul_result) >> 32) & 0x7fffffff); |
1218 CHECK_EQ(kArmNanLower32, bit_cast<int64_t>(t.mul_result) & 0xffffffffu); | 1218 CHECK_EQ(kArmNanLower32, bit_cast<int64_t>(t.mul_result) & 0xffffffffu); |
1219 CHECK_EQ(kArmNanUpper32, | 1219 CHECK_EQ(kArmNanUpper32, |
1220 (bit_cast<int64_t>(t.div_result) >> 32) & 0x7fffffff); | 1220 (bit_cast<int64_t>(t.div_result) >> 32) & 0x7fffffff); |
1221 CHECK_EQ(kArmNanLower32, bit_cast<int64_t>(t.div_result) & 0xffffffffu); | 1221 CHECK_EQ(kArmNanLower32, bit_cast<int64_t>(t.div_result) & 0xffffffffu); |
1222 } | 1222 } |
1223 | 1223 |
| 1224 #define CHECK_EQ_SPLAT(field, ex) \ |
| 1225 CHECK_EQ(ex, t.field[0]); \ |
| 1226 CHECK_EQ(ex, t.field[1]); \ |
| 1227 CHECK_EQ(ex, t.field[2]); \ |
| 1228 CHECK_EQ(ex, t.field[3]); |
| 1229 |
| 1230 #define CHECK_EQ_32X4(field, ex0, ex1, ex2, ex3) \ |
| 1231 CHECK_EQ(ex0, t.field[0]); \ |
| 1232 CHECK_EQ(ex1, t.field[1]); \ |
| 1233 CHECK_EQ(ex2, t.field[2]); \ |
| 1234 CHECK_EQ(ex3, t.field[3]); |
| 1235 |
1224 #define INT32_TO_FLOAT(val) \ | 1236 #define INT32_TO_FLOAT(val) \ |
1225 std::round(static_cast<float>(bit_cast<int32_t>(val))) | 1237 std::round(static_cast<float>(bit_cast<int32_t>(val))) |
1226 #define UINT32_TO_FLOAT(val) \ | 1238 #define UINT32_TO_FLOAT(val) \ |
1227 std::round(static_cast<float>(bit_cast<uint32_t>(val))) | 1239 std::round(static_cast<float>(bit_cast<uint32_t>(val))) |
1228 | 1240 |
1229 TEST(15) { | 1241 TEST(15) { |
1230 // Test the Neon instructions. | 1242 // Test the Neon instructions. |
1231 CcTest::InitializeVM(); | 1243 CcTest::InitializeVM(); |
1232 Isolate* isolate = CcTest::i_isolate(); | 1244 Isolate* isolate = CcTest::i_isolate(); |
1233 HandleScope scope(isolate); | 1245 HandleScope scope(isolate); |
(...skipping 18 matching lines...) Expand all Loading... |
1252 uint32_t srcA0; | 1264 uint32_t srcA0; |
1253 uint32_t srcA1; | 1265 uint32_t srcA1; |
1254 uint32_t dstA0; | 1266 uint32_t dstA0; |
1255 uint32_t dstA1; | 1267 uint32_t dstA1; |
1256 uint32_t dstA2; | 1268 uint32_t dstA2; |
1257 uint32_t dstA3; | 1269 uint32_t dstA3; |
1258 uint32_t dstA4; | 1270 uint32_t dstA4; |
1259 uint32_t dstA5; | 1271 uint32_t dstA5; |
1260 uint32_t dstA6; | 1272 uint32_t dstA6; |
1261 uint32_t dstA7; | 1273 uint32_t dstA7; |
| 1274 uint32_t lane_test[4]; |
1262 uint64_t vmov_to_scalar1, vmov_to_scalar2; | 1275 uint64_t vmov_to_scalar1, vmov_to_scalar2; |
1263 uint32_t vmov_from_scalar_s8, vmov_from_scalar_u8; | 1276 uint32_t vmov_from_scalar_s8, vmov_from_scalar_u8; |
1264 uint32_t vmov_from_scalar_s16, vmov_from_scalar_u16; | 1277 uint32_t vmov_from_scalar_s16, vmov_from_scalar_u16; |
1265 uint32_t vmov_from_scalar_32; | 1278 uint32_t vmov_from_scalar_32; |
1266 uint32_t vmov_src[4], vmov_dst[4], vmvn[4]; | 1279 uint32_t vmov[4], vmvn[4]; |
1267 int32_t vcvt_s32_f32[4]; | 1280 int32_t vcvt_s32_f32[4]; |
1268 uint32_t vcvt_u32_f32[4]; | 1281 uint32_t vcvt_u32_f32[4]; |
1269 float vcvt_f32_s32[4], vcvt_f32_u32[4]; | 1282 float vcvt_f32_s32[4], vcvt_f32_u32[4]; |
1270 uint32_t vdup1[4], vdup2[4], vdup3[4], vdup4[4]; | 1283 uint32_t vdup8[4], vdup16[4], vdup32[4]; |
| 1284 float vabsf[4], vnegf[4]; |
| 1285 uint32_t vabs_s8[4], vabs_s16[4], vabs_s32[4]; |
| 1286 uint32_t vneg_s8[4], vneg_s16[4], vneg_s32[4]; |
1271 uint32_t veor[4]; | 1287 uint32_t veor[4]; |
| 1288 float vdupf[4], vaddf[4], vsubf[4], vmulf[4]; |
1272 uint32_t vadd8[4], vadd16[4], vadd32[4]; | 1289 uint32_t vadd8[4], vadd16[4], vadd32[4]; |
1273 uint32_t vsub8[4], vsub16[4], vsub32[4]; | 1290 uint32_t vsub8[4], vsub16[4], vsub32[4]; |
1274 uint32_t vtst[4], vceq[4], vbsl[4], vtbl[2], vtbx[2]; | 1291 uint32_t vmul8[4], vmul16[4], vmul32[4]; |
1275 float vaddf[4], vsubf[4]; | 1292 uint32_t vtst[4], vceq[4], vbsl[4]; |
| 1293 uint32_t vext[4]; |
| 1294 uint32_t vzip8a[4], vzip8b[4], vzip16a[4], vzip16b[4], vzip32a[4], |
| 1295 vzip32b[4]; |
| 1296 uint32_t vrev64_32[4], vrev64_16[4], vrev64_8[4]; |
| 1297 uint32_t vrev32_16[4], vrev32_8[4]; |
| 1298 uint32_t vrev16_8[4]; |
| 1299 uint32_t vtbl[2], vtbx[2]; |
1276 } T; | 1300 } T; |
1277 T t; | 1301 T t; |
1278 | 1302 |
1279 // Create a function that accepts &t, and loads, manipulates, and stores | 1303 // Create a function that accepts &t, and loads, manipulates, and stores |
1280 // the doubles and floats. | 1304 // the doubles, floats, and SIMD values. |
1281 Assembler assm(isolate, NULL, 0); | 1305 Assembler assm(isolate, NULL, 0); |
1282 | 1306 |
1283 | |
1284 if (CpuFeatures::IsSupported(NEON)) { | 1307 if (CpuFeatures::IsSupported(NEON)) { |
1285 CpuFeatureScope scope(&assm, NEON); | 1308 CpuFeatureScope scope(&assm, NEON); |
1286 | 1309 |
1287 __ stm(db_w, sp, r4.bit() | r5.bit() | lr.bit()); | 1310 __ stm(db_w, sp, r4.bit() | r5.bit() | lr.bit()); |
1288 // Move 32 bytes with neon. | 1311 // Move 32 bytes with neon. |
1289 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, src0)))); | 1312 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, src0)))); |
1290 __ vld1(Neon8, NeonListOperand(d0, 4), NeonMemOperand(r4)); | 1313 __ vld1(Neon8, NeonListOperand(d0, 4), NeonMemOperand(r4)); |
1291 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, dst0)))); | 1314 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, dst0)))); |
1292 __ vst1(Neon8, NeonListOperand(d0, 4), NeonMemOperand(r4)); | 1315 __ vst1(Neon8, NeonListOperand(d0, 4), NeonMemOperand(r4)); |
1293 | 1316 |
1294 // Expand 8 bytes into 8 words(16 bits). | 1317 // Expand 8 bytes into 8 words(16 bits). |
1295 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, srcA0)))); | 1318 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, srcA0)))); |
1296 __ vld1(Neon8, NeonListOperand(d0), NeonMemOperand(r4)); | 1319 __ vld1(Neon8, NeonListOperand(d0), NeonMemOperand(r4)); |
1297 __ vmovl(NeonU8, q0, d0); | 1320 __ vmovl(NeonU8, q0, d0); |
1298 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, dstA0)))); | 1321 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, dstA0)))); |
1299 __ vst1(Neon8, NeonListOperand(d0, 2), NeonMemOperand(r4)); | 1322 __ vst1(Neon8, NeonListOperand(d0, 2), NeonMemOperand(r4)); |
1300 | 1323 |
1301 // The same expansion, but with different source and destination registers. | 1324 // The same expansion, but with different source and destination registers. |
1302 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, srcA0)))); | 1325 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, srcA0)))); |
1303 __ vld1(Neon8, NeonListOperand(d1), NeonMemOperand(r4)); | 1326 __ vld1(Neon8, NeonListOperand(d1), NeonMemOperand(r4)); |
1304 __ vmovl(NeonU8, q1, d1); | 1327 __ vmovl(NeonU8, q1, d1); |
1305 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, dstA4)))); | 1328 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, dstA4)))); |
1306 __ vst1(Neon8, NeonListOperand(d2, 2), NeonMemOperand(r4)); | 1329 __ vst1(Neon8, NeonListOperand(d2, 2), NeonMemOperand(r4)); |
1307 | 1330 |
1308 // ARM core register to scalar. | 1331 // ARM core register to scalar. |
1309 __ mov(r4, Operand(0xFFFFFFF8)); | 1332 __ mov(r4, Operand(0xfffffff8)); |
1310 __ vmov(d0, 0); | 1333 __ vmov(d0, 0); |
1311 __ vmov(NeonS8, d0, 1, r4); | 1334 __ vmov(NeonS8, d0, 1, r4); |
1312 __ vmov(NeonS16, d0, 1, r4); | 1335 __ vmov(NeonS16, d0, 1, r4); |
1313 __ vmov(NeonS32, d0, 1, r4); | 1336 __ vmov(NeonS32, d0, 1, r4); |
1314 __ vstr(d0, r0, offsetof(T, vmov_to_scalar1)); | 1337 __ vstr(d0, r0, offsetof(T, vmov_to_scalar1)); |
1315 __ vmov(d0, 0); | 1338 __ vmov(d0, 0); |
1316 __ vmov(NeonS8, d0, 3, r4); | 1339 __ vmov(NeonS8, d0, 3, r4); |
1317 __ vmov(NeonS16, d0, 3, r4); | 1340 __ vmov(NeonS16, d0, 3, r4); |
1318 __ vstr(d0, r0, offsetof(T, vmov_to_scalar2)); | 1341 __ vstr(d0, r0, offsetof(T, vmov_to_scalar2)); |
1319 | 1342 |
1320 // Scalar to ARM core register. | 1343 // Scalar to ARM core register. |
1321 __ mov(r4, Operand(0xFFFFFF00)); | 1344 __ mov(r4, Operand(0xffffff00)); |
1322 __ mov(r5, Operand(0xFFFFFFFF)); | 1345 __ mov(r5, Operand(0xffffffff)); |
1323 __ vmov(d0, r4, r5); | 1346 __ vmov(d0, r4, r5); |
1324 __ vmov(NeonS8, r4, d0, 1); | 1347 __ vmov(NeonS8, r4, d0, 1); |
1325 __ str(r4, MemOperand(r0, offsetof(T, vmov_from_scalar_s8))); | 1348 __ str(r4, MemOperand(r0, offsetof(T, vmov_from_scalar_s8))); |
1326 __ vmov(NeonU8, r4, d0, 1); | 1349 __ vmov(NeonU8, r4, d0, 1); |
1327 __ str(r4, MemOperand(r0, offsetof(T, vmov_from_scalar_u8))); | 1350 __ str(r4, MemOperand(r0, offsetof(T, vmov_from_scalar_u8))); |
1328 __ vmov(NeonS16, r4, d0, 1); | 1351 __ vmov(NeonS16, r4, d0, 1); |
1329 __ str(r4, MemOperand(r0, offsetof(T, vmov_from_scalar_s16))); | 1352 __ str(r4, MemOperand(r0, offsetof(T, vmov_from_scalar_s16))); |
1330 __ vmov(NeonU16, r4, d0, 1); | 1353 __ vmov(NeonU16, r4, d0, 1); |
1331 __ str(r4, MemOperand(r0, offsetof(T, vmov_from_scalar_u16))); | 1354 __ str(r4, MemOperand(r0, offsetof(T, vmov_from_scalar_u16))); |
1332 __ vmov(NeonS32, r4, d0, 1); | 1355 __ vmov(NeonS32, r4, d0, 1); |
1333 __ str(r4, MemOperand(r0, offsetof(T, vmov_from_scalar_32))); | 1356 __ str(r4, MemOperand(r0, offsetof(T, vmov_from_scalar_32))); |
1334 | 1357 |
1335 // vmov for q-registers. | 1358 // vmov for q-registers. |
1336 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vmov_src)))); | 1359 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, lane_test)))); |
1337 __ vld1(Neon8, NeonListOperand(q0), NeonMemOperand(r4)); | 1360 __ vld1(Neon8, NeonListOperand(q0), NeonMemOperand(r4)); |
1338 __ vmov(q1, q0); | 1361 __ vmov(q1, q0); |
1339 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vmov_dst)))); | 1362 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vmov)))); |
1340 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); | 1363 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); |
1341 | 1364 |
1342 // vmvn. | 1365 // vmvn. |
1343 __ mov(r4, Operand(0xFF)); | 1366 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, lane_test)))); |
1344 __ vdup(Neon16, q0, r4); | 1367 __ vld1(Neon8, NeonListOperand(q0), NeonMemOperand(r4)); |
1345 __ vmvn(q1, q0); | 1368 __ vmvn(q1, q0); |
1346 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vmvn)))); | 1369 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vmvn)))); |
1347 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); | 1370 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); |
1348 | 1371 |
1349 // vcvt for q-registers. | 1372 // vcvt for q-registers. |
1350 __ vmov(s0, -1.5); | 1373 __ vmov(s0, -1.5); |
1351 __ vmov(s1, -1); | 1374 __ vmov(s1, -1); |
1352 __ vmov(s2, 1); | 1375 __ vmov(s2, 1); |
1353 __ vmov(s3, 1.5); | 1376 __ vmov(s3, 1.5); |
1354 __ vcvt_s32_f32(q1, q0); | 1377 __ vcvt_s32_f32(q1, q0); |
1355 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vcvt_s32_f32)))); | 1378 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vcvt_s32_f32)))); |
1356 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); | 1379 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); |
1357 __ vcvt_u32_f32(q1, q0); | 1380 __ vcvt_u32_f32(q1, q0); |
1358 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vcvt_u32_f32)))); | 1381 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vcvt_u32_f32)))); |
1359 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); | 1382 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); |
1360 __ mov(r4, Operand(kMinInt)); | 1383 __ mov(r4, Operand(kMinInt)); |
1361 __ mov(r5, Operand(kMaxInt)); | 1384 __ mov(r5, Operand(kMaxInt)); |
1362 __ vmov(d0, r4, r5); | 1385 __ vmov(d0, r4, r5); |
1363 __ mov(r4, Operand(kMaxUInt32)); | 1386 __ mov(r4, Operand(kMaxUInt32)); |
1364 __ mov(r5, Operand(kMinInt + 1)); | 1387 __ mov(r5, Operand(kMinInt + 1)); |
1365 __ vmov(d1, r4, r5); // q0 = [kMinInt, kMaxInt, kMaxUInt32, kMinInt + 1] | 1388 __ vmov(d1, r4, r5); // q0 = [kMinInt, kMaxInt, kMaxUInt32, kMinInt + 1] |
1366 __ vcvt_f32_s32(q1, q0); | 1389 __ vcvt_f32_s32(q1, q0); |
1367 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vcvt_f32_s32)))); | 1390 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vcvt_f32_s32)))); |
1368 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); | 1391 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); |
1369 __ vcvt_f32_u32(q1, q0); | 1392 __ vcvt_f32_u32(q1, q0); |
1370 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vcvt_f32_u32)))); | 1393 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vcvt_f32_u32)))); |
1371 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); | 1394 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); |
1372 | 1395 |
1373 // int vdup. | 1396 // vdup (integer). |
1374 __ mov(r4, Operand(0xa)); | 1397 __ mov(r4, Operand(0xa)); |
1375 __ vdup(Neon8, q0, r4); | 1398 __ vdup(Neon8, q0, r4); |
1376 __ vdup(Neon16, q1, r4); | 1399 __ vdup(Neon16, q1, r4); |
1377 __ vdup(Neon32, q2, r4); | 1400 __ vdup(Neon32, q2, r4); |
1378 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vdup1)))); | 1401 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vdup8)))); |
1379 __ vst1(Neon8, NeonListOperand(q0), NeonMemOperand(r4)); | 1402 __ vst1(Neon8, NeonListOperand(q0), NeonMemOperand(r4)); |
1380 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vdup2)))); | 1403 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vdup16)))); |
1381 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); | 1404 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); |
1382 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vdup3)))); | 1405 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vdup32)))); |
1383 __ vst1(Neon8, NeonListOperand(q2), NeonMemOperand(r4)); | 1406 __ vst1(Neon8, NeonListOperand(q2), NeonMemOperand(r4)); |
1384 // float vdup. | 1407 |
| 1408 // vdup (float). |
1385 __ vmov(s0, -1.0); | 1409 __ vmov(s0, -1.0); |
1386 __ vdup(q0, s0); | 1410 __ vdup(q0, s0); |
1387 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vdup4)))); | 1411 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vdupf)))); |
1388 __ vst1(Neon8, NeonListOperand(q0), NeonMemOperand(r4)); | 1412 __ vst1(Neon8, NeonListOperand(q0), NeonMemOperand(r4)); |
1389 | 1413 |
| 1414 // vabs (float). |
| 1415 __ vmov(s0, -1.0); |
| 1416 __ vmov(s1, -0.0); |
| 1417 __ vmov(s2, 0.0); |
| 1418 __ vmov(s3, 1.0); |
| 1419 __ vabs(q1, q0); |
| 1420 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vabsf)))); |
| 1421 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); |
| 1422 // vneg (float). |
| 1423 __ vneg(q1, q0); |
| 1424 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vnegf)))); |
| 1425 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); |
| 1426 |
| 1427 // vabs (integer). |
| 1428 __ mov(r4, Operand(0x7f7f7f7f)); |
| 1429 __ mov(r5, Operand(0x01010101)); |
| 1430 __ vmov(d0, r4, r5); |
| 1431 __ mov(r4, Operand(0xffffffff)); |
| 1432 __ mov(r5, Operand(0x80808080)); |
| 1433 __ vmov(d1, r4, r5); |
| 1434 __ vabs(Neon8, q1, q0); |
| 1435 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vabs_s8)))); |
| 1436 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); |
| 1437 __ vabs(Neon16, q1, q0); |
| 1438 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vabs_s16)))); |
| 1439 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); |
| 1440 __ vabs(Neon32, q1, q0); |
| 1441 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vabs_s32)))); |
| 1442 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); |
| 1443 // vneg (integer). |
| 1444 __ vneg(Neon8, q1, q0); |
| 1445 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vneg_s8)))); |
| 1446 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); |
| 1447 __ vneg(Neon16, q1, q0); |
| 1448 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vneg_s16)))); |
| 1449 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); |
| 1450 __ vneg(Neon32, q1, q0); |
| 1451 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vneg_s32)))); |
| 1452 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); |
| 1453 |
1390 // veor. | 1454 // veor. |
1391 __ mov(r4, Operand(0x00aa)); | 1455 __ mov(r4, Operand(0x00aa)); |
1392 __ vdup(Neon16, q0, r4); | 1456 __ vdup(Neon16, q0, r4); |
1393 __ mov(r4, Operand(0x0055)); | 1457 __ mov(r4, Operand(0x0055)); |
1394 __ vdup(Neon16, q1, r4); | 1458 __ vdup(Neon16, q1, r4); |
1395 __ veor(q1, q1, q0); | 1459 __ veor(q1, q1, q0); |
1396 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, veor)))); | 1460 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, veor)))); |
1397 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); | 1461 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); |
1398 | 1462 |
1399 // vadd(integer). | 1463 // vadd (float). |
| 1464 __ vmov(s4, 1.0); |
| 1465 __ vdup(q0, s4); |
| 1466 __ vdup(q1, s4); |
| 1467 __ vadd(q1, q1, q0); |
| 1468 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vaddf)))); |
| 1469 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); |
| 1470 // vsub (float). |
| 1471 __ vmov(s4, 2.0); |
| 1472 __ vdup(q0, s4); |
| 1473 __ vmov(s4, 1.0); |
| 1474 __ vdup(q1, s4); |
| 1475 __ vsub(q1, q1, q0); |
| 1476 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vsubf)))); |
| 1477 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); |
| 1478 // vmul (float). |
| 1479 __ vmov(s4, 2.0); |
| 1480 __ vdup(q0, s4); |
| 1481 __ vdup(q1, s4); |
| 1482 __ vmul(q1, q1, q0); |
| 1483 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vmulf)))); |
| 1484 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); |
| 1485 |
| 1486 // vadd (integer). |
1400 __ mov(r4, Operand(0x81)); | 1487 __ mov(r4, Operand(0x81)); |
1401 __ vdup(Neon8, q0, r4); | 1488 __ vdup(Neon8, q0, r4); |
1402 __ mov(r4, Operand(0x82)); | 1489 __ mov(r4, Operand(0x82)); |
1403 __ vdup(Neon8, q1, r4); | 1490 __ vdup(Neon8, q1, r4); |
1404 __ vadd(Neon8, q1, q1, q0); | 1491 __ vadd(Neon8, q1, q1, q0); |
1405 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vadd8)))); | 1492 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vadd8)))); |
1406 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); | 1493 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); |
1407 __ mov(r4, Operand(0x8001)); | 1494 __ mov(r4, Operand(0x8001)); |
1408 __ vdup(Neon16, q0, r4); | 1495 __ vdup(Neon16, q0, r4); |
1409 __ mov(r4, Operand(0x8002)); | 1496 __ mov(r4, Operand(0x8002)); |
1410 __ vdup(Neon16, q1, r4); | 1497 __ vdup(Neon16, q1, r4); |
1411 __ vadd(Neon16, q1, q1, q0); | 1498 __ vadd(Neon16, q1, q1, q0); |
1412 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vadd16)))); | 1499 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vadd16)))); |
1413 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); | 1500 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); |
1414 __ mov(r4, Operand(0x80000001)); | 1501 __ mov(r4, Operand(0x80000001)); |
1415 __ vdup(Neon32, q0, r4); | 1502 __ vdup(Neon32, q0, r4); |
1416 __ mov(r4, Operand(0x80000002)); | 1503 __ mov(r4, Operand(0x80000002)); |
1417 __ vdup(Neon32, q1, r4); | 1504 __ vdup(Neon32, q1, r4); |
1418 __ vadd(Neon32, q1, q1, q0); | 1505 __ vadd(Neon32, q1, q1, q0); |
1419 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vadd32)))); | 1506 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vadd32)))); |
1420 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); | 1507 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); |
1421 | 1508 |
1422 // vadd(float). | 1509 // vsub (integer). |
1423 __ vmov(s4, 1.0); | |
1424 __ vdup(q0, s4); | |
1425 __ vdup(q1, s4); | |
1426 __ vadd(q1, q1, q0); | |
1427 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vaddf)))); | |
1428 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); | |
1429 | |
1430 // vsub(integer). | |
1431 __ mov(r4, Operand(0x01)); | 1510 __ mov(r4, Operand(0x01)); |
1432 __ vdup(Neon8, q0, r4); | 1511 __ vdup(Neon8, q0, r4); |
1433 __ mov(r4, Operand(0x02)); | 1512 __ mov(r4, Operand(0x03)); |
1434 __ vdup(Neon8, q1, r4); | 1513 __ vdup(Neon8, q1, r4); |
1435 __ vsub(Neon8, q1, q0, q1); | 1514 __ vsub(Neon8, q1, q0, q1); |
1436 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vsub8)))); | 1515 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vsub8)))); |
1437 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); | 1516 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); |
1438 __ mov(r4, Operand(0x0001)); | 1517 __ mov(r4, Operand(0x0001)); |
1439 __ vdup(Neon16, q0, r4); | 1518 __ vdup(Neon16, q0, r4); |
1440 __ mov(r4, Operand(0x0002)); | 1519 __ mov(r4, Operand(0x0003)); |
1441 __ vdup(Neon16, q1, r4); | 1520 __ vdup(Neon16, q1, r4); |
1442 __ vsub(Neon16, q1, q0, q1); | 1521 __ vsub(Neon16, q1, q0, q1); |
1443 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vsub16)))); | 1522 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vsub16)))); |
1444 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); | 1523 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); |
1445 __ mov(r4, Operand(0x00000001)); | 1524 __ mov(r4, Operand(0x00000001)); |
1446 __ vdup(Neon32, q0, r4); | 1525 __ vdup(Neon32, q0, r4); |
1447 __ mov(r4, Operand(0x00000002)); | 1526 __ mov(r4, Operand(0x00000003)); |
1448 __ vdup(Neon32, q1, r4); | 1527 __ vdup(Neon32, q1, r4); |
1449 __ vsub(Neon32, q1, q0, q1); | 1528 __ vsub(Neon32, q1, q0, q1); |
1450 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vsub32)))); | 1529 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vsub32)))); |
1451 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); | 1530 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); |
1452 | 1531 |
1453 // vsub(float). | 1532 // vmul (integer). |
1454 __ vmov(s4, 2.0); | 1533 __ mov(r4, Operand(0x02)); |
1455 __ vdup(q0, s4); | 1534 __ vdup(Neon8, q0, r4); |
1456 __ vmov(s4, 1.0); | 1535 __ vmul(Neon8, q1, q0, q0); |
1457 __ vdup(q1, s4); | 1536 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vmul8)))); |
1458 __ vsub(q1, q1, q0); | 1537 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); |
1459 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vsubf)))); | 1538 __ mov(r4, Operand(0x0002)); |
| 1539 __ vdup(Neon16, q0, r4); |
| 1540 __ vmul(Neon16, q1, q0, q0); |
| 1541 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vmul16)))); |
| 1542 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); |
| 1543 __ mov(r4, Operand(0x00000002)); |
| 1544 __ vdup(Neon32, q0, r4); |
| 1545 __ vmul(Neon32, q1, q0, q0); |
| 1546 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vmul32)))); |
1460 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); | 1547 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); |
1461 | 1548 |
1462 // vceq. | 1549 // vceq. |
1463 __ mov(r4, Operand(0x03)); | 1550 __ mov(r4, Operand(0x03)); |
1464 __ vdup(Neon8, q0, r4); | 1551 __ vdup(Neon8, q0, r4); |
1465 __ mov(r4, Operand(0x03)); | 1552 __ mov(r4, Operand(0x03)); |
1466 __ vdup(Neon16, q1, r4); | 1553 __ vdup(Neon16, q1, r4); |
1467 __ vceq(Neon8, q1, q0, q1); | 1554 __ vceq(Neon8, q1, q0, q1); |
1468 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vceq)))); | 1555 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vceq)))); |
1469 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); | 1556 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); |
(...skipping 11 matching lines...) Expand all Loading... |
1481 __ mov(r4, Operand(0x00ff)); | 1568 __ mov(r4, Operand(0x00ff)); |
1482 __ vdup(Neon16, q0, r4); | 1569 __ vdup(Neon16, q0, r4); |
1483 __ mov(r4, Operand(0x01)); | 1570 __ mov(r4, Operand(0x01)); |
1484 __ vdup(Neon8, q1, r4); | 1571 __ vdup(Neon8, q1, r4); |
1485 __ mov(r4, Operand(0x02)); | 1572 __ mov(r4, Operand(0x02)); |
1486 __ vdup(Neon8, q2, r4); | 1573 __ vdup(Neon8, q2, r4); |
1487 __ vbsl(q0, q1, q2); | 1574 __ vbsl(q0, q1, q2); |
1488 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vbsl)))); | 1575 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vbsl)))); |
1489 __ vst1(Neon8, NeonListOperand(q0), NeonMemOperand(r4)); | 1576 __ vst1(Neon8, NeonListOperand(q0), NeonMemOperand(r4)); |
1490 | 1577 |
| 1578 // vext. |
| 1579 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, lane_test)))); |
| 1580 __ vld1(Neon8, NeonListOperand(q0), NeonMemOperand(r4)); |
| 1581 __ vmov(q1, q0); |
| 1582 __ vext(q2, q0, q1, 3); |
| 1583 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vext)))); |
| 1584 __ vst1(Neon8, NeonListOperand(q2), NeonMemOperand(r4)); |
| 1585 |
| 1586 // vzip. |
| 1587 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, lane_test)))); |
| 1588 __ vld1(Neon8, NeonListOperand(q0), NeonMemOperand(r4)); |
| 1589 __ vmov(q1, q0); |
| 1590 __ vzip(Neon8, q0, q1); |
| 1591 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vzip8a)))); |
| 1592 __ vst1(Neon8, NeonListOperand(q0), NeonMemOperand(r4)); |
| 1593 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vzip8b)))); |
| 1594 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); |
| 1595 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, lane_test)))); |
| 1596 __ vld1(Neon8, NeonListOperand(q0), NeonMemOperand(r4)); |
| 1597 __ vmov(q1, q0); |
| 1598 __ vzip(Neon16, q0, q1); |
| 1599 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vzip16a)))); |
| 1600 __ vst1(Neon8, NeonListOperand(q0), NeonMemOperand(r4)); |
| 1601 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vzip16b)))); |
| 1602 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); |
| 1603 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, lane_test)))); |
| 1604 __ vld1(Neon8, NeonListOperand(q0), NeonMemOperand(r4)); |
| 1605 __ vmov(q1, q0); |
| 1606 __ vzip(Neon32, q0, q1); |
| 1607 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vzip32a)))); |
| 1608 __ vst1(Neon8, NeonListOperand(q0), NeonMemOperand(r4)); |
| 1609 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vzip32b)))); |
| 1610 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); |
| 1611 |
| 1612 // vrev64/32/16 |
| 1613 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, lane_test)))); |
| 1614 __ vld1(Neon8, NeonListOperand(q0), NeonMemOperand(r4)); |
| 1615 __ vrev64(Neon32, q1, q0); |
| 1616 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vrev64_32)))); |
| 1617 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); |
| 1618 __ vrev64(Neon16, q1, q0); |
| 1619 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vrev64_16)))); |
| 1620 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); |
| 1621 __ vrev64(Neon8, q1, q0); |
| 1622 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vrev64_8)))); |
| 1623 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); |
| 1624 __ vrev32(Neon16, q1, q0); |
| 1625 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vrev32_16)))); |
| 1626 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); |
| 1627 __ vrev32(Neon8, q1, q0); |
| 1628 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vrev32_8)))); |
| 1629 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); |
| 1630 __ vrev16(Neon8, q1, q0); |
| 1631 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vrev16_8)))); |
| 1632 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); |
| 1633 |
1491 // vtb[l/x]. | 1634 // vtb[l/x]. |
1492 __ mov(r4, Operand(0x06040200)); | 1635 __ mov(r4, Operand(0x06040200)); |
1493 __ mov(r5, Operand(0xff050301)); | 1636 __ mov(r5, Operand(0xff050301)); |
1494 __ vmov(d2, r4, r5); // d2 = ff05030106040200 | 1637 __ vmov(d2, r4, r5); // d2 = ff05030106040200 |
1495 __ vtbl(d0, NeonListOperand(d2, 1), d2); | 1638 __ vtbl(d0, NeonListOperand(d2, 1), d2); |
1496 __ vstr(d0, r0, offsetof(T, vtbl)); | 1639 __ vstr(d0, r0, offsetof(T, vtbl)); |
1497 __ vtbx(d2, NeonListOperand(d2, 1), d2); | 1640 __ vtbx(d2, NeonListOperand(d2, 1), d2); |
1498 __ vstr(d2, r0, offsetof(T, vtbx)); | 1641 __ vstr(d2, r0, offsetof(T, vtbx)); |
1499 | 1642 |
1500 // Restore and return. | 1643 // Restore and return. |
(...skipping 27 matching lines...) Expand all Loading... |
1528 t.srcA0 = 0x41424344; | 1671 t.srcA0 = 0x41424344; |
1529 t.srcA1 = 0x81828384; | 1672 t.srcA1 = 0x81828384; |
1530 t.dstA0 = 0; | 1673 t.dstA0 = 0; |
1531 t.dstA1 = 0; | 1674 t.dstA1 = 0; |
1532 t.dstA2 = 0; | 1675 t.dstA2 = 0; |
1533 t.dstA3 = 0; | 1676 t.dstA3 = 0; |
1534 t.dstA4 = 0; | 1677 t.dstA4 = 0; |
1535 t.dstA5 = 0; | 1678 t.dstA5 = 0; |
1536 t.dstA6 = 0; | 1679 t.dstA6 = 0; |
1537 t.dstA7 = 0; | 1680 t.dstA7 = 0; |
1538 t.vmov_src[0] = t.vmov_src[1] = t.vmov_src[2] = t.vmov_src[3] = 1; | 1681 t.lane_test[0] = 0x03020100; |
1539 t.vmov_dst[0] = t.vmov_dst[1] = t.vmov_dst[2] = t.vmov_dst[3] = 0; | 1682 t.lane_test[1] = 0x07060504; |
| 1683 t.lane_test[2] = 0x0b0a0908; |
| 1684 t.lane_test[3] = 0x0f0e0d0c; |
1540 Object* dummy = CALL_GENERATED_CODE(isolate, f, &t, 0, 0, 0, 0); | 1685 Object* dummy = CALL_GENERATED_CODE(isolate, f, &t, 0, 0, 0, 0); |
1541 USE(dummy); | 1686 USE(dummy); |
1542 | 1687 |
1543 CHECK_EQ(0x01020304u, t.dst0); | 1688 CHECK_EQ(0x01020304u, t.dst0); |
1544 CHECK_EQ(0x11121314u, t.dst1); | 1689 CHECK_EQ(0x11121314u, t.dst1); |
1545 CHECK_EQ(0x21222324u, t.dst2); | 1690 CHECK_EQ(0x21222324u, t.dst2); |
1546 CHECK_EQ(0x31323334u, t.dst3); | 1691 CHECK_EQ(0x31323334u, t.dst3); |
1547 CHECK_EQ(0x41424344u, t.dst4); | 1692 CHECK_EQ(0x41424344u, t.dst4); |
1548 CHECK_EQ(0x51525354u, t.dst5); | 1693 CHECK_EQ(0x51525354u, t.dst5); |
1549 CHECK_EQ(0x61626364u, t.dst6); | 1694 CHECK_EQ(0x61626364u, t.dst6); |
1550 CHECK_EQ(0x71727374u, t.dst7); | 1695 CHECK_EQ(0x71727374u, t.dst7); |
1551 CHECK_EQ(0x00430044u, t.dstA0); | 1696 CHECK_EQ(0x00430044u, t.dstA0); |
1552 CHECK_EQ(0x00410042u, t.dstA1); | 1697 CHECK_EQ(0x00410042u, t.dstA1); |
1553 CHECK_EQ(0x00830084u, t.dstA2); | 1698 CHECK_EQ(0x00830084u, t.dstA2); |
1554 CHECK_EQ(0x00810082u, t.dstA3); | 1699 CHECK_EQ(0x00810082u, t.dstA3); |
1555 CHECK_EQ(0x00430044u, t.dstA4); | 1700 CHECK_EQ(0x00430044u, t.dstA4); |
1556 CHECK_EQ(0x00410042u, t.dstA5); | 1701 CHECK_EQ(0x00410042u, t.dstA5); |
1557 CHECK_EQ(0x00830084u, t.dstA6); | 1702 CHECK_EQ(0x00830084u, t.dstA6); |
1558 CHECK_EQ(0x00810082u, t.dstA7); | 1703 CHECK_EQ(0x00810082u, t.dstA7); |
| 1704 |
1559 CHECK_EQ(0xfffffff8fff8f800u, t.vmov_to_scalar1); | 1705 CHECK_EQ(0xfffffff8fff8f800u, t.vmov_to_scalar1); |
1560 CHECK_EQ(0xfff80000f8000000u, t.vmov_to_scalar2); | 1706 CHECK_EQ(0xfff80000f8000000u, t.vmov_to_scalar2); |
1561 CHECK_EQ(0xFFFFFFFFu, t.vmov_from_scalar_s8); | 1707 CHECK_EQ(0xFFFFFFFFu, t.vmov_from_scalar_s8); |
1562 CHECK_EQ(0xFFu, t.vmov_from_scalar_u8); | 1708 CHECK_EQ(0xFFu, t.vmov_from_scalar_u8); |
1563 CHECK_EQ(0xFFFFFFFFu, t.vmov_from_scalar_s16); | 1709 CHECK_EQ(0xFFFFFFFFu, t.vmov_from_scalar_s16); |
1564 CHECK_EQ(0xFFFFu, t.vmov_from_scalar_u16); | 1710 CHECK_EQ(0xFFFFu, t.vmov_from_scalar_u16); |
1565 CHECK_EQ(0xFFFFFFFFu, t.vmov_from_scalar_32); | 1711 CHECK_EQ(0xFFFFFFFFu, t.vmov_from_scalar_32); |
1566 CHECK_EQ(1u, t.vmov_dst[0]); | |
1567 CHECK_EQ(1u, t.vmov_dst[1]); | |
1568 CHECK_EQ(1u, t.vmov_dst[2]); | |
1569 CHECK_EQ(1u, t.vmov_dst[3]); | |
1570 CHECK_EQ(-1, t.vcvt_s32_f32[0]); | |
1571 CHECK_EQ(-1, t.vcvt_s32_f32[1]); | |
1572 CHECK_EQ(1, t.vcvt_s32_f32[2]); | |
1573 CHECK_EQ(1, t.vcvt_s32_f32[3]); | |
1574 CHECK_EQ(0u, t.vcvt_u32_f32[0]); | |
1575 CHECK_EQ(0u, t.vcvt_u32_f32[1]); | |
1576 CHECK_EQ(1u, t.vcvt_u32_f32[2]); | |
1577 CHECK_EQ(1u, t.vcvt_u32_f32[3]); | |
1578 | 1712 |
| 1713 CHECK_EQ_32X4(vmov, 0x03020100u, 0x07060504u, 0x0b0a0908u, 0x0f0e0d0cu); |
| 1714 CHECK_EQ_32X4(vmvn, 0xfcfdfeffu, 0xf8f9fafbu, 0xf4f5f6f7u, 0xf0f1f2f3u); |
| 1715 |
| 1716 CHECK_EQ_SPLAT(vdup8, 0x0a0a0a0au); |
| 1717 CHECK_EQ_SPLAT(vdup16, 0x000a000au); |
| 1718 CHECK_EQ_SPLAT(vdup32, 0x0000000au); |
| 1719 CHECK_EQ_SPLAT(vdupf, -1.0); |
| 1720 |
| 1721 // src: [-1, -1, 1, 1] |
| 1722 CHECK_EQ_32X4(vcvt_s32_f32, -1, -1, 1, 1); |
| 1723 CHECK_EQ_32X4(vcvt_u32_f32, 0u, 0u, 1u, 1u); |
1579 // src: [kMinInt, kMaxInt, kMaxUInt32, kMinInt + 1] | 1724 // src: [kMinInt, kMaxInt, kMaxUInt32, kMinInt + 1] |
1580 CHECK_EQ(INT32_TO_FLOAT(kMinInt), t.vcvt_f32_s32[0]); | 1725 CHECK_EQ_32X4(vcvt_f32_s32, INT32_TO_FLOAT(kMinInt), |
1581 CHECK_EQ(INT32_TO_FLOAT(kMaxInt), t.vcvt_f32_s32[1]); | 1726 INT32_TO_FLOAT(kMaxInt), INT32_TO_FLOAT(kMaxUInt32), |
1582 CHECK_EQ(INT32_TO_FLOAT(kMaxUInt32), t.vcvt_f32_s32[2]); | 1727 INT32_TO_FLOAT(kMinInt + 1)); |
1583 CHECK_EQ(INT32_TO_FLOAT(kMinInt + 1), t.vcvt_f32_s32[3]); | 1728 CHECK_EQ_32X4(vcvt_f32_u32, UINT32_TO_FLOAT(kMinInt), |
1584 CHECK_EQ(UINT32_TO_FLOAT(kMinInt), t.vcvt_f32_u32[0]); | 1729 UINT32_TO_FLOAT(kMaxInt), UINT32_TO_FLOAT(kMaxUInt32), |
1585 CHECK_EQ(UINT32_TO_FLOAT(kMaxInt), t.vcvt_f32_u32[1]); | 1730 UINT32_TO_FLOAT(kMinInt + 1)); |
1586 CHECK_EQ(UINT32_TO_FLOAT(kMaxUInt32), t.vcvt_f32_u32[2]); | |
1587 CHECK_EQ(UINT32_TO_FLOAT(kMinInt + 1), t.vcvt_f32_u32[3]); | |
1588 | 1731 |
1589 for (int i = 0; i < 4; i++) CHECK_EQ(0xFF00FF00, t.vmvn[i]); | 1732 CHECK_EQ_32X4(vabsf, 1.0, 0.0, 0.0, 1.0); |
1590 for (int i = 0; i < 4; i++) CHECK_EQ(0x0a0a0a0au, t.vdup1[i]); | 1733 CHECK_EQ_32X4(vnegf, 1.0, 0.0, -0.0, -1.0); |
1591 for (int i = 0; i < 4; i++) CHECK_EQ(0x000a000au, t.vdup2[i]); | 1734 // src: [0x7f7f7f7f, 0x01010101, 0xffffffff, 0x80808080] |
1592 for (int i = 0; i < 4; i++) CHECK_EQ(0x0000000au, t.vdup3[i]); | 1735 CHECK_EQ_32X4(vabs_s8, 0x7f7f7f7fu, 0x01010101u, 0x01010101u, 0x80808080u); |
1593 for (int i = 0; i < 4; i++) CHECK_EQ(0xbf800000u, t.vdup4[i]); // -1.0f | 1736 CHECK_EQ_32X4(vabs_s16, 0x7f7f7f7fu, 0x01010101u, 0x00010001u, 0x7f807f80u); |
1594 for (int i = 0; i < 4; i++) CHECK_EQ(0x00ff00ffu, t.veor[i]); | 1737 CHECK_EQ_32X4(vabs_s32, 0x7f7f7f7fu, 0x01010101u, 0x00000001u, 0x7f7f7f80u); |
1595 for (int i = 0; i < 4; i++) CHECK_EQ(2.0, t.vaddf[i]); | 1738 CHECK_EQ_32X4(vneg_s8, 0x81818181u, 0xffffffffu, 0x01010101u, 0x80808080u); |
1596 for (int i = 0; i < 4; i++) CHECK_EQ(0x03030303u, t.vadd8[i]); | 1739 CHECK_EQ_32X4(vneg_s16, 0x80818081u, 0xfefffeffu, 0x00010001u, 0x7f807f80u); |
1597 for (int i = 0; i < 4; i++) CHECK_EQ(0x00030003u, t.vadd16[i]); | 1740 CHECK_EQ_32X4(vneg_s32, 0x80808081u, 0xfefefeffu, 0x00000001u, 0x7f7f7f80u); |
1598 for (int i = 0; i < 4; i++) CHECK_EQ(0x00000003u, t.vadd32[i]); | 1741 |
1599 for (int i = 0; i < 4; i++) CHECK_EQ(-1.0, t.vsubf[i]); | 1742 CHECK_EQ_SPLAT(veor, 0x00ff00ffu); |
1600 for (int i = 0; i < 4; i++) CHECK_EQ(0xffffffffu, t.vsub8[i]); | 1743 CHECK_EQ_SPLAT(vaddf, 2.0); |
1601 for (int i = 0; i < 4; i++) CHECK_EQ(0xffffffffu, t.vsub16[i]); | 1744 CHECK_EQ_SPLAT(vsubf, -1.0); |
1602 for (int i = 0; i < 4; i++) CHECK_EQ(0xffffffffu, t.vsub32[i]); | 1745 CHECK_EQ_SPLAT(vmulf, 4.0); |
1603 for (int i = 0; i < 4; i++) CHECK_EQ(0x00ff00ffu, t.vceq[i]); | 1746 CHECK_EQ_SPLAT(vadd8, 0x03030303u); |
1604 for (int i = 0; i < 4; i++) CHECK_EQ(0x00ff00ffu, t.vtst[i]); | 1747 CHECK_EQ_SPLAT(vadd16, 0x00030003u); |
1605 for (int i = 0; i < 4; i++) CHECK_EQ(0x02010201u, t.vbsl[i]); | 1748 CHECK_EQ_SPLAT(vadd32, 0x00000003u); |
| 1749 CHECK_EQ_SPLAT(vsub8, 0xfefefefeu); |
| 1750 CHECK_EQ_SPLAT(vsub16, 0xfffefffeu); |
| 1751 CHECK_EQ_SPLAT(vsub32, 0xfffffffeu); |
| 1752 CHECK_EQ_SPLAT(vmul8, 0x04040404u); |
| 1753 CHECK_EQ_SPLAT(vmul16, 0x00040004u); |
| 1754 CHECK_EQ_SPLAT(vmul32, 0x00000004u); |
| 1755 CHECK_EQ_SPLAT(vceq, 0x00ff00ffu); |
| 1756 CHECK_EQ_SPLAT(vtst, 0x00ff00ffu); |
| 1757 CHECK_EQ_SPLAT(vbsl, 0x02010201u); |
| 1758 |
| 1759 CHECK_EQ_32X4(vext, 0x06050403u, 0x0a090807u, 0x0e0d0c0bu, 0x0201000fu); |
| 1760 |
| 1761 CHECK_EQ_32X4(vzip8a, 0x01010000u, 0x03030202u, 0x05050404u, 0x07070606u); |
| 1762 CHECK_EQ_32X4(vzip8b, 0x09090808u, 0x0b0b0a0au, 0x0d0d0c0cu, 0x0f0f0e0eu); |
| 1763 CHECK_EQ_32X4(vzip16a, 0x01000100u, 0x03020302u, 0x05040504u, 0x07060706u); |
| 1764 CHECK_EQ_32X4(vzip16b, 0x09080908u, 0x0b0a0b0au, 0x0d0c0d0cu, 0x0f0e0f0eu); |
| 1765 CHECK_EQ_32X4(vzip32a, 0x03020100u, 0x03020100u, 0x07060504u, 0x07060504u); |
| 1766 CHECK_EQ_32X4(vzip32b, 0x0b0a0908u, 0x0b0a0908u, 0x0f0e0d0cu, 0x0f0e0d0cu); |
| 1767 |
| 1768 // src: 0 1 2 3 4 5 6 7 8 9 a b c d e f (little endian) |
| 1769 CHECK_EQ_32X4(vrev64_32, 0x07060504u, 0x03020100u, 0x0f0e0d0cu, |
| 1770 0x0b0a0908u); |
| 1771 CHECK_EQ_32X4(vrev64_16, 0x05040706u, 0x01000302u, 0x0d0c0f0eu, |
| 1772 0x09080b0au); |
| 1773 CHECK_EQ_32X4(vrev64_8, 0x04050607u, 0x00010203u, 0x0c0d0e0fu, 0x08090a0bu); |
| 1774 CHECK_EQ_32X4(vrev32_16, 0x01000302u, 0x05040706u, 0x09080b0au, |
| 1775 0x0d0c0f0eu); |
| 1776 CHECK_EQ_32X4(vrev32_8, 0x00010203u, 0x04050607u, 0x08090a0bu, 0x0c0d0e0fu); |
| 1777 CHECK_EQ_32X4(vrev16_8, 0x02030001u, 0x06070405u, 0x0a0b0809u, 0x0e0f0c0du); |
| 1778 |
1606 CHECK_EQ(0x05010400u, t.vtbl[0]); | 1779 CHECK_EQ(0x05010400u, t.vtbl[0]); |
1607 CHECK_EQ(0x00030602u, t.vtbl[1]); | 1780 CHECK_EQ(0x00030602u, t.vtbl[1]); |
1608 CHECK_EQ(0x05010400u, t.vtbx[0]); | 1781 CHECK_EQ(0x05010400u, t.vtbx[0]); |
1609 CHECK_EQ(0xff030602u, t.vtbx[1]); | 1782 CHECK_EQ(0xff030602u, t.vtbx[1]); |
1610 } | 1783 } |
1611 } | 1784 } |
1612 | 1785 |
1613 | |
1614 TEST(16) { | 1786 TEST(16) { |
1615 // Test the pkh, uxtb, uxtab and uxtb16 instructions. | 1787 // Test the pkh, uxtb, uxtab and uxtb16 instructions. |
1616 CcTest::InitializeVM(); | 1788 CcTest::InitializeVM(); |
1617 Isolate* isolate = CcTest::i_isolate(); | 1789 Isolate* isolate = CcTest::i_isolate(); |
1618 HandleScope scope(isolate); | 1790 HandleScope scope(isolate); |
1619 | 1791 |
1620 typedef struct { | 1792 typedef struct { |
1621 uint32_t src0; | 1793 uint32_t src0; |
1622 uint32_t src1; | 1794 uint32_t src1; |
1623 uint32_t src2; | 1795 uint32_t src2; |
(...skipping 1659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3283 HandleScope scope(isolate); | 3455 HandleScope scope(isolate); |
3284 | 3456 |
3285 Assembler assm(isolate, NULL, 0); | 3457 Assembler assm(isolate, NULL, 0); |
3286 __ mov(r0, Operand(isolate->factory()->infinity_value())); | 3458 __ mov(r0, Operand(isolate->factory()->infinity_value())); |
3287 __ BlockConstPoolFor(1019); | 3459 __ BlockConstPoolFor(1019); |
3288 for (int i = 0; i < 1019; ++i) __ nop(); | 3460 for (int i = 0; i < 1019; ++i) __ nop(); |
3289 __ vldr(d0, MemOperand(r0, 0)); | 3461 __ vldr(d0, MemOperand(r0, 0)); |
3290 } | 3462 } |
3291 | 3463 |
3292 #undef __ | 3464 #undef __ |
OLD | NEW |