Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 647 } | 647 } |
| 648 | 648 |
| 649 | 649 |
| 650 void MacroAssembler::Ldrd(Register dst1, Register dst2, | 650 void MacroAssembler::Ldrd(Register dst1, Register dst2, |
| 651 const MemOperand& src, Condition cond) { | 651 const MemOperand& src, Condition cond) { |
| 652 ASSERT(src.rm().is(no_reg)); | 652 ASSERT(src.rm().is(no_reg)); |
| 653 ASSERT(!dst1.is(lr)); // r14. | 653 ASSERT(!dst1.is(lr)); // r14. |
| 654 ASSERT_EQ(0, dst1.code() % 2); | 654 ASSERT_EQ(0, dst1.code() % 2); |
| 655 ASSERT_EQ(dst1.code() + 1, dst2.code()); | 655 ASSERT_EQ(dst1.code() + 1, dst2.code()); |
| 656 | 656 |
| 657 // V8 does not use this addressing mode, so the fallback code | |
| 658 // below doesn't support it yet. | |
| 659 ASSERT((src.am() != PreIndex) && (src.am() != NegPreIndex)); | |
| 660 | |
| 657 // Generate two ldr instructions if ldrd is not available. | 661 // Generate two ldr instructions if ldrd is not available. |
| 658 if (CpuFeatures::IsSupported(ARMv7)) { | 662 if (CpuFeatures::IsSupported(ARMv7)) { |
| 659 CpuFeatures::Scope scope(ARMv7); | 663 CpuFeatures::Scope scope(ARMv7); |
| 660 ldrd(dst1, dst2, src, cond); | 664 ldrd(dst1, dst2, src, cond); |
| 661 } else { | 665 } else { |
| 662 MemOperand src2(src); | 666 MemOperand src2(src); |
|
Søren Thygesen Gjesse
2011/06/14 10:44:01
Please move the declaration of src2 closer to wher
m.m.capewell
2011/06/22 12:42:36
Done.
| |
| 663 src2.set_offset(src2.offset() + 4); | 667 if ((src.am() == Offset) || (src.am() == NegOffset)) { |
| 664 if (dst1.is(src.rn())) { | 668 src2.set_offset(src2.offset() + 4); |
| 665 ldr(dst2, src2, cond); | 669 if (dst1.is(src.rn())) { |
| 666 ldr(dst1, src, cond); | 670 ldr(dst2, src2, cond); |
| 667 } else { | 671 ldr(dst1, src, cond); |
| 668 ldr(dst1, src, cond); | 672 } else { |
| 669 ldr(dst2, src2, cond); | 673 ldr(dst1, src, cond); |
| 674 ldr(dst2, src2, cond); | |
| 675 } | |
| 676 } else { // PostIndex or NegPostIndex. | |
|
Søren Thygesen Gjesse
2011/06/14 10:44:01
Please assert PostIndex or NegPostIndex.
m.m.capewell
2011/06/22 12:42:36
Done.
| |
| 677 if (dst1.is(src.rn())) { | |
| 678 ldr(dst2, MemOperand(src.rn(), 4, Offset), cond); | |
| 679 ldr(dst1, src, cond); | |
| 680 } else { | |
| 681 src2.set_offset(src2.offset() - 4); | |
| 682 ldr(dst1, MemOperand(src.rn(), 4, PostIndex), cond); | |
| 683 ldr(dst2, src2, cond); | |
| 684 } | |
| 670 } | 685 } |
| 671 } | 686 } |
| 672 } | 687 } |
| 673 | 688 |
| 674 | 689 |
| 675 void MacroAssembler::Strd(Register src1, Register src2, | 690 void MacroAssembler::Strd(Register src1, Register src2, |
| 676 const MemOperand& dst, Condition cond) { | 691 const MemOperand& dst, Condition cond) { |
| 677 ASSERT(dst.rm().is(no_reg)); | 692 ASSERT(dst.rm().is(no_reg)); |
| 678 ASSERT(!src1.is(lr)); // r14. | 693 ASSERT(!src1.is(lr)); // r14. |
| 679 ASSERT_EQ(0, src1.code() % 2); | 694 ASSERT_EQ(0, src1.code() % 2); |
| 680 ASSERT_EQ(src1.code() + 1, src2.code()); | 695 ASSERT_EQ(src1.code() + 1, src2.code()); |
| 681 | 696 |
| 697 // V8 does not use this addressing mode, so the fallback code | |
| 698 // below doesn't support it yet. | |
| 699 ASSERT((dst.am() != PreIndex) && (dst.am() != NegPreIndex)); | |
| 700 | |
| 682 // Generate two str instructions if strd is not available. | 701 // Generate two str instructions if strd is not available. |
| 683 if (CpuFeatures::IsSupported(ARMv7)) { | 702 if (CpuFeatures::IsSupported(ARMv7)) { |
| 684 CpuFeatures::Scope scope(ARMv7); | 703 CpuFeatures::Scope scope(ARMv7); |
| 685 strd(src1, src2, dst, cond); | 704 strd(src1, src2, dst, cond); |
| 686 } else { | 705 } else { |
| 687 MemOperand dst2(dst); | 706 MemOperand dst2(dst); |
| 688 dst2.set_offset(dst2.offset() + 4); | 707 if ((dst.am() == Offset) || (dst.am() == NegOffset)) { |
| 689 str(src1, dst, cond); | 708 dst2.set_offset(dst2.offset() + 4); |
| 690 str(src2, dst2, cond); | 709 str(src1, dst, cond); |
| 710 str(src2, dst2, cond); | |
| 711 } else { // PostIndex or NegPostIndex. | |
|
Søren Thygesen Gjesse
2011/06/14 10:44:01
Please assert PostIndex or NegPostIndex.
m.m.capewell
2011/06/22 12:42:36
Done.
| |
| 712 dst2.set_offset(dst2.offset() - 4); | |
| 713 str(src1, MemOperand(dst.rn(), 4, PostIndex), cond); | |
| 714 str(src2, dst2, cond); | |
| 715 } | |
| 691 } | 716 } |
| 692 } | 717 } |
| 693 | 718 |
| 694 | 719 |
| 695 void MacroAssembler::ClearFPSCRBits(const uint32_t bits_to_clear, | 720 void MacroAssembler::ClearFPSCRBits(const uint32_t bits_to_clear, |
| 696 const Register scratch, | 721 const Register scratch, |
| 697 const Condition cond) { | 722 const Condition cond) { |
| 698 vmrs(scratch, cond); | 723 vmrs(scratch, cond); |
| 699 bic(scratch, scratch, Operand(bits_to_clear), LeaveCC, cond); | 724 bic(scratch, scratch, Operand(bits_to_clear), LeaveCC, cond); |
| 700 vmsr(scratch, cond); | 725 vmsr(scratch, cond); |
| (...skipping 2456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3157 void CodePatcher::EmitCondition(Condition cond) { | 3182 void CodePatcher::EmitCondition(Condition cond) { |
| 3158 Instr instr = Assembler::instr_at(masm_.pc_); | 3183 Instr instr = Assembler::instr_at(masm_.pc_); |
| 3159 instr = (instr & ~kCondMask) | cond; | 3184 instr = (instr & ~kCondMask) | cond; |
| 3160 masm_.emit(instr); | 3185 masm_.emit(instr); |
| 3161 } | 3186 } |
| 3162 | 3187 |
| 3163 | 3188 |
| 3164 } } // namespace v8::internal | 3189 } } // namespace v8::internal |
| 3165 | 3190 |
| 3166 #endif // V8_TARGET_ARCH_ARM | 3191 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |