OLD | NEW |
1 //===- subzero/src/IceAssemblerARM32.cpp - Assembler for ARM32 --*- C++ -*-===// | 1 //===- subzero/src/IceAssemblerARM32.cpp - Assembler for ARM32 --*- C++ -*-===// |
2 // | 2 // |
3 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 3 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
4 // for details. All rights reserved. Use of this source code is governed by a | 4 // for details. All rights reserved. Use of this source code is governed by a |
5 // BSD-style license that can be found in the LICENSE file. | 5 // BSD-style license that can be found in the LICENSE file. |
6 // | 6 // |
7 // Modified by the Subzero authors. | 7 // Modified by the Subzero authors. |
8 // | 8 // |
9 //===----------------------------------------------------------------------===// | 9 //===----------------------------------------------------------------------===// |
10 // | 10 // |
(...skipping 1593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1604 // rsb{s}<c> <Rd>, <Rn>, <Rm>{, <Shift>} | 1604 // rsb{s}<c> <Rd>, <Rn>, <Rm>{, <Shift>} |
1605 // | 1605 // |
1606 // cccc0000011snnnnddddiiiiitt0mmmm where cccc=Cond, dddd=Rd, nnnn=Rn, | 1606 // cccc0000011snnnnddddiiiiitt0mmmm where cccc=Cond, dddd=Rd, nnnn=Rn, |
1607 // mmmm=Rm, iiiii=shift, tt==ShiftKind, and s=SetFlags. | 1607 // mmmm=Rm, iiiii=shift, tt==ShiftKind, and s=SetFlags. |
1608 constexpr const char *RsbName = "rsb"; | 1608 constexpr const char *RsbName = "rsb"; |
1609 constexpr IValueT RsbOpcode = B1 | B0; // 0011 | 1609 constexpr IValueT RsbOpcode = B1 | B0; // 0011 |
1610 emitType01(Cond, RsbOpcode, OpRd, OpRn, OpSrc1, SetFlags, RdIsPcAndSetFlags, | 1610 emitType01(Cond, RsbOpcode, OpRd, OpRn, OpSrc1, SetFlags, RdIsPcAndSetFlags, |
1611 RsbName); | 1611 RsbName); |
1612 } | 1612 } |
1613 | 1613 |
| 1614 void AssemblerARM32::rsc(const Operand *OpRd, const Operand *OpRn, |
| 1615 const Operand *OpSrc1, bool SetFlags, |
| 1616 CondARM32::Cond Cond) { |
| 1617 // RSC (immediate) - ARM section A8.8.155, encoding A1: |
| 1618 // rsc{s}<c> <Rd>, <Rn>, #<RotatedImm8> |
| 1619 // |
| 1620 // cccc0010111snnnnddddiiiiiiiiiiii where cccc=Cond, dddd=Rd, nnnn=Rn, |
| 1621 // mmmm=Rm, iiiii=shift, tt=ShiftKind, and s=SetFlags. |
| 1622 // |
| 1623 // RSC (register) - ARM section A8.8.156, encoding A1: |
| 1624 // rsc{s}<c> <Rd>, <Rn>, <Rm>{, <shift>} |
| 1625 // |
| 1626 // cccc0000111snnnnddddiiiiitt0mmmm where cccc=Cond, dddd=Rd, nnnn=Rn, |
| 1627 // mmmm=Rm, iiiii=shift, tt=ShiftKind, and s=SetFlags. |
| 1628 // |
| 1629 // RSC (register-shifted register) - ARM section A8.8.157, encoding A1: |
| 1630 // rsc{s}<c> <Rd>, <Rn>, <Rm>, <type> <Rs> |
| 1631 // |
| 1632 // cccc0000111fnnnnddddssss0tt1mmmm where cccc=Cond, dddd=Rd, nnnn=Rn, |
| 1633 // mmmm=Rm, ssss=Rs, tt defined <type>, and f=SetFlags. |
| 1634 constexpr const char *RscName = "rsc"; |
| 1635 constexpr IValueT RscOpcode = B2 | B1 | B0; // i.e. 0111. |
| 1636 emitType01(Cond, RscOpcode, OpRd, OpRn, OpSrc1, SetFlags, RdIsPcAndSetFlags, |
| 1637 RscName); |
| 1638 } |
| 1639 |
1614 void AssemblerARM32::sxt(const Operand *OpRd, const Operand *OpSrc0, | 1640 void AssemblerARM32::sxt(const Operand *OpRd, const Operand *OpSrc0, |
1615 CondARM32::Cond Cond) { | 1641 CondARM32::Cond Cond) { |
1616 constexpr const char *SxtName = "sxt"; | 1642 constexpr const char *SxtName = "sxt"; |
1617 constexpr IValueT SxtOpcode = B26 | B25 | B23 | B21; | 1643 constexpr IValueT SxtOpcode = B26 | B25 | B23 | B21; |
1618 emitSignExtend(Cond, SxtOpcode, OpRd, OpSrc0, SxtName); | 1644 emitSignExtend(Cond, SxtOpcode, OpRd, OpSrc0, SxtName); |
1619 } | 1645 } |
1620 | 1646 |
1621 void AssemblerARM32::sub(const Operand *OpRd, const Operand *OpRn, | 1647 void AssemblerARM32::sub(const Operand *OpRd, const Operand *OpRn, |
1622 const Operand *OpSrc1, bool SetFlags, | 1648 const Operand *OpSrc1, bool SetFlags, |
1623 CondARM32::Cond Cond) { | 1649 CondARM32::Cond Cond) { |
1624 // SUB (register) - ARM section A8.8.223, encoding A1: | 1650 // SUB (register) - ARM section A8.8.223, encoding A1: |
1625 // sub{s}<c> <Rd>, <Rn>, <Rm>{, <shift>} | 1651 // sub{s}<c> <Rd>, <Rn>, <Rm>{, <shift>} |
1626 // SUB (SP minus register): See ARM section 8.8.226, encoding A1: | 1652 // SUB (SP minus register): See ARM section 8.8.226, encoding A1: |
1627 // sub{s}<c> <Rd>, sp, <Rm>{, <Shift>} | 1653 // sub{s}<c> <Rd>, sp, <Rm>{, <Shift>} |
1628 // | 1654 // |
1629 // cccc0000010snnnnddddiiiiitt0mmmm where cccc=Cond, dddd=Rd, nnnn=Rn, | 1655 // cccc0000010snnnnddddiiiiitt0mmmm where cccc=Cond, dddd=Rd, nnnn=Rn, |
1630 // mmmm=Rm, iiiii=shift, tt=ShiftKind, and s=SetFlags. | 1656 // mmmm=Rm, iiiii=shift, tt=ShiftKind, and s=SetFlags. |
1631 // | 1657 // |
1632 // Sub (Immediate) - ARM section A8.8.222, encoding A1: | 1658 // Sub (Immediate) - ARM section A8.8.222, encoding A1: |
1633 // sub{s}<c> <Rd>, <Rn>, #<RotatedImm8> | 1659 // sub{s}<c> <Rd>, <Rn>, #<RotatedImm8> |
1634 // Sub (Sp minus immediate) - ARM section A8.*.225, encoding A1: | 1660 // Sub (Sp minus immediate) - ARM section A8.8.225, encoding A1: |
1635 // sub{s}<c> sp, <Rn>, #<RotatedImm8> | 1661 // sub{s}<c> sp, <Rn>, #<RotatedImm8> |
1636 // | 1662 // |
1637 // cccc0010010snnnnddddiiiiiiiiiiii where cccc=Cond, dddd=Rd, nnnn=Rn, | 1663 // cccc0010010snnnnddddiiiiiiiiiiii where cccc=Cond, dddd=Rd, nnnn=Rn, |
1638 // s=SetFlags and iiiiiiiiiiii=Src1Value defining RotatedImm8 | 1664 // s=SetFlags and iiiiiiiiiiii=Src1Value defining RotatedImm8 |
1639 constexpr const char *SubName = "sub"; | 1665 constexpr const char *SubName = "sub"; |
1640 constexpr IValueT SubOpcode = B1; // 0010 | 1666 constexpr IValueT SubOpcode = B1; // 0010 |
1641 emitType01(Cond, SubOpcode, OpRd, OpRn, OpSrc1, SetFlags, RdIsPcAndSetFlags, | 1667 emitType01(Cond, SubOpcode, OpRd, OpRn, OpSrc1, SetFlags, RdIsPcAndSetFlags, |
1642 SubName); | 1668 SubName); |
1643 } | 1669 } |
1644 | 1670 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1704 | 1730 |
1705 void AssemblerARM32::uxt(const Operand *OpRd, const Operand *OpSrc0, | 1731 void AssemblerARM32::uxt(const Operand *OpRd, const Operand *OpSrc0, |
1706 CondARM32::Cond Cond) { | 1732 CondARM32::Cond Cond) { |
1707 constexpr const char *UxtName = "uxt"; | 1733 constexpr const char *UxtName = "uxt"; |
1708 constexpr IValueT UxtOpcode = B26 | B25 | B23 | B22 | B21; | 1734 constexpr IValueT UxtOpcode = B26 | B25 | B23 | B22 | B21; |
1709 emitSignExtend(Cond, UxtOpcode, OpRd, OpSrc0, UxtName); | 1735 emitSignExtend(Cond, UxtOpcode, OpRd, OpSrc0, UxtName); |
1710 } | 1736 } |
1711 | 1737 |
1712 } // end of namespace ARM32 | 1738 } // end of namespace ARM32 |
1713 } // end of namespace Ice | 1739 } // end of namespace Ice |
OLD | NEW |