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 27 matching lines...) Expand all Loading... |
38 static constexpr IValueT B2 = 1 << 2; | 38 static constexpr IValueT B2 = 1 << 2; |
39 static constexpr IValueT B3 = 1 << 3; | 39 static constexpr IValueT B3 = 1 << 3; |
40 static constexpr IValueT B4 = 1 << 4; | 40 static constexpr IValueT B4 = 1 << 4; |
41 static constexpr IValueT B5 = 1 << 5; | 41 static constexpr IValueT B5 = 1 << 5; |
42 static constexpr IValueT B6 = 1 << 6; | 42 static constexpr IValueT B6 = 1 << 6; |
43 static constexpr IValueT B7 = 1 << 7; | 43 static constexpr IValueT B7 = 1 << 7; |
44 static constexpr IValueT B12 = 1 << 12; | 44 static constexpr IValueT B12 = 1 << 12; |
45 static constexpr IValueT B13 = 1 << 13; | 45 static constexpr IValueT B13 = 1 << 13; |
46 static constexpr IValueT B14 = 1 << 14; | 46 static constexpr IValueT B14 = 1 << 14; |
47 static constexpr IValueT B15 = 1 << 15; | 47 static constexpr IValueT B15 = 1 << 15; |
| 48 static constexpr IValueT B16 = 1 << 16; |
| 49 static constexpr IValueT B17 = 1 << 17; |
| 50 static constexpr IValueT B18 = 1 << 18; |
| 51 static constexpr IValueT B19 = 1 << 19; |
48 static constexpr IValueT B20 = 1 << 20; | 52 static constexpr IValueT B20 = 1 << 20; |
49 static constexpr IValueT B21 = 1 << 21; | 53 static constexpr IValueT B21 = 1 << 21; |
50 static constexpr IValueT B22 = 1 << 22; | 54 static constexpr IValueT B22 = 1 << 22; |
51 static constexpr IValueT B23 = 1 << 23; | 55 static constexpr IValueT B23 = 1 << 23; |
52 static constexpr IValueT B24 = 1 << 24; | 56 static constexpr IValueT B24 = 1 << 24; |
53 static constexpr IValueT B25 = 1 << 25; | 57 static constexpr IValueT B25 = 1 << 25; |
54 static constexpr IValueT B26 = 1 << 26; | 58 static constexpr IValueT B26 = 1 << 26; |
55 static constexpr IValueT B27 = 1 << 27; | 59 static constexpr IValueT B27 = 1 << 27; |
56 | 60 |
57 // Constants used for the decoding or encoding of the individual fields of | 61 // Constants used for the decoding or encoding of the individual fields of |
(...skipping 1023 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1081 // CMP (immediate) - ARM section A8.8.37 | 1085 // CMP (immediate) - ARM section A8.8.37 |
1082 // cmp<c: <Rn>, #<RotatedImm8> | 1086 // cmp<c: <Rn>, #<RotatedImm8> |
1083 // | 1087 // |
1084 // cccc00110101nnnn0000iiiiiiiiiiii where cccc=Cond, dddd=Rd, nnnn=Rn, | 1088 // cccc00110101nnnn0000iiiiiiiiiiii where cccc=Cond, dddd=Rd, nnnn=Rn, |
1085 // s=SetFlags and iiiiiiiiiiii=Src1Value defining RotatedImm8. | 1089 // s=SetFlags and iiiiiiiiiiii=Src1Value defining RotatedImm8. |
1086 constexpr const char *CmpName = "cmp"; | 1090 constexpr const char *CmpName = "cmp"; |
1087 constexpr IValueT CmpOpcode = B3 | B1; // ie. 1010 | 1091 constexpr IValueT CmpOpcode = B3 | B1; // ie. 1010 |
1088 emitCompareOp(Cond, CmpOpcode, OpRn, OpSrc1, CmpName); | 1092 emitCompareOp(Cond, CmpOpcode, OpRn, OpSrc1, CmpName); |
1089 } | 1093 } |
1090 | 1094 |
| 1095 void AssemblerARM32::dmb(IValueT Option) { |
| 1096 // DMB - ARM section A8.8.43, encoding A1: |
| 1097 // dmb <option> |
| 1098 // |
| 1099 // 1111010101111111111100000101xxxx where xxxx=Option. |
| 1100 assert(Utils::IsUint(4, Option) && "Bad dmb option"); |
| 1101 AssemblerBuffer::EnsureCapacity ensured(&Buffer); |
| 1102 const IValueT Encoding = |
| 1103 (encodeCondition(CondARM32::kNone) << kConditionShift) | B26 | B24 | B22 | |
| 1104 B21 | B20 | B19 | B18 | B17 | B16 | B15 | B14 | B13 | B12 | B6 | B4 | |
| 1105 Option; |
| 1106 emitInst(Encoding); |
| 1107 } |
| 1108 |
1091 void AssemblerARM32::eor(const Operand *OpRd, const Operand *OpRn, | 1109 void AssemblerARM32::eor(const Operand *OpRd, const Operand *OpRn, |
1092 const Operand *OpSrc1, bool SetFlags, | 1110 const Operand *OpSrc1, bool SetFlags, |
1093 CondARM32::Cond Cond) { | 1111 CondARM32::Cond Cond) { |
1094 // EOR (register) - ARM section A*.8.47, encoding A1: | 1112 // EOR (register) - ARM section A*.8.47, encoding A1: |
1095 // eor{s}<c> <Rd>, <Rn>, <Rm>{, <shift>} | 1113 // eor{s}<c> <Rd>, <Rn>, <Rm>{, <shift>} |
1096 // | 1114 // |
1097 // cccc0000001snnnnddddiiiiitt0mmmm where cccc=Cond, dddd=Rd, nnnn=Rn, | 1115 // cccc0000001snnnnddddiiiiitt0mmmm where cccc=Cond, dddd=Rd, nnnn=Rn, |
1098 // mmmm=Rm, iiiii=Shift, tt=ShiftKind, and s=SetFlags. | 1116 // mmmm=Rm, iiiii=Shift, tt=ShiftKind, and s=SetFlags. |
1099 // | 1117 // |
1100 // EOR (Immediate) - ARM section A8.*.46, encoding A1: | 1118 // EOR (Immediate) - ARM section A8.*.46, encoding A1: |
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1686 | 1704 |
1687 void AssemblerARM32::uxt(const Operand *OpRd, const Operand *OpSrc0, | 1705 void AssemblerARM32::uxt(const Operand *OpRd, const Operand *OpSrc0, |
1688 CondARM32::Cond Cond) { | 1706 CondARM32::Cond Cond) { |
1689 constexpr const char *UxtName = "uxt"; | 1707 constexpr const char *UxtName = "uxt"; |
1690 constexpr IValueT UxtOpcode = B26 | B25 | B23 | B22 | B21; | 1708 constexpr IValueT UxtOpcode = B26 | B25 | B23 | B22 | B21; |
1691 emitSignExtend(Cond, UxtOpcode, OpRd, OpSrc0, UxtName); | 1709 emitSignExtend(Cond, UxtOpcode, OpRd, OpSrc0, UxtName); |
1692 } | 1710 } |
1693 | 1711 |
1694 } // end of namespace ARM32 | 1712 } // end of namespace ARM32 |
1695 } // end of namespace Ice | 1713 } // end of namespace Ice |
OLD | NEW |