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

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

Issue 2226003: ARM: Add Ldrd/Strd to the macro assembler... (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/macro-assembler-arm.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 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 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 // Clobber all input registers when running with the debug-code flag 347 // Clobber all input registers when running with the debug-code flag
348 // turned on to provoke errors. 348 // turned on to provoke errors.
349 if (FLAG_debug_code) { 349 if (FLAG_debug_code) {
350 mov(object, Operand(BitCast<int32_t>(kZapValue))); 350 mov(object, Operand(BitCast<int32_t>(kZapValue)));
351 mov(offset, Operand(BitCast<int32_t>(kZapValue))); 351 mov(offset, Operand(BitCast<int32_t>(kZapValue)));
352 mov(scratch, Operand(BitCast<int32_t>(kZapValue))); 352 mov(scratch, Operand(BitCast<int32_t>(kZapValue)));
353 } 353 }
354 } 354 }
355 355
356 356
357 void MacroAssembler::Ldrd(Register dst1, Register dst2,
358 const MemOperand& src, Condition cond) {
359 ASSERT(src.rm().is(no_reg));
360 ASSERT(!dst1.is(lr)); // r14.
361 ASSERT_EQ(0, dst1.code() % 2);
362 ASSERT_EQ(dst1.code() + 1, dst2.code());
363
364 // Generate two ldr instructions if ldrd is not available.
365 if (CpuFeatures::IsSupported(ARMv7)) {
366 CpuFeatures::Scope scope(ARMv7);
367 ldrd(dst1, dst2, src, cond);
368 } else {
369 MemOperand src2(src);
370 src2.set_offset(src2.offset() + 4);
371 if (dst1.is(src.rn())) {
372 ldr(dst2, src2, cond);
373 ldr(dst1, src, cond);
374 } else {
375 ldr(dst1, src, cond);
376 ldr(dst2, src2, cond);
377 }
378 }
379 }
380
381
382 void MacroAssembler::Strd(Register src1, Register src2,
383 const MemOperand& dst, Condition cond) {
384 ASSERT(dst.rm().is(no_reg));
385 ASSERT(!src1.is(lr)); // r14.
386 ASSERT_EQ(0, src1.code() % 2);
387 ASSERT_EQ(src1.code() + 1, src2.code());
388
389 // Generate two str instructions if strd is not available.
390 if (CpuFeatures::IsSupported(ARMv7)) {
391 CpuFeatures::Scope scope(ARMv7);
392 strd(src1, src2, dst, cond);
393 } else {
394 MemOperand dst2(dst);
395 dst2.set_offset(dst2.offset() + 4);
396 str(src1, dst, cond);
397 str(src2, dst2, cond);
398 }
399 }
400
401
357 void MacroAssembler::EnterFrame(StackFrame::Type type) { 402 void MacroAssembler::EnterFrame(StackFrame::Type type) {
358 // r0-r3: preserved 403 // r0-r3: preserved
359 stm(db_w, sp, cp.bit() | fp.bit() | lr.bit()); 404 stm(db_w, sp, cp.bit() | fp.bit() | lr.bit());
360 mov(ip, Operand(Smi::FromInt(type))); 405 mov(ip, Operand(Smi::FromInt(type)));
361 push(ip); 406 push(ip);
362 mov(ip, Operand(CodeObject())); 407 mov(ip, Operand(CodeObject()));
363 push(ip); 408 push(ip);
364 add(fp, sp, Operand(3 * kPointerSize)); // Adjust FP to point to saved FP. 409 add(fp, sp, Operand(3 * kPointerSize)); // Adjust FP to point to saved FP.
365 } 410 }
366 411
(...skipping 1355 matching lines...) Expand 10 before | Expand all | Expand 10 after
1722 1767
1723 void CodePatcher::Emit(Address addr) { 1768 void CodePatcher::Emit(Address addr) {
1724 masm()->emit(reinterpret_cast<Instr>(addr)); 1769 masm()->emit(reinterpret_cast<Instr>(addr));
1725 } 1770 }
1726 #endif // ENABLE_DEBUGGER_SUPPORT 1771 #endif // ENABLE_DEBUGGER_SUPPORT
1727 1772
1728 1773
1729 } } // namespace v8::internal 1774 } } // namespace v8::internal
1730 1775
1731 #endif // V8_TARGET_ARCH_ARM 1776 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/macro-assembler-arm.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698