Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Side by Side Diff: src/IceAssemblerARM32.h

Issue 1430713003: Add mul instruction to ARM integrated assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Add i64 multiplication example. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 //===- subzero/src/IceAssemblerARM32.h - Assembler for ARM32 ----*- C++ -*-===// 1 //===- subzero/src/IceAssemblerARM32.h - 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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 // List of instructions implemented by integrated assembler. 124 // List of instructions implemented by integrated assembler.
125 125
126 void adc(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1, 126 void adc(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1,
127 bool SetFlags, CondARM32::Cond Cond); 127 bool SetFlags, CondARM32::Cond Cond);
128 128
129 void add(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1, 129 void add(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1,
130 bool SetFlags, CondARM32::Cond Cond); 130 bool SetFlags, CondARM32::Cond Cond);
131 131
132 void b(Label *L, CondARM32::Cond Cond); 132 void b(Label *L, CondARM32::Cond Cond);
133 133
134 void bx(RegARM32::GPRRegister Rm, CondARM32::Cond Cond = CondARM32::AL);
135
134 void bkpt(uint16_t Imm16); 136 void bkpt(uint16_t Imm16);
135 137
136 void ldr(const Operand *OpRt, const Operand *OpAddress, CondARM32::Cond Cond); 138 void ldr(const Operand *OpRt, const Operand *OpAddress, CondARM32::Cond Cond);
137 139
138 void mov(const Operand *OpRd, const Operand *OpSrc, CondARM32::Cond Cond); 140 void mov(const Operand *OpRd, const Operand *OpSrc, CondARM32::Cond Cond);
139 141
140 void bx(RegARM32::GPRRegister Rm, CondARM32::Cond Cond = CondARM32::AL); 142 void mul(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1,
143 bool SetFlags, CondARM32::Cond Cond);
141 144
142 void sbc(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1, 145 void sbc(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1,
143 bool SetFlags, CondARM32::Cond Cond); 146 bool SetFlags, CondARM32::Cond Cond);
144 147
145 void str(const Operand *OpRt, const Operand *OpAddress, CondARM32::Cond Cond); 148 void str(const Operand *OpRt, const Operand *OpAddress, CondARM32::Cond Cond);
146 149
147 void sub(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1, 150 void sub(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1,
148 bool SetFlags, CondARM32::Cond Cond); 151 bool SetFlags, CondARM32::Cond Cond);
149 152
150 static bool classof(const Assembler *Asm) { 153 static bool classof(const Assembler *Asm) {
(...skipping 22 matching lines...) Expand all
173 176
174 void emitType05(CondARM32::Cond COnd, int32_t Offset, bool Link); 177 void emitType05(CondARM32::Cond COnd, int32_t Offset, bool Link);
175 178
176 // Pattern ccccoooaabalnnnnttttaaaaaaaaaaaa where cccc=Cond, ooo=InstType, 179 // Pattern ccccoooaabalnnnnttttaaaaaaaaaaaa where cccc=Cond, ooo=InstType,
177 // l=isLoad, b=isByte, and aaa0a0aaaa0000aaaaaaaaaaaa=Address. Note that 180 // l=isLoad, b=isByte, and aaa0a0aaaa0000aaaaaaaaaaaa=Address. Note that
178 // Address is assumed to be defined by decodeAddress() in 181 // Address is assumed to be defined by decodeAddress() in
179 // IceAssemblerARM32.cpp. 182 // IceAssemblerARM32.cpp.
180 void emitMemOp(CondARM32::Cond Cond, IValueT InstType, bool IsLoad, 183 void emitMemOp(CondARM32::Cond Cond, IValueT InstType, bool IsLoad,
181 bool IsByte, uint32_t Rt, uint32_t Address); 184 bool IsByte, uint32_t Rt, uint32_t Address);
182 185
186 // Pattern ccccxxxxxxxfnnnnddddssss1001mmmm where cccc=Cond, dddd=Rd, nnnn=Rn,
187 // mmmm=Rm, ssss=Rs, f=SetCc, and xxxxxxx=Opcode.
188 void emitMulOp(CondARM32::Cond Cond, IValueT Opcode, IValueT Rd, IValueT Rn,
189 IValueT Rm, IValueT Rs, bool SetCc);
190
183 void emitBranch(Label *L, CondARM32::Cond, bool Link); 191 void emitBranch(Label *L, CondARM32::Cond, bool Link);
184 192
185 // Encodes the given Offset into the branch instruction Inst. 193 // Encodes the given Offset into the branch instruction Inst.
186 IValueT encodeBranchOffset(IOffsetT Offset, IValueT Inst); 194 IValueT encodeBranchOffset(IOffsetT Offset, IValueT Inst);
187 195
188 // Returns the offset encoded in the branch instruction Inst. 196 // Returns the offset encoded in the branch instruction Inst.
189 static IOffsetT decodeBranchOffset(IValueT Inst); 197 static IOffsetT decodeBranchOffset(IValueT Inst);
190 }; 198 };
191 199
192 } // end of namespace ARM32 200 } // end of namespace ARM32
193 } // end of namespace Ice 201 } // end of namespace Ice
194 202
195 #endif // SUBZERO_SRC_ICEASSEMBLERARM32_H 203 #endif // SUBZERO_SRC_ICEASSEMBLERARM32_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698