OLD | NEW |
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 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 } else { | 347 } else { |
348 // no relocation needed | 348 // no relocation needed |
349 imm32_ = reinterpret_cast<intptr_t>(obj); | 349 imm32_ = reinterpret_cast<intptr_t>(obj); |
350 rmode_ = RelocInfo::NONE32; | 350 rmode_ = RelocInfo::NONE32; |
351 } | 351 } |
352 } | 352 } |
353 | 353 |
354 | 354 |
355 Operand::Operand(Register rm, ShiftOp shift_op, int shift_imm) { | 355 Operand::Operand(Register rm, ShiftOp shift_op, int shift_imm) { |
356 ASSERT(is_uint5(shift_imm)); | 356 ASSERT(is_uint5(shift_imm)); |
357 ASSERT(shift_op != ROR || shift_imm != 0); // use RRX if you mean it | 357 |
358 rm_ = rm; | 358 rm_ = rm; |
359 rs_ = no_reg; | 359 rs_ = no_reg; |
360 shift_op_ = shift_op; | 360 shift_op_ = shift_op; |
361 shift_imm_ = shift_imm & 31; | 361 shift_imm_ = shift_imm & 31; |
362 if (shift_op == RRX) { | 362 |
| 363 if ((shift_op == ROR) && (shift_imm == 0)) { |
| 364 // ROR #0 is functionally equivalent to LSL #0 and this allow us to encode |
| 365 // RRX as ROR #0 (See below). |
| 366 shift_op = LSL; |
| 367 } else if (shift_op == RRX) { |
363 // encoded as ROR with shift_imm == 0 | 368 // encoded as ROR with shift_imm == 0 |
364 ASSERT(shift_imm == 0); | 369 ASSERT(shift_imm == 0); |
365 shift_op_ = ROR; | 370 shift_op_ = ROR; |
366 shift_imm_ = 0; | 371 shift_imm_ = 0; |
367 } | 372 } |
368 } | 373 } |
369 | 374 |
370 | 375 |
371 Operand::Operand(Register rm, ShiftOp shift_op, Register rs) { | 376 Operand::Operand(Register rm, ShiftOp shift_op, Register rs) { |
372 ASSERT(shift_op != RRX); | 377 ASSERT(shift_op != RRX); |
(...skipping 1408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1781 // cond(31-28) | 01101110(27-20) | 1111(19-16) | | 1786 // cond(31-28) | 01101110(27-20) | 1111(19-16) | |
1782 // Rd(15-12) | rotate(11-10) | 00(9-8)| 0111(7-4) | Rm(3-0) | 1787 // Rd(15-12) | rotate(11-10) | 00(9-8)| 0111(7-4) | Rm(3-0) |
1783 ASSERT(!dst.is(pc)); | 1788 ASSERT(!dst.is(pc)); |
1784 ASSERT(!src.rm().is(pc)); | 1789 ASSERT(!src.rm().is(pc)); |
1785 ASSERT(!src.rm().is(no_reg)); | 1790 ASSERT(!src.rm().is(no_reg)); |
1786 ASSERT(src.rs().is(no_reg)); | 1791 ASSERT(src.rs().is(no_reg)); |
1787 ASSERT((src.shift_imm_ == 0) || | 1792 ASSERT((src.shift_imm_ == 0) || |
1788 (src.shift_imm_ == 8) || | 1793 (src.shift_imm_ == 8) || |
1789 (src.shift_imm_ == 16) || | 1794 (src.shift_imm_ == 16) || |
1790 (src.shift_imm_ == 24)); | 1795 (src.shift_imm_ == 24)); |
1791 ASSERT(src.shift_op() == ROR); | 1796 // Operand maps ROR #0 to LSL #0. |
| 1797 ASSERT((src.shift_op() == ROR) || |
| 1798 ((src.shift_op() == LSL) && (src.shift_imm_ == 0))); |
1792 emit(cond | 0x6E*B20 | 0xF*B16 | dst.code()*B12 | | 1799 emit(cond | 0x6E*B20 | 0xF*B16 | dst.code()*B12 | |
1793 ((src.shift_imm_ >> 1)&0xC)*B8 | 7*B4 | src.rm().code()); | 1800 ((src.shift_imm_ >> 1)&0xC)*B8 | 7*B4 | src.rm().code()); |
1794 } | 1801 } |
1795 | 1802 |
1796 | 1803 |
1797 void Assembler::uxtab(Register dst, | 1804 void Assembler::uxtab(Register dst, |
1798 Register src1, | 1805 Register src1, |
1799 const Operand& src2, | 1806 const Operand& src2, |
1800 Condition cond) { | 1807 Condition cond) { |
1801 // Instruction details available in ARM DDI 0406C.b, A8.8.271. | 1808 // Instruction details available in ARM DDI 0406C.b, A8.8.271. |
1802 // cond(31-28) | 01101110(27-20) | Rn(19-16) | | 1809 // cond(31-28) | 01101110(27-20) | Rn(19-16) | |
1803 // Rd(15-12) | rotate(11-10) | 00(9-8)| 0111(7-4) | Rm(3-0) | 1810 // Rd(15-12) | rotate(11-10) | 00(9-8)| 0111(7-4) | Rm(3-0) |
1804 ASSERT(!dst.is(pc)); | 1811 ASSERT(!dst.is(pc)); |
1805 ASSERT(!src1.is(pc)); | 1812 ASSERT(!src1.is(pc)); |
1806 ASSERT(!src2.rm().is(pc)); | 1813 ASSERT(!src2.rm().is(pc)); |
1807 ASSERT(!src2.rm().is(no_reg)); | 1814 ASSERT(!src2.rm().is(no_reg)); |
1808 ASSERT(src2.rs().is(no_reg)); | 1815 ASSERT(src2.rs().is(no_reg)); |
1809 ASSERT((src2.shift_imm_ == 0) || | 1816 ASSERT((src2.shift_imm_ == 0) || |
1810 (src2.shift_imm_ == 8) || | 1817 (src2.shift_imm_ == 8) || |
1811 (src2.shift_imm_ == 16) || | 1818 (src2.shift_imm_ == 16) || |
1812 (src2.shift_imm_ == 24)); | 1819 (src2.shift_imm_ == 24)); |
1813 ASSERT(src2.shift_op() == ROR); | 1820 // Operand maps ROR #0 to LSL #0. |
| 1821 ASSERT((src2.shift_op() == ROR) || |
| 1822 ((src2.shift_op() == LSL) && (src2.shift_imm_ == 0))); |
1814 emit(cond | 0x6E*B20 | src1.code()*B16 | dst.code()*B12 | | 1823 emit(cond | 0x6E*B20 | src1.code()*B16 | dst.code()*B12 | |
1815 ((src2.shift_imm_ >> 1) &0xC)*B8 | 7*B4 | src2.rm().code()); | 1824 ((src2.shift_imm_ >> 1) &0xC)*B8 | 7*B4 | src2.rm().code()); |
1816 } | 1825 } |
1817 | 1826 |
1818 | 1827 |
1819 void Assembler::uxtb16(Register dst, | 1828 void Assembler::uxtb16(Register dst, |
1820 const Operand& src, | 1829 const Operand& src, |
1821 Condition cond) { | 1830 Condition cond) { |
1822 // Instruction details available in ARM DDI 0406C.b, A8.8.275. | 1831 // Instruction details available in ARM DDI 0406C.b, A8.8.275. |
1823 // cond(31-28) | 01101100(27-20) | 1111(19-16) | | 1832 // cond(31-28) | 01101100(27-20) | 1111(19-16) | |
1824 // Rd(15-12) | rotate(11-10) | 00(9-8)| 0111(7-4) | Rm(3-0) | 1833 // Rd(15-12) | rotate(11-10) | 00(9-8)| 0111(7-4) | Rm(3-0) |
1825 ASSERT(!dst.is(pc)); | 1834 ASSERT(!dst.is(pc)); |
1826 ASSERT(!src.rm().is(pc)); | 1835 ASSERT(!src.rm().is(pc)); |
1827 ASSERT(!src.rm().is(no_reg)); | 1836 ASSERT(!src.rm().is(no_reg)); |
1828 ASSERT(src.rs().is(no_reg)); | 1837 ASSERT(src.rs().is(no_reg)); |
1829 ASSERT((src.shift_imm_ == 0) || | 1838 ASSERT((src.shift_imm_ == 0) || |
1830 (src.shift_imm_ == 8) || | 1839 (src.shift_imm_ == 8) || |
1831 (src.shift_imm_ == 16) || | 1840 (src.shift_imm_ == 16) || |
1832 (src.shift_imm_ == 24)); | 1841 (src.shift_imm_ == 24)); |
1833 ASSERT(src.shift_op() == ROR); | 1842 // Operand maps ROR #0 to LSL #0. |
| 1843 ASSERT((src.shift_op() == ROR) || |
| 1844 ((src.shift_op() == LSL) && (src.shift_imm_ == 0))); |
1834 emit(cond | 0x6C*B20 | 0xF*B16 | dst.code()*B12 | | 1845 emit(cond | 0x6C*B20 | 0xF*B16 | dst.code()*B12 | |
1835 ((src.shift_imm_ >> 1)&0xC)*B8 | 7*B4 | src.rm().code()); | 1846 ((src.shift_imm_ >> 1)&0xC)*B8 | 7*B4 | src.rm().code()); |
1836 } | 1847 } |
1837 | 1848 |
1838 | 1849 |
1839 // Status register access instructions. | 1850 // Status register access instructions. |
1840 void Assembler::mrs(Register dst, SRegister s, Condition cond) { | 1851 void Assembler::mrs(Register dst, SRegister s, Condition cond) { |
1841 ASSERT(!dst.is(pc)); | 1852 ASSERT(!dst.is(pc)); |
1842 emit(cond | B24 | s | 15*B16 | dst.code()*B12); | 1853 emit(cond | B24 | s | 15*B16 | dst.code()*B12); |
1843 } | 1854 } |
(...skipping 1877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3721 ASSERT((index_64bit == count_of_64bit_) && | 3732 ASSERT((index_64bit == count_of_64bit_) && |
3722 (index_code_ptr == (index_64bit + count_of_code_ptr_)) && | 3733 (index_code_ptr == (index_64bit + count_of_code_ptr_)) && |
3723 (index_heap_ptr == (index_code_ptr + count_of_heap_ptr_)) && | 3734 (index_heap_ptr == (index_code_ptr + count_of_heap_ptr_)) && |
3724 (index_32bit == (index_heap_ptr + count_of_32bit_))); | 3735 (index_32bit == (index_heap_ptr + count_of_32bit_))); |
3725 } | 3736 } |
3726 | 3737 |
3727 | 3738 |
3728 } } // namespace v8::internal | 3739 } } // namespace v8::internal |
3729 | 3740 |
3730 #endif // V8_TARGET_ARCH_ARM | 3741 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |