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

Side by Side Diff: src/arm/assembler-arm.cc

Issue 2122021: Make ldrd and strd instructions take two register arguments (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 7 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 | « src/arm/assembler-arm.h ('k') | src/arm/codegen-arm.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 (c) 1994-2006 Sun Microsystems Inc. 1 // Copyright (c) 1994-2006 Sun Microsystems Inc.
2 // All Rights Reserved. 2 // All Rights Reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions 5 // modification, are permitted provided that the following conditions
6 // are met: 6 // are met:
7 // 7 //
8 // - Redistributions of source code must retain the above copyright notice, 8 // - Redistributions of source code must retain the above copyright notice,
9 // this list of conditions and the following disclaimer. 9 // this list of conditions and the following disclaimer.
10 // 10 //
(...skipping 1345 matching lines...) Expand 10 before | Expand all | Expand 10 after
1356 void Assembler::ldrsb(Register dst, const MemOperand& src, Condition cond) { 1356 void Assembler::ldrsb(Register dst, const MemOperand& src, Condition cond) {
1357 addrmod3(cond | L | B7 | S6 | B4, dst, src); 1357 addrmod3(cond | L | B7 | S6 | B4, dst, src);
1358 } 1358 }
1359 1359
1360 1360
1361 void Assembler::ldrsh(Register dst, const MemOperand& src, Condition cond) { 1361 void Assembler::ldrsh(Register dst, const MemOperand& src, Condition cond) {
1362 addrmod3(cond | L | B7 | S6 | H | B4, dst, src); 1362 addrmod3(cond | L | B7 | S6 | H | B4, dst, src);
1363 } 1363 }
1364 1364
1365 1365
1366 void Assembler::ldrd(Register dst, const MemOperand& src, Condition cond) { 1366 void Assembler::ldrd(Register dst1,
1367 Register dst2,
1368 const MemOperand& src, Condition cond) {
1367 ASSERT(src.rm().is(no_reg)); 1369 ASSERT(src.rm().is(no_reg));
1370 ASSERT(!dst1.is(lr)); // r14.
1371 ASSERT_EQ(0, dst1.code() % 2);
1372 ASSERT_EQ(dst1.code() + 1, dst2.code());
1368 #ifdef CAN_USE_ARMV7_INSTRUCTIONS 1373 #ifdef CAN_USE_ARMV7_INSTRUCTIONS
1369 addrmod3(cond | B7 | B6 | B4, dst, src); 1374 addrmod3(cond | B7 | B6 | B4, dst1, src);
1370 #else 1375 #else
1371 // Generate two ldr instructions if ldrd is not available. 1376 // Generate two ldr instructions if ldrd is not available.
1372 MemOperand src1(src); 1377 MemOperand src2(src);
1373 src1.set_offset(src1.offset() + 4); 1378 src2.set_offset(src2.offset() + 4);
1374 Register dst1(dst); 1379 if (dst1.is(src.rn())) {
1375 dst1.set_code(dst1.code() + 1); 1380 ldr(dst2, src2, cond);
1376 if (dst.is(src.rn())) { 1381 ldr(dst1, src, cond);
1377 ldr(dst1, src1, cond);
1378 ldr(dst, src, cond);
1379 } else { 1382 } else {
1380 ldr(dst, src, cond); 1383 ldr(dst1, src, cond);
1381 ldr(dst1, src1, cond); 1384 ldr(dst2, src2, cond);
1382 } 1385 }
1383 #endif 1386 #endif
1384 } 1387 }
1385 1388
1386 1389
1387 void Assembler::strd(Register src, const MemOperand& dst, Condition cond) { 1390 void Assembler::strd(Register src1,
1391 Register src2,
1392 const MemOperand& dst, Condition cond) {
1388 ASSERT(dst.rm().is(no_reg)); 1393 ASSERT(dst.rm().is(no_reg));
1394 ASSERT(!src1.is(lr)); // r14.
1395 ASSERT_EQ(0, src1.code() % 2);
1396 ASSERT_EQ(src1.code() + 1, src2.code());
1389 #ifdef CAN_USE_ARMV7_INSTRUCTIONS 1397 #ifdef CAN_USE_ARMV7_INSTRUCTIONS
1390 addrmod3(cond | B7 | B6 | B5 | B4, src, dst); 1398 addrmod3(cond | B7 | B6 | B5 | B4, src1, dst);
1391 #else 1399 #else
1392 // Generate two str instructions if strd is not available. 1400 // Generate two str instructions if strd is not available.
1393 MemOperand dst1(dst); 1401 MemOperand dst2(dst);
1394 dst1.set_offset(dst1.offset() + 4); 1402 dst2.set_offset(dst2.offset() + 4);
1395 Register src1(src); 1403 str(src1, dst, cond);
1396 src1.set_code(src1.code() + 1); 1404 str(src2, dst2, cond);
1397 str(src, dst, cond);
1398 str(src1, dst1, cond);
1399 #endif 1405 #endif
1400 } 1406 }
1401 1407
1402 // Load/Store multiple instructions. 1408 // Load/Store multiple instructions.
1403 void Assembler::ldm(BlockAddrMode am, 1409 void Assembler::ldm(BlockAddrMode am,
1404 Register base, 1410 Register base,
1405 RegList dst, 1411 RegList dst,
1406 Condition cond) { 1412 Condition cond) {
1407 // ABI stack constraint: ldmxx base, {..sp..} base != sp is not restartable. 1413 // ABI stack constraint: ldmxx base, {..sp..} base != sp is not restartable.
1408 ASSERT(base.is(sp) || (dst & sp.bit()) == 0); 1414 ASSERT(base.is(sp) || (dst & sp.bit()) == 0);
(...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after
2222 2228
2223 // Since a constant pool was just emitted, move the check offset forward by 2229 // Since a constant pool was just emitted, move the check offset forward by
2224 // the standard interval. 2230 // the standard interval.
2225 next_buffer_check_ = pc_offset() + kCheckConstInterval; 2231 next_buffer_check_ = pc_offset() + kCheckConstInterval;
2226 } 2232 }
2227 2233
2228 2234
2229 } } // namespace v8::internal 2235 } } // namespace v8::internal
2230 2236
2231 #endif // V8_TARGET_ARCH_ARM 2237 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/assembler-arm.h ('k') | src/arm/codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698