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 888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
899 // | 899 // |
900 // ORR (register) - ARM Section A8.8.123, encoding A1: | 900 // ORR (register) - ARM Section A8.8.123, encoding A1: |
901 // orr{s}<c> <Rd>, <Rn>, #<RotatedImm8> | 901 // orr{s}<c> <Rd>, <Rn>, #<RotatedImm8> |
902 // | 902 // |
903 // cccc0001100snnnnddddiiiiiiiiiiii where cccc=Cond, dddd=Rd, nnnn=Rn, | 903 // cccc0001100snnnnddddiiiiiiiiiiii where cccc=Cond, dddd=Rd, nnnn=Rn, |
904 // s=SetFlags and iiiiiiiiiiii=Src1Value defining RotatedImm8. | 904 // s=SetFlags and iiiiiiiiiiii=Src1Value defining RotatedImm8. |
905 constexpr IValueT Orr = B3 | B2; // i.e. 1100 | 905 constexpr IValueT Orr = B3 | B2; // i.e. 1100 |
906 emitType01(Orr, OpRd, OpRn, OpSrc1, SetFlags, Cond); | 906 emitType01(Orr, OpRd, OpRn, OpSrc1, SetFlags, Cond); |
907 } | 907 } |
908 | 908 |
909 void AssemblerARM32::pop(const Operand *OpRt, CondARM32::Cond Cond) { | |
910 // POP - ARM section A8.8.132, encoding A2: | |
911 // pop<c> {Rt} | |
912 // | |
913 // cccc010010011101dddd000000000100 where dddd=Rt and cccc=Cond. | |
914 IValueT Rt; | |
915 if (decodeOperand(OpRt, Rt) != DecodedAsRegister) | |
916 return setNeedsTextFixup(); | |
917 assert(Rt != RegARM32::Encoded_Reg_sp); | |
918 // Same as load instruction. | |
919 constexpr bool isLoad = true; | |
Jim Stichnoth
2015/11/09 22:17:26
IsLoad, IsByte
Karl
2015/11/09 22:44:35
Done.
| |
920 constexpr bool isByte = false; | |
921 IValueT Address = decodeImmRegOffset(RegARM32::Encoded_Reg_sp, kWordSize, | |
922 OperandARM32Mem::PostIndex); | |
923 emitMemOp(Cond, kInstTypeMemImmediate, isLoad, isByte, Rt, Address); | |
924 } | |
925 | |
926 void AssemblerARM32::popList(const IValueT Registers, CondARM32::Cond Cond) { | |
927 // POP - ARM section A8.*.131, encoding A1: | |
928 // pop<c> <registers> | |
929 // | |
930 // cccc100010111101rrrrrrrrrrrrrrrr where cccc=Cond and | |
931 // rrrrrrrrrrrrrrrr=Registers (one bit for each GP register). | |
932 constexpr bool IsLoad = true; | |
933 emitMultiMemOp(Cond, IA_W, IsLoad, RegARM32::Encoded_Reg_sp, Registers); | |
934 } | |
935 | |
909 void AssemblerARM32::push(const Operand *OpRt, CondARM32::Cond Cond) { | 936 void AssemblerARM32::push(const Operand *OpRt, CondARM32::Cond Cond) { |
910 // PUSH - ARM section A8.8.133, encoding A2: | 937 // PUSH - ARM section A8.8.133, encoding A2: |
911 // push<c> {Rt} | 938 // push<c> {Rt} |
912 // | 939 // |
913 // cccc010100101101dddd000000000100 where dddd=Rd and cccc=Cond. | 940 // cccc010100101101dddd000000000100 where dddd=Rt and cccc=Cond. |
914 IValueT Rt; | 941 IValueT Rt; |
915 if (decodeOperand(OpRt, Rt) != DecodedAsRegister) | 942 if (decodeOperand(OpRt, Rt) != DecodedAsRegister) |
916 return setNeedsTextFixup(); | 943 return setNeedsTextFixup(); |
917 assert(Rt != RegARM32::Encoded_Reg_sp); | 944 assert(Rt != RegARM32::Encoded_Reg_sp); |
918 // Same as store instruction. | 945 // Same as store instruction. |
919 constexpr bool isLoad = false; | 946 constexpr bool isLoad = false; |
920 constexpr bool isByte = false; | 947 constexpr bool isByte = false; |
921 IValueT Address = decodeImmRegOffset(RegARM32::Encoded_Reg_sp, -kWordSize, | 948 IValueT Address = decodeImmRegOffset(RegARM32::Encoded_Reg_sp, -kWordSize, |
922 OperandARM32Mem::PreIndex); | 949 OperandARM32Mem::PreIndex); |
923 emitMemOp(Cond, kInstTypeMemImmediate, isLoad, isByte, Rt, Address); | 950 emitMemOp(Cond, kInstTypeMemImmediate, isLoad, isByte, Rt, Address); |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1070 if (RdHi == RegARM32::Encoded_Reg_pc || RdLo == RegARM32::Encoded_Reg_pc || | 1097 if (RdHi == RegARM32::Encoded_Reg_pc || RdLo == RegARM32::Encoded_Reg_pc || |
1071 Rn == RegARM32::Encoded_Reg_pc || Rm == RegARM32::Encoded_Reg_pc || | 1098 Rn == RegARM32::Encoded_Reg_pc || Rm == RegARM32::Encoded_Reg_pc || |
1072 RdHi == RdLo) | 1099 RdHi == RdLo) |
1073 llvm::report_fatal_error("Umull instruction unpredictable on pc"); | 1100 llvm::report_fatal_error("Umull instruction unpredictable on pc"); |
1074 constexpr bool SetFlags = false; | 1101 constexpr bool SetFlags = false; |
1075 emitMulOp(Cond, B23, RdLo, RdHi, Rn, Rm, SetFlags); | 1102 emitMulOp(Cond, B23, RdLo, RdHi, Rn, Rm, SetFlags); |
1076 } | 1103 } |
1077 | 1104 |
1078 } // end of namespace ARM32 | 1105 } // end of namespace ARM32 |
1079 } // end of namespace Ice | 1106 } // end of namespace Ice |
OLD | NEW |