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 1012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1070 // CMP (immediate) - ARM section A8.8.37 | 1074 // CMP (immediate) - ARM section A8.8.37 |
1071 // cmp<c: <Rn>, #<RotatedImm8> | 1075 // cmp<c: <Rn>, #<RotatedImm8> |
1072 // | 1076 // |
1073 // cccc00110101nnnn0000iiiiiiiiiiii where cccc=Cond, dddd=Rd, nnnn=Rn, | 1077 // cccc00110101nnnn0000iiiiiiiiiiii where cccc=Cond, dddd=Rd, nnnn=Rn, |
1074 // s=SetFlags and iiiiiiiiiiii=Src1Value defining RotatedImm8. | 1078 // s=SetFlags and iiiiiiiiiiii=Src1Value defining RotatedImm8. |
1075 constexpr const char *CmpName = "cmp"; | 1079 constexpr const char *CmpName = "cmp"; |
1076 constexpr IValueT CmpOpcode = B3 | B1; // ie. 1010 | 1080 constexpr IValueT CmpOpcode = B3 | B1; // ie. 1010 |
1077 emitCompareOp(Cond, CmpOpcode, OpRn, OpSrc1, CmpName); | 1081 emitCompareOp(Cond, CmpOpcode, OpRn, OpSrc1, CmpName); |
1078 } | 1082 } |
1079 | 1083 |
| 1084 void AssemblerARM32::dmb(IValueT Option) { |
| 1085 // DMB - ARM section A8.8.43, encoding A1: |
| 1086 // dmb <option> |
| 1087 // |
| 1088 // 1111010101111111111100000101xxxx where xxxx=Option. |
| 1089 assert(Utils::IsUint(4, Option) && "Bad dmb option"); |
| 1090 AssemblerBuffer::EnsureCapacity ensured(&Buffer); |
| 1091 const IValueT Encoding = |
| 1092 (encodeCondition(CondARM32::kNone) << kConditionShift) | B26 | B24 | B22 | |
| 1093 B21 | B20 | B19 | B18 | B17 | B16 | B15 | B14 | B13 | B12 | B6 | B4 | |
| 1094 Option; |
| 1095 emitInst(Encoding); |
| 1096 } |
| 1097 |
1080 void AssemblerARM32::eor(const Operand *OpRd, const Operand *OpRn, | 1098 void AssemblerARM32::eor(const Operand *OpRd, const Operand *OpRn, |
1081 const Operand *OpSrc1, bool SetFlags, | 1099 const Operand *OpSrc1, bool SetFlags, |
1082 CondARM32::Cond Cond) { | 1100 CondARM32::Cond Cond) { |
1083 // EOR (register) - ARM section A*.8.47, encoding A1: | 1101 // EOR (register) - ARM section A*.8.47, encoding A1: |
1084 // eor{s}<c> <Rd>, <Rn>, <Rm>{, <shift>} | 1102 // eor{s}<c> <Rd>, <Rn>, <Rm>{, <shift>} |
1085 // | 1103 // |
1086 // cccc0000001snnnnddddiiiiitt0mmmm where cccc=Cond, dddd=Rd, nnnn=Rn, | 1104 // cccc0000001snnnnddddiiiiitt0mmmm where cccc=Cond, dddd=Rd, nnnn=Rn, |
1087 // mmmm=Rm, iiiii=Shift, tt=ShiftKind, and s=SetFlags. | 1105 // mmmm=Rm, iiiii=Shift, tt=ShiftKind, and s=SetFlags. |
1088 // | 1106 // |
1089 // EOR (Immediate) - ARM section A8.*.46, encoding A1: | 1107 // EOR (Immediate) - ARM section A8.*.46, encoding A1: |
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1658 | 1676 |
1659 void AssemblerARM32::uxt(const Operand *OpRd, const Operand *OpSrc0, | 1677 void AssemblerARM32::uxt(const Operand *OpRd, const Operand *OpSrc0, |
1660 CondARM32::Cond Cond) { | 1678 CondARM32::Cond Cond) { |
1661 constexpr const char *UxtName = "uxt"; | 1679 constexpr const char *UxtName = "uxt"; |
1662 constexpr IValueT UxtOpcode = B26 | B25 | B23 | B22 | B21; | 1680 constexpr IValueT UxtOpcode = B26 | B25 | B23 | B22 | B21; |
1663 emitSignExtend(Cond, UxtOpcode, OpRd, OpSrc0, UxtName); | 1681 emitSignExtend(Cond, UxtOpcode, OpRd, OpSrc0, UxtName); |
1664 } | 1682 } |
1665 | 1683 |
1666 } // end of namespace ARM32 | 1684 } // end of namespace ARM32 |
1667 } // end of namespace Ice | 1685 } // end of namespace Ice |
OLD | NEW |