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

Side by Side Diff: src/IceAssemblerARM32.h

Issue 1516863003: Add various forms of LDREX/STREX to ARM integrated assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix latest issues. Created 5 years 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
« no previous file with comments | « src/DartARM32/assembler_arm.cc ('k') | src/IceAssemblerARM32.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 216
217 void ldr(const Operand *OpRt, const Operand *OpAddress, CondARM32::Cond Cond, 217 void ldr(const Operand *OpRt, const Operand *OpAddress, CondARM32::Cond Cond,
218 const TargetInfo &TInfo); 218 const TargetInfo &TInfo);
219 219
220 void ldr(const Operand *OpRt, const Operand *OpAddress, CondARM32::Cond Cond, 220 void ldr(const Operand *OpRt, const Operand *OpAddress, CondARM32::Cond Cond,
221 const TargetLowering *Lowering) { 221 const TargetLowering *Lowering) {
222 const TargetInfo TInfo(Lowering); 222 const TargetInfo TInfo(Lowering);
223 ldr(OpRt, OpAddress, Cond, TInfo); 223 ldr(OpRt, OpAddress, Cond, TInfo);
224 } 224 }
225 225
226 void ldrex(const Operand *OpRt, const Operand *OpAddress,
227 CondARM32::Cond Cond, const TargetInfo &TInfo);
228
229 void ldrex(const Operand *OpRt, const Operand *OpAddress,
230 CondARM32::Cond Cond, const TargetLowering *Lowering) {
231 const TargetInfo TInfo(Lowering);
232 ldrex(OpRt, OpAddress, Cond, TInfo);
233 }
234
226 void lsl(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1, 235 void lsl(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1,
227 bool SetFlags, CondARM32::Cond Cond); 236 bool SetFlags, CondARM32::Cond Cond);
228 237
229 void lsr(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1, 238 void lsr(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1,
230 bool SetFlags, CondARM32::Cond Cond); 239 bool SetFlags, CondARM32::Cond Cond);
231 240
232 void mov(const Operand *OpRd, const Operand *OpSrc, CondARM32::Cond Cond); 241 void mov(const Operand *OpRd, const Operand *OpSrc, CondARM32::Cond Cond);
233 242
234 void movw(const Operand *OpRd, const Operand *OpSrc, CondARM32::Cond Cond); 243 void movw(const Operand *OpRd, const Operand *OpSrc, CondARM32::Cond Cond);
235 244
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 283
275 void str(const Operand *OpRt, const Operand *OpAddress, CondARM32::Cond Cond, 284 void str(const Operand *OpRt, const Operand *OpAddress, CondARM32::Cond Cond,
276 const TargetInfo &TInfo); 285 const TargetInfo &TInfo);
277 286
278 void str(const Operand *OpRt, const Operand *OpAddress, CondARM32::Cond Cond, 287 void str(const Operand *OpRt, const Operand *OpAddress, CondARM32::Cond Cond,
279 const TargetLowering *Lowering) { 288 const TargetLowering *Lowering) {
280 const TargetInfo TInfo(Lowering); 289 const TargetInfo TInfo(Lowering);
281 str(OpRt, OpAddress, Cond, TInfo); 290 str(OpRt, OpAddress, Cond, TInfo);
282 } 291 }
283 292
293 void strex(const Operand *OpRd, const Operand *OpRt, const Operand *OpAddress,
294 CondARM32::Cond Cond, const TargetInfo &TInfo);
295
296 void strex(const Operand *OpRd, const Operand *OpRt, const Operand *OpAddress,
297 CondARM32::Cond Cond, const TargetLowering *Lowering) {
298 const TargetInfo TInfo(Lowering);
299 strex(OpRd, OpRt, OpAddress, Cond, TInfo);
300 }
301
284 void sub(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1, 302 void sub(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1,
285 bool SetFlags, CondARM32::Cond Cond); 303 bool SetFlags, CondARM32::Cond Cond);
286 304
287 // Implements sxtb/sxth depending on type of OpSrc0. 305 // Implements sxtb/sxth depending on type of OpSrc0.
288 void sxt(const Operand *OpRd, const Operand *OpSrc0, CondARM32::Cond Cond); 306 void sxt(const Operand *OpRd, const Operand *OpSrc0, CondARM32::Cond Cond);
289 307
290 void tst(const Operand *OpRn, const Operand *OpSrc1, CondARM32::Cond Cond); 308 void tst(const Operand *OpRn, const Operand *OpSrc1, CondARM32::Cond Cond);
291 309
292 void udiv(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1, 310 void udiv(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1,
293 CondARM32::Cond Cond); 311 CondARM32::Cond Cond);
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 // Emit ldr/ldrb/str/strb instruction with given address. 387 // Emit ldr/ldrb/str/strb instruction with given address.
370 void emitMemOp(CondARM32::Cond Cond, bool IsLoad, bool IsByte, IValueT Rt, 388 void emitMemOp(CondARM32::Cond Cond, bool IsLoad, bool IsByte, IValueT Rt,
371 const Operand *OpAddress, const TargetInfo &TInfo, 389 const Operand *OpAddress, const TargetInfo &TInfo,
372 const char *InstName); 390 const char *InstName);
373 391
374 // Emit ldrh/ldrd/strh/strd instruction with given address using encoding 3. 392 // Emit ldrh/ldrd/strh/strd instruction with given address using encoding 3.
375 void emitMemOpEnc3(CondARM32::Cond Cond, IValueT Opcode, IValueT Rt, 393 void emitMemOpEnc3(CondARM32::Cond Cond, IValueT Opcode, IValueT Rt,
376 const Operand *OpAddress, const TargetInfo &TInfo, 394 const Operand *OpAddress, const TargetInfo &TInfo,
377 const char *InstName); 395 const char *InstName);
378 396
397 // Emit cccc00011xxlnnnndddd11111001tttt where cccc=Cond, xx encodes type
398 // size, l=IsLoad, nnnn=Rn (as defined by OpAddress), and tttt=Rt.
399 void emitMemExOp(CondARM32::Cond, Type Ty, bool IsLoad, const Operand *OpRd,
400 IValueT Rt, const Operand *OpAddress,
401 const TargetInfo &TInfo, const char *InstName);
402
379 // Pattern cccc100aaaalnnnnrrrrrrrrrrrrrrrr where cccc=Cond, 403 // Pattern cccc100aaaalnnnnrrrrrrrrrrrrrrrr where cccc=Cond,
380 // aaaa<<21=AddressMode, l=IsLoad, nnnn=BaseReg, and 404 // aaaa<<21=AddressMode, l=IsLoad, nnnn=BaseReg, and
381 // rrrrrrrrrrrrrrrr is bitset of Registers. 405 // rrrrrrrrrrrrrrrr is bitset of Registers.
382 void emitMultiMemOp(CondARM32::Cond Cond, BlockAddressMode AddressMode, 406 void emitMultiMemOp(CondARM32::Cond Cond, BlockAddressMode AddressMode,
383 bool IsLoad, IValueT BaseReg, IValueT Registers, 407 bool IsLoad, IValueT BaseReg, IValueT Registers,
384 const char *InstName); 408 const char *InstName);
385 409
386 // Pattern cccc011100x1dddd1111mmmm0001nnn where cccc=Cond, 410 // Pattern cccc011100x1dddd1111mmmm0001nnn where cccc=Cond,
387 // x=Opcode, dddd=Rd, nnnn=Rn, mmmm=Rm. 411 // x=Opcode, dddd=Rd, nnnn=Rn, mmmm=Rm.
388 void emitDivOp(CondARM32::Cond Cond, IValueT Opcode, IValueT Rd, IValueT Rn, 412 void emitDivOp(CondARM32::Cond Cond, IValueT Opcode, IValueT Rd, IValueT Rn,
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 // where cccc=Cond, xxxxxxx<<21=Opcode, dddd=Rd, s=SetFlags, and 449 // where cccc=Cond, xxxxxxx<<21=Opcode, dddd=Rd, s=SetFlags, and
426 // iiiiiiiiiiiiiiii=Imm16. 450 // iiiiiiiiiiiiiiii=Imm16.
427 void emitMovwt(CondARM32::Cond Cond, bool IsMovw, const Operand *OpRd, 451 void emitMovwt(CondARM32::Cond Cond, bool IsMovw, const Operand *OpRd,
428 const Operand *OpSrc, const char *MovName); 452 const Operand *OpSrc, const char *MovName);
429 }; 453 };
430 454
431 } // end of namespace ARM32 455 } // end of namespace ARM32
432 } // end of namespace Ice 456 } // end of namespace Ice
433 457
434 #endif // SUBZERO_SRC_ICEASSEMBLERARM32_H 458 #endif // SUBZERO_SRC_ICEASSEMBLERARM32_H
OLDNEW
« no previous file with comments | « src/DartARM32/assembler_arm.cc ('k') | src/IceAssemblerARM32.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698