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

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

Issue 148153010: Synchronize with r15701. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « test/cctest/test-api.cc ('k') | test/cctest/test-code-stubs-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1209 matching lines...) Expand 10 before | Expand all | Expand 10 after
1220 CHECK_EQ(kArmNanUpper32, (BitCast<int64_t>(t.add_result) >> 32) & 0x7fffffff); 1220 CHECK_EQ(kArmNanUpper32, (BitCast<int64_t>(t.add_result) >> 32) & 0x7fffffff);
1221 CHECK_EQ(kArmNanLower32, BitCast<int64_t>(t.add_result) & 0xffffffffu); 1221 CHECK_EQ(kArmNanLower32, BitCast<int64_t>(t.add_result) & 0xffffffffu);
1222 CHECK_EQ(kArmNanUpper32, (BitCast<int64_t>(t.sub_result) >> 32) & 0x7fffffff); 1222 CHECK_EQ(kArmNanUpper32, (BitCast<int64_t>(t.sub_result) >> 32) & 0x7fffffff);
1223 CHECK_EQ(kArmNanLower32, BitCast<int64_t>(t.sub_result) & 0xffffffffu); 1223 CHECK_EQ(kArmNanLower32, BitCast<int64_t>(t.sub_result) & 0xffffffffu);
1224 CHECK_EQ(kArmNanUpper32, (BitCast<int64_t>(t.mul_result) >> 32) & 0x7fffffff); 1224 CHECK_EQ(kArmNanUpper32, (BitCast<int64_t>(t.mul_result) >> 32) & 0x7fffffff);
1225 CHECK_EQ(kArmNanLower32, BitCast<int64_t>(t.mul_result) & 0xffffffffu); 1225 CHECK_EQ(kArmNanLower32, BitCast<int64_t>(t.mul_result) & 0xffffffffu);
1226 CHECK_EQ(kArmNanUpper32, (BitCast<int64_t>(t.div_result) >> 32) & 0x7fffffff); 1226 CHECK_EQ(kArmNanUpper32, (BitCast<int64_t>(t.div_result) >> 32) & 0x7fffffff);
1227 CHECK_EQ(kArmNanLower32, BitCast<int64_t>(t.div_result) & 0xffffffffu); 1227 CHECK_EQ(kArmNanLower32, BitCast<int64_t>(t.div_result) & 0xffffffffu);
1228 } 1228 }
1229 1229
1230
1231 TEST(15) {
1232 // Test the Neon instructions.
1233 CcTest::InitializeVM();
1234 Isolate* isolate = Isolate::Current();
1235 HandleScope scope(isolate);
1236
1237 typedef struct {
1238 uint32_t src0;
1239 uint32_t src1;
1240 uint32_t src2;
1241 uint32_t src3;
1242 uint32_t src4;
1243 uint32_t src5;
1244 uint32_t src6;
1245 uint32_t src7;
1246 uint32_t dst0;
1247 uint32_t dst1;
1248 uint32_t dst2;
1249 uint32_t dst3;
1250 uint32_t dst4;
1251 uint32_t dst5;
1252 uint32_t dst6;
1253 uint32_t dst7;
1254 uint32_t srcA0;
1255 uint32_t srcA1;
1256 uint32_t dstA0;
1257 uint32_t dstA1;
1258 uint32_t dstA2;
1259 uint32_t dstA3;
1260 } T;
1261 T t;
1262
1263 // Create a function that accepts &t, and loads, manipulates, and stores
1264 // the doubles and floats.
1265 Assembler assm(isolate, NULL, 0);
1266
1267
1268 if (CpuFeatures::IsSupported(NEON)) {
1269 CpuFeatureScope scope(&assm, NEON);
1270
1271 __ stm(db_w, sp, r4.bit() | lr.bit());
1272 // Move 32 bytes with neon.
1273 __ add(r4, r0, Operand(OFFSET_OF(T, src0)));
1274 __ vld1(Neon8, NeonListOperand(d0, 4), NeonMemOperand(r4));
1275 __ add(r4, r0, Operand(OFFSET_OF(T, dst0)));
1276 __ vst1(Neon8, NeonListOperand(d0, 4), NeonMemOperand(r4));
1277
1278 // Expand 8 bytes into 8 words(16 bits).
1279 __ add(r4, r0, Operand(OFFSET_OF(T, srcA0)));
1280 __ vld1(Neon8, NeonListOperand(d0), NeonMemOperand(r4));
1281 __ vmovl(NeonU8, q0, d0);
1282 __ add(r4, r0, Operand(OFFSET_OF(T, dstA0)));
1283 __ vst1(Neon8, NeonListOperand(d0, 2), NeonMemOperand(r4));
1284
1285 __ ldm(ia_w, sp, r4.bit() | pc.bit());
1286
1287 CodeDesc desc;
1288 assm.GetCode(&desc);
1289 Object* code = isolate->heap()->CreateCode(
1290 desc,
1291 Code::ComputeFlags(Code::STUB),
1292 Handle<Code>())->ToObjectChecked();
1293 CHECK(code->IsCode());
1294 #ifdef DEBUG
1295 Code::cast(code)->Print();
1296 #endif
1297 F3 f = FUNCTION_CAST<F3>(Code::cast(code)->entry());
1298 t.src0 = 0x01020304;
1299 t.src1 = 0x11121314;
1300 t.src2 = 0x21222324;
1301 t.src3 = 0x31323334;
1302 t.src4 = 0x41424344;
1303 t.src5 = 0x51525354;
1304 t.src6 = 0x61626364;
1305 t.src7 = 0x71727374;
1306 t.dst0 = 0;
1307 t.dst1 = 0;
1308 t.dst2 = 0;
1309 t.dst3 = 0;
1310 t.dst4 = 0;
1311 t.dst5 = 0;
1312 t.dst6 = 0;
1313 t.dst7 = 0;
1314 t.srcA0 = 0x41424344;
1315 t.srcA1 = 0x81828384;
1316 t.dstA0 = 0;
1317 t.dstA1 = 0;
1318 t.dstA2 = 0;
1319 t.dstA3 = 0;
1320 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0);
1321 USE(dummy);
1322 CHECK_EQ(0x01020304, t.dst0);
1323 CHECK_EQ(0x11121314, t.dst1);
1324 CHECK_EQ(0x21222324, t.dst2);
1325 CHECK_EQ(0x31323334, t.dst3);
1326 CHECK_EQ(0x41424344, t.dst4);
1327 CHECK_EQ(0x51525354, t.dst5);
1328 CHECK_EQ(0x61626364, t.dst6);
1329 CHECK_EQ(0x71727374, t.dst7);
1330 CHECK_EQ(0x00430044, t.dstA0);
1331 CHECK_EQ(0x00410042, t.dstA1);
1332 CHECK_EQ(0x00830084, t.dstA2);
1333 CHECK_EQ(0x00810082, t.dstA3);
1334 }
1335 }
1336
1337
1338 TEST(16) {
1339 // Test the pkh, uxtb, uxtab and uxtb16 instructions.
1340 CcTest::InitializeVM();
1341 Isolate* isolate = Isolate::Current();
1342 HandleScope scope(isolate);
1343
1344 typedef struct {
1345 uint32_t src0;
1346 uint32_t src1;
1347 uint32_t src2;
1348 uint32_t dst0;
1349 uint32_t dst1;
1350 uint32_t dst2;
1351 uint32_t dst3;
1352 uint32_t dst4;
1353 } T;
1354 T t;
1355
1356 // Create a function that accepts &t, and loads, manipulates, and stores
1357 // the doubles and floats.
1358 Assembler assm(isolate, NULL, 0);
1359
1360 __ stm(db_w, sp, r4.bit() | lr.bit());
1361
1362 __ mov(r4, Operand(r0));
1363 __ ldr(r0, MemOperand(r4, OFFSET_OF(T, src0)));
1364 __ ldr(r1, MemOperand(r4, OFFSET_OF(T, src1)));
1365
1366 __ pkhbt(r2, r0, Operand(r1, LSL, 8));
1367 __ str(r2, MemOperand(r4, OFFSET_OF(T, dst0)));
1368
1369 __ pkhtb(r2, r0, Operand(r1, ASR, 8));
1370 __ str(r2, MemOperand(r4, OFFSET_OF(T, dst1)));
1371
1372 __ uxtb16(r2, Operand(r0, ROR, 8));
1373 __ str(r2, MemOperand(r4, OFFSET_OF(T, dst2)));
1374
1375 __ uxtb(r2, Operand(r0, ROR, 8));
1376 __ str(r2, MemOperand(r4, OFFSET_OF(T, dst3)));
1377
1378 __ ldr(r0, MemOperand(r4, OFFSET_OF(T, src2)));
1379 __ uxtab(r2, r0, Operand(r1, ROR, 8));
1380 __ str(r2, MemOperand(r4, OFFSET_OF(T, dst4)));
1381
1382 __ ldm(ia_w, sp, r4.bit() | pc.bit());
1383
1384 CodeDesc desc;
1385 assm.GetCode(&desc);
1386 Object* code = isolate->heap()->CreateCode(
1387 desc,
1388 Code::ComputeFlags(Code::STUB),
1389 Handle<Code>())->ToObjectChecked();
1390 CHECK(code->IsCode());
1391 #ifdef DEBUG
1392 Code::cast(code)->Print();
1393 #endif
1394 F3 f = FUNCTION_CAST<F3>(Code::cast(code)->entry());
1395 t.src0 = 0x01020304;
1396 t.src1 = 0x11121314;
1397 t.src2 = 0x11121300;
1398 t.dst0 = 0;
1399 t.dst1 = 0;
1400 t.dst2 = 0;
1401 t.dst3 = 0;
1402 t.dst4 = 0;
1403 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0);
1404 USE(dummy);
1405 CHECK_EQ(0x12130304, t.dst0);
1406 CHECK_EQ(0x01021213, t.dst1);
1407 CHECK_EQ(0x00010003, t.dst2);
1408 CHECK_EQ(0x00000003, t.dst3);
1409 CHECK_EQ(0x11121313, t.dst4);
1410 }
1411
1230 #undef __ 1412 #undef __
OLDNEW
« no previous file with comments | « test/cctest/test-api.cc ('k') | test/cctest/test-code-stubs-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698