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

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

Issue 1990073002: Add {lda,stl}x?r{,b,h} instructions to ARM64 assembler/disassembler (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: typo Created 4 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
« no previous file with comments | « src/arm64/assembler-arm64.h ('k') | src/arm64/constants-arm64.h » ('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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // 2 //
3 // Redistribution and use in source and binary forms, with or without 3 // Redistribution and use in source and binary forms, with or without
4 // modification, are permitted provided that the following conditions are 4 // modification, are permitted provided that the following conditions are
5 // met: 5 // met:
6 // 6 //
7 // * Redistributions of source code must retain the above copyright 7 // * Redistributions of source code must retain the above copyright
8 // notice, this list of conditions and the following disclaimer. 8 // notice, this list of conditions and the following disclaimer.
9 // * Redistributions in binary form must reproduce the above 9 // * Redistributions in binary form must reproduce the above
10 // copyright notice, this list of conditions and the following 10 // copyright notice, this list of conditions and the following
(...skipping 1698 matching lines...) Expand 10 before | Expand all | Expand 10 after
1709 // Currently we only support 64-bit literals. 1709 // Currently we only support 64-bit literals.
1710 DCHECK(rt.Is64Bits()); 1710 DCHECK(rt.Is64Bits());
1711 1711
1712 RecordRelocInfo(imm.rmode(), imm.value()); 1712 RecordRelocInfo(imm.rmode(), imm.value());
1713 BlockConstPoolFor(1); 1713 BlockConstPoolFor(1);
1714 // The load will be patched when the constpool is emitted, patching code 1714 // The load will be patched when the constpool is emitted, patching code
1715 // expect a load literal with offset 0. 1715 // expect a load literal with offset 0.
1716 ldr_pcrel(rt, 0); 1716 ldr_pcrel(rt, 0);
1717 } 1717 }
1718 1718
1719 void Assembler::ldar(const Register& rt, const Register& rn) {
1720 DCHECK(rn.Is64Bits());
1721 LoadStoreAcquireReleaseOp op = rt.Is32Bits() ? LDAR_w : LDAR_x;
1722 Emit(op | Rs(x31) | Rt2(x31) | Rn(rn) | Rt(rt));
1723 }
1724
1725 void Assembler::ldaxr(const Register& rt, const Register& rn) {
1726 DCHECK(rn.Is64Bits());
1727 LoadStoreAcquireReleaseOp op = rt.Is32Bits() ? LDAXR_w : LDAXR_x;
1728 Emit(op | Rs(x31) | Rt2(x31) | Rn(rn) | Rt(rt));
1729 }
1730
1731 void Assembler::stlr(const Register& rt, const Register& rn) {
1732 DCHECK(rn.Is64Bits());
1733 LoadStoreAcquireReleaseOp op = rt.Is32Bits() ? STLR_w : STLR_x;
1734 Emit(op | Rs(x31) | Rt2(x31) | Rn(rn) | Rt(rt));
1735 }
1736
1737 void Assembler::stlxr(const Register& rs, const Register& rt,
1738 const Register& rn) {
1739 DCHECK(rs.Is32Bits());
1740 DCHECK(rn.Is64Bits());
1741 LoadStoreAcquireReleaseOp op = rt.Is32Bits() ? STLXR_w : STLXR_x;
1742 Emit(op | Rs(rs) | Rt2(x31) | Rn(rn) | Rt(rt));
1743 }
1744
1745 void Assembler::ldarb(const Register& rt, const Register& rn) {
1746 DCHECK(rt.Is32Bits());
1747 DCHECK(rn.Is64Bits());
1748 Emit(LDAR_b | Rs(x31) | Rt2(x31) | Rn(rn) | Rt(rt));
1749 }
1750
1751 void Assembler::ldaxrb(const Register& rt, const Register& rn) {
1752 DCHECK(rt.Is32Bits());
1753 DCHECK(rn.Is64Bits());
1754 Emit(LDAXR_b | Rs(x31) | Rt2(x31) | Rn(rn) | Rt(rt));
1755 }
1756
1757 void Assembler::stlrb(const Register& rt, const Register& rn) {
1758 DCHECK(rt.Is32Bits());
1759 DCHECK(rn.Is64Bits());
1760 Emit(STLR_b | Rs(x31) | Rt2(x31) | Rn(rn) | Rt(rt));
1761 }
1762
1763 void Assembler::stlxrb(const Register& rs, const Register& rt,
1764 const Register& rn) {
1765 DCHECK(rs.Is32Bits());
1766 DCHECK(rt.Is32Bits());
1767 DCHECK(rn.Is64Bits());
1768 Emit(STLXR_b | Rs(rs) | Rt2(x31) | Rn(rn) | Rt(rt));
1769 }
1770
1771 void Assembler::ldarh(const Register& rt, const Register& rn) {
1772 DCHECK(rt.Is32Bits());
1773 DCHECK(rn.Is64Bits());
1774 Emit(LDAR_h | Rs(x31) | Rt2(x31) | Rn(rn) | Rt(rt));
1775 }
1776
1777 void Assembler::ldaxrh(const Register& rt, const Register& rn) {
1778 DCHECK(rt.Is32Bits());
1779 DCHECK(rn.Is64Bits());
1780 Emit(LDAXR_h | Rs(x31) | Rt2(x31) | Rn(rn) | Rt(rt));
1781 }
1782
1783 void Assembler::stlrh(const Register& rt, const Register& rn) {
1784 DCHECK(rt.Is32Bits());
1785 DCHECK(rn.Is64Bits());
1786 Emit(STLR_h | Rs(x31) | Rt2(x31) | Rn(rn) | Rt(rt));
1787 }
1788
1789 void Assembler::stlxrh(const Register& rs, const Register& rt,
1790 const Register& rn) {
1791 DCHECK(rs.Is32Bits());
1792 DCHECK(rt.Is32Bits());
1793 DCHECK(rn.Is64Bits());
1794 Emit(STLXR_h | Rs(rs) | Rt2(x31) | Rn(rn) | Rt(rt));
1795 }
1719 1796
1720 void Assembler::mov(const Register& rd, const Register& rm) { 1797 void Assembler::mov(const Register& rd, const Register& rm) {
1721 // Moves involving the stack pointer are encoded as add immediate with 1798 // Moves involving the stack pointer are encoded as add immediate with
1722 // second operand of zero. Otherwise, orr with first operand zr is 1799 // second operand of zero. Otherwise, orr with first operand zr is
1723 // used. 1800 // used.
1724 if (rd.IsSP() || rm.IsSP()) { 1801 if (rd.IsSP() || rm.IsSP()) {
1725 add(rd, rm, 0); 1802 add(rd, rm, 0);
1726 } else { 1803 } else {
1727 orr(rd, AppropriateZeroRegFor(rd), rm); 1804 orr(rd, AppropriateZeroRegFor(rd), rm);
1728 } 1805 }
(...skipping 1433 matching lines...) Expand 10 before | Expand all | Expand 10 after
3162 movk(scratch, (target_offset >> 32) & 0xFFFF, 32); 3239 movk(scratch, (target_offset >> 32) & 0xFFFF, 32);
3163 DCHECK((target_offset >> 48) == 0); 3240 DCHECK((target_offset >> 48) == 0);
3164 add(rd, rd, scratch); 3241 add(rd, rd, scratch);
3165 } 3242 }
3166 3243
3167 3244
3168 } // namespace internal 3245 } // namespace internal
3169 } // namespace v8 3246 } // namespace v8
3170 3247
3171 #endif // V8_TARGET_ARCH_ARM64 3248 #endif // V8_TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « src/arm64/assembler-arm64.h ('k') | src/arm64/constants-arm64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698