Reviewers: zhangk,
Description:
ARM: Fix generating two ldr instructions in place of ldrd.
When ldrd is not available two ldr instructions are generated. This fixes
these
in the case where the register used in the memory operand is the same as the
first register in the register pair receiving the values.
All tests now run on ARM with the flag --special-command="@
--noenable-vfp3".
Running without VFP3 support in the simulator causes more ldrd instructions
to
be used, and the default build configuration does not utilize ldrd, but
generated tow ldr instructions.
Please review this at http://codereview.chromium.org/2078013/show
SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/
Affected files:
M src/arm/assembler-arm.h
M src/arm/assembler-arm.cc
Index: src/arm/assembler-arm.cc
===================================================================
--- src/arm/assembler-arm.cc (revision 4666)
+++ src/arm/assembler-arm.cc (working copy)
@@ -1359,12 +1359,18 @@
#ifdef CAN_USE_ARMV7_INSTRUCTIONS
addrmod3(cond | B7 | B6 | B4, dst, src);
#else
- ldr(dst, src, cond);
+ // Generate two ldr instructions if ldrd is not available.
MemOperand src1(src);
src1.set_offset(src1.offset() + 4);
Register dst1(dst);
dst1.code_ = dst1.code_ + 1;
- ldr(dst1, src1, cond);
+ if (dst.is(src.rn())) {
+ ldr(dst1, src1, cond);
+ ldr(dst, src, cond);
+ } else {
+ ldr(dst, src, cond);
+ ldr(dst1, src1, cond);
+ }
#endif
}
@@ -1374,11 +1380,12 @@
#ifdef CAN_USE_ARMV7_INSTRUCTIONS
addrmod3(cond | B7 | B6 | B5 | B4, src, dst);
#else
- str(src, dst, cond);
+ // Generate two str instructions if strd is not available.
MemOperand dst1(dst);
dst1.set_offset(dst1.offset() + 4);
Register src1(src);
src1.code_ = src1.code_ + 1;
+ str(src, dst, cond);
str(src1, dst1, cond);
#endif
}
Index: src/arm/assembler-arm.h
===================================================================
--- src/arm/assembler-arm.h (revision 4666)
+++ src/arm/assembler-arm.h (working copy)
@@ -458,7 +458,8 @@
return offset_;
}
- Register rm() const {return rm_;}
+ Register rn() const { return rn_; }
+ Register rm() const { return rm_; }
private:
Register rn_; // base
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev