Chromium Code Reviews| 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 30 matching lines...) Expand all Loading... | |
| 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 B20 = 1 << 20; | 48 static constexpr IValueT B20 = 1 << 20; |
| 49 static constexpr IValueT B21 = 1 << 21; | 49 static constexpr IValueT B21 = 1 << 21; |
| 50 static constexpr IValueT B22 = 1 << 22; | 50 static constexpr IValueT B22 = 1 << 22; |
| 51 static constexpr IValueT B23 = 1 << 23; | |
| 51 static constexpr IValueT B24 = 1 << 24; | 52 static constexpr IValueT B24 = 1 << 24; |
| 52 static constexpr IValueT B25 = 1 << 25; | 53 static constexpr IValueT B25 = 1 << 25; |
| 53 static constexpr IValueT B26 = 1 << 26; | 54 static constexpr IValueT B26 = 1 << 26; |
| 54 static constexpr IValueT B27 = 1 << 27; | 55 static constexpr IValueT B27 = 1 << 27; |
| 55 | 56 |
| 56 // Constants used for the decoding or encoding of the individual fields of | 57 // Constants used for the decoding or encoding of the individual fields of |
| 57 // instructions. Based on ARM section A5.1. | 58 // instructions. Based on ARM section A5.1. |
| 58 static constexpr IValueT L = 1 << 20; // load (or store) | 59 static constexpr IValueT L = 1 << 20; // load (or store) |
| 59 static constexpr IValueT W = 1 << 21; // writeback base register | 60 static constexpr IValueT W = 1 << 21; // writeback base register |
| 60 // (or leave unchanged) | 61 // (or leave unchanged) |
| (...skipping 980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1041 // | 1042 // |
| 1042 // TST (immediate) - ARM section A8.8.240, encoding A1: | 1043 // TST (immediate) - ARM section A8.8.240, encoding A1: |
| 1043 // tst<c> <Rn>, #<RotatedImm8> | 1044 // tst<c> <Rn>, #<RotatedImm8> |
| 1044 // | 1045 // |
| 1045 // cccc00110001nnnn0000iiiiiiiiiiii where cccc=Cond, nnnn=Rn, and | 1046 // cccc00110001nnnn0000iiiiiiiiiiii where cccc=Cond, nnnn=Rn, and |
| 1046 // iiiiiiiiiiii defines RotatedImm8. | 1047 // iiiiiiiiiiii defines RotatedImm8. |
| 1047 constexpr IValueT Opcode = B3; // ie. 1000 | 1048 constexpr IValueT Opcode = B3; // ie. 1000 |
| 1048 emitCompareOp(Opcode, OpRn, OpSrc1, Cond); | 1049 emitCompareOp(Opcode, OpRn, OpSrc1, Cond); |
| 1049 } | 1050 } |
| 1050 | 1051 |
| 1052 void AssemblerARM32::umull(const Operand *OpRdLo, const Operand *OpRdHi, | |
|
Jim Stichnoth
2015/11/06 22:26:42
Is this a situation where you would comment out um
Karl
2015/11/09 20:16:37
Yes. I forgot that. Commenting appropriate entries
| |
| 1053 const Operand *OpRn, const Operand *OpRm, | |
| 1054 CondARM32::Cond Cond) { | |
| 1055 // UMULL - ARM section A8.8.257, encoding A1: | |
| 1056 // umull<c> <RdLo>, <RdHi>, <Rn>, <Rm> | |
| 1057 // | |
| 1058 // cccc0000100shhhhllllmmmm1001nnnn where hhhh=RdHi, llll=RdLo, nnnn=Rn, | |
| 1059 // mmmm=Rm, and s=SetFlags | |
| 1060 IValueT RdLo; | |
| 1061 IValueT RdHi; | |
| 1062 IValueT Rn; | |
| 1063 IValueT Rm; | |
| 1064 if (decodeOperand(OpRdLo, RdLo) != DecodedAsRegister || | |
| 1065 decodeOperand(OpRdHi, RdHi) != DecodedAsRegister || | |
| 1066 decodeOperand(OpRn, Rn) != DecodedAsRegister || | |
| 1067 decodeOperand(OpRm, Rm) != DecodedAsRegister) | |
| 1068 return setNeedsTextFixup(); | |
| 1069 if (RdHi == RegARM32::Encoded_Reg_pc || RdLo == RegARM32::Encoded_Reg_pc || | |
| 1070 Rn == RegARM32::Encoded_Reg_pc || Rm == RegARM32::Encoded_Reg_pc || | |
| 1071 RdHi == RdLo) | |
| 1072 llvm::report_fatal_error("Sdiv instruction unpredictable on pc"); | |
|
Jim Stichnoth
2015/11/06 22:26:42
sdiv?
Karl
2015/11/09 20:16:37
Need to improve my cut/paste skills! Fixing.
| |
| 1073 constexpr bool SetFlags = false; | |
| 1074 emitMulOp(Cond, B23, RdLo, RdHi, Rn, Rm, SetFlags); | |
| 1075 } | |
| 1076 | |
| 1051 } // end of namespace ARM32 | 1077 } // end of namespace ARM32 |
| 1052 } // end of namespace Ice | 1078 } // end of namespace Ice |
| OLD | NEW |