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 1248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1259 uint32_t dst4; | 1259 uint32_t dst4; |
1260 uint32_t dst5; | 1260 uint32_t dst5; |
1261 uint32_t dst6; | 1261 uint32_t dst6; |
1262 uint32_t dst7; | 1262 uint32_t dst7; |
1263 uint32_t srcA0; | 1263 uint32_t srcA0; |
1264 uint32_t srcA1; | 1264 uint32_t srcA1; |
1265 uint32_t dstA0; | 1265 uint32_t dstA0; |
1266 uint32_t dstA1; | 1266 uint32_t dstA1; |
1267 uint32_t dstA2; | 1267 uint32_t dstA2; |
1268 uint32_t dstA3; | 1268 uint32_t dstA3; |
| 1269 uint32_t dstA4; |
| 1270 uint32_t dstA5; |
| 1271 uint32_t dstA6; |
| 1272 uint32_t dstA7; |
1269 } T; | 1273 } T; |
1270 T t; | 1274 T t; |
1271 | 1275 |
1272 // Create a function that accepts &t, and loads, manipulates, and stores | 1276 // Create a function that accepts &t, and loads, manipulates, and stores |
1273 // the doubles and floats. | 1277 // the doubles and floats. |
1274 Assembler assm(isolate, NULL, 0); | 1278 Assembler assm(isolate, NULL, 0); |
1275 | 1279 |
1276 | 1280 |
1277 if (CpuFeatures::IsSupported(NEON)) { | 1281 if (CpuFeatures::IsSupported(NEON)) { |
1278 CpuFeatureScope scope(&assm, NEON); | 1282 CpuFeatureScope scope(&assm, NEON); |
1279 | 1283 |
1280 __ stm(db_w, sp, r4.bit() | lr.bit()); | 1284 __ stm(db_w, sp, r4.bit() | lr.bit()); |
1281 // Move 32 bytes with neon. | 1285 // Move 32 bytes with neon. |
1282 __ add(r4, r0, Operand(OFFSET_OF(T, src0))); | 1286 __ add(r4, r0, Operand(OFFSET_OF(T, src0))); |
1283 __ vld1(Neon8, NeonListOperand(d0, 4), NeonMemOperand(r4)); | 1287 __ vld1(Neon8, NeonListOperand(d0, 4), NeonMemOperand(r4)); |
1284 __ add(r4, r0, Operand(OFFSET_OF(T, dst0))); | 1288 __ add(r4, r0, Operand(OFFSET_OF(T, dst0))); |
1285 __ vst1(Neon8, NeonListOperand(d0, 4), NeonMemOperand(r4)); | 1289 __ vst1(Neon8, NeonListOperand(d0, 4), NeonMemOperand(r4)); |
1286 | 1290 |
1287 // Expand 8 bytes into 8 words(16 bits). | 1291 // Expand 8 bytes into 8 words(16 bits). |
1288 __ add(r4, r0, Operand(OFFSET_OF(T, srcA0))); | 1292 __ add(r4, r0, Operand(OFFSET_OF(T, srcA0))); |
1289 __ vld1(Neon8, NeonListOperand(d0), NeonMemOperand(r4)); | 1293 __ vld1(Neon8, NeonListOperand(d0), NeonMemOperand(r4)); |
1290 __ vmovl(NeonU8, q0, d0); | 1294 __ vmovl(NeonU8, q0, d0); |
1291 __ add(r4, r0, Operand(OFFSET_OF(T, dstA0))); | 1295 __ add(r4, r0, Operand(OFFSET_OF(T, dstA0))); |
1292 __ vst1(Neon8, NeonListOperand(d0, 2), NeonMemOperand(r4)); | 1296 __ vst1(Neon8, NeonListOperand(d0, 2), NeonMemOperand(r4)); |
1293 | 1297 |
1294 __ ldm(ia_w, sp, r4.bit() | pc.bit()); | 1298 // The same expansion, but with different source and destination registers. |
| 1299 __ add(r4, r0, Operand(OFFSET_OF(T, srcA0))); |
| 1300 __ vld1(Neon8, NeonListOperand(d1), NeonMemOperand(r4)); |
| 1301 __ vmovl(NeonU8, q1, d1); |
| 1302 __ add(r4, r0, Operand(OFFSET_OF(T, dstA4))); |
| 1303 __ vst1(Neon8, NeonListOperand(d2, 2), NeonMemOperand(r4)); |
| 1304 |
| 1305 __ ldm(ia_w, sp, r4.bit() | pc.bit()); |
1295 | 1306 |
1296 CodeDesc desc; | 1307 CodeDesc desc; |
1297 assm.GetCode(&desc); | 1308 assm.GetCode(&desc); |
1298 Object* code = isolate->heap()->CreateCode( | 1309 Object* code = isolate->heap()->CreateCode( |
1299 desc, | 1310 desc, |
1300 Code::ComputeFlags(Code::STUB), | 1311 Code::ComputeFlags(Code::STUB), |
1301 Handle<Code>())->ToObjectChecked(); | 1312 Handle<Code>())->ToObjectChecked(); |
1302 CHECK(code->IsCode()); | 1313 CHECK(code->IsCode()); |
1303 #ifdef DEBUG | 1314 #ifdef DEBUG |
1304 Code::cast(code)->Print(); | 1315 Code::cast(code)->Print(); |
(...skipping 14 matching lines...) Expand all Loading... |
1319 t.dst4 = 0; | 1330 t.dst4 = 0; |
1320 t.dst5 = 0; | 1331 t.dst5 = 0; |
1321 t.dst6 = 0; | 1332 t.dst6 = 0; |
1322 t.dst7 = 0; | 1333 t.dst7 = 0; |
1323 t.srcA0 = 0x41424344; | 1334 t.srcA0 = 0x41424344; |
1324 t.srcA1 = 0x81828384; | 1335 t.srcA1 = 0x81828384; |
1325 t.dstA0 = 0; | 1336 t.dstA0 = 0; |
1326 t.dstA1 = 0; | 1337 t.dstA1 = 0; |
1327 t.dstA2 = 0; | 1338 t.dstA2 = 0; |
1328 t.dstA3 = 0; | 1339 t.dstA3 = 0; |
| 1340 t.dstA4 = 0; |
| 1341 t.dstA5 = 0; |
| 1342 t.dstA6 = 0; |
| 1343 t.dstA7 = 0; |
1329 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); | 1344 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); |
1330 USE(dummy); | 1345 USE(dummy); |
1331 CHECK_EQ(0x01020304, t.dst0); | 1346 CHECK_EQ(0x01020304, t.dst0); |
1332 CHECK_EQ(0x11121314, t.dst1); | 1347 CHECK_EQ(0x11121314, t.dst1); |
1333 CHECK_EQ(0x21222324, t.dst2); | 1348 CHECK_EQ(0x21222324, t.dst2); |
1334 CHECK_EQ(0x31323334, t.dst3); | 1349 CHECK_EQ(0x31323334, t.dst3); |
1335 CHECK_EQ(0x41424344, t.dst4); | 1350 CHECK_EQ(0x41424344, t.dst4); |
1336 CHECK_EQ(0x51525354, t.dst5); | 1351 CHECK_EQ(0x51525354, t.dst5); |
1337 CHECK_EQ(0x61626364, t.dst6); | 1352 CHECK_EQ(0x61626364, t.dst6); |
1338 CHECK_EQ(0x71727374, t.dst7); | 1353 CHECK_EQ(0x71727374, t.dst7); |
1339 CHECK_EQ(0x00430044, t.dstA0); | 1354 CHECK_EQ(0x00430044, t.dstA0); |
1340 CHECK_EQ(0x00410042, t.dstA1); | 1355 CHECK_EQ(0x00410042, t.dstA1); |
1341 CHECK_EQ(0x00830084, t.dstA2); | 1356 CHECK_EQ(0x00830084, t.dstA2); |
1342 CHECK_EQ(0x00810082, t.dstA3); | 1357 CHECK_EQ(0x00810082, t.dstA3); |
| 1358 CHECK_EQ(0x00430044, t.dstA4); |
| 1359 CHECK_EQ(0x00410042, t.dstA5); |
| 1360 CHECK_EQ(0x00830084, t.dstA6); |
| 1361 CHECK_EQ(0x00810082, t.dstA7); |
1343 } | 1362 } |
1344 } | 1363 } |
1345 | 1364 |
1346 | 1365 |
1347 TEST(16) { | 1366 TEST(16) { |
1348 // Test the pkh, uxtb, uxtab and uxtb16 instructions. | 1367 // Test the pkh, uxtb, uxtab and uxtb16 instructions. |
1349 CcTest::InitializeVM(); | 1368 CcTest::InitializeVM(); |
1350 Isolate* isolate = CcTest::i_isolate(); | 1369 Isolate* isolate = CcTest::i_isolate(); |
1351 HandleScope scope(isolate); | 1370 HandleScope scope(isolate); |
1352 | 1371 |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1570 Handle<Code> code = isolate->factory()->NewCode(desc, | 1589 Handle<Code> code = isolate->factory()->NewCode(desc, |
1571 Code::ComputeFlags(Code::STUB), code_object); | 1590 Code::ComputeFlags(Code::STUB), code_object); |
1572 CHECK(code->IsCode()); | 1591 CHECK(code->IsCode()); |
1573 F1 f = FUNCTION_CAST<F1>(code->entry()); | 1592 F1 f = FUNCTION_CAST<F1>(code->entry()); |
1574 int res = reinterpret_cast<int>(CALL_GENERATED_CODE(f, 21, 0, 0, 0, 0)); | 1593 int res = reinterpret_cast<int>(CALL_GENERATED_CODE(f, 21, 0, 0, 0, 0)); |
1575 ::printf("f() = %d\n", res); | 1594 ::printf("f() = %d\n", res); |
1576 CHECK_EQ(42, res); | 1595 CHECK_EQ(42, res); |
1577 } | 1596 } |
1578 | 1597 |
1579 #undef __ | 1598 #undef __ |
OLD | NEW |