Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 248 void mul(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1, | 248 void mul(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1, |
| 249 bool SetFlags, CondARM32::Cond Cond); | 249 bool SetFlags, CondARM32::Cond Cond); |
| 250 | 250 |
| 251 void mvn(const Operand *OpRd, const Operand *OpScc, CondARM32::Cond Cond); | 251 void mvn(const Operand *OpRd, const Operand *OpScc, CondARM32::Cond Cond); |
| 252 | 252 |
| 253 void nop(); | 253 void nop(); |
| 254 | 254 |
| 255 void orr(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1, | 255 void orr(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1, |
| 256 bool SetFlags, CondARM32::Cond Cond); | 256 bool SetFlags, CondARM32::Cond Cond); |
| 257 | 257 |
| 258 void pop(const Operand *OpRt, CondARM32::Cond Cond); | 258 template <AssemblyOutputForm> |
|
John
2016/01/04 15:27:49
The idea of the assembler emitting textual output
Karl
2016/01/05 17:43:03
Refactored so that textual generation is only in I
| |
| 259 void pop(const Cfg *Cfg, const Operand *OpRt, CondARM32::Cond Cond); | |
| 259 | 260 |
| 260 // Note: Registers is a bitset, where bit n corresponds to register Rn. | 261 // Note: Registers is a bitset, where bit n corresponds to register Rn. |
| 261 void popList(const IValueT Registers, CondARM32::Cond Cond); | 262 template <AssemblyOutputForm> |
| 263 void popList(const Cfg *Cfg, const IValueT Registers, CondARM32::Cond Cond); | |
| 262 | 264 |
| 263 void push(const Operand *OpRt, CondARM32::Cond Cond); | 265 template <AssemblyOutputForm> |
| 266 void push(const Cfg *Func, const Operand *OpRt, CondARM32::Cond Cond); | |
| 264 | 267 |
| 265 // Note: Registers is a bitset, where bit n corresponds to register Rn. | 268 // Note: Registers is a bitset, where bit n corresponds to register Rn. |
| 266 void pushList(const IValueT Registers, CondARM32::Cond Cond); | 269 template <AssemblyOutputForm> |
| 270 void pushList(const Cfg *Func, const IValueT Registers, CondARM32::Cond Cond); | |
| 267 | 271 |
| 268 void rbit(const Operand *OpRd, const Operand *OpRm, CondARM32::Cond Cond); | 272 void rbit(const Operand *OpRd, const Operand *OpRm, CondARM32::Cond Cond); |
| 269 | 273 |
| 270 void rev(const Operand *OpRd, const Operand *OpRm, CondARM32::Cond Cond); | 274 void rev(const Operand *OpRd, const Operand *OpRm, CondARM32::Cond Cond); |
| 271 | 275 |
| 272 void rsb(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1, | 276 void rsb(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1, |
| 273 bool SetFlags, CondARM32::Cond Cond); | 277 bool SetFlags, CondARM32::Cond Cond); |
| 274 | 278 |
| 275 void rsc(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1, | 279 void rsc(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1, |
| 276 bool SetFlags, CondARM32::Cond Cond); | 280 bool SetFlags, CondARM32::Cond Cond); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 311 | 315 |
| 312 void udiv(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1, | 316 void udiv(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1, |
| 313 CondARM32::Cond Cond); | 317 CondARM32::Cond Cond); |
| 314 | 318 |
| 315 void umull(const Operand *OpRdLo, const Operand *OpRdHi, const Operand *OpRn, | 319 void umull(const Operand *OpRdLo, const Operand *OpRdHi, const Operand *OpRn, |
| 316 const Operand *OpRm, CondARM32::Cond Cond); | 320 const Operand *OpRm, CondARM32::Cond Cond); |
| 317 | 321 |
| 318 // Implements uxtb/uxth depending on type of OpSrc0. | 322 // Implements uxtb/uxth depending on type of OpSrc0. |
| 319 void uxt(const Operand *OpRd, const Operand *OpSrc0, CondARM32::Cond Cond); | 323 void uxt(const Operand *OpRd, const Operand *OpSrc0, CondARM32::Cond Cond); |
| 320 | 324 |
| 321 void vpop(const Variable *OpBaseReg, SizeT NumConsecRegs, | 325 template <AssemblyOutputForm Form> |
| 326 void vpop(const Cfg *Func, const Variable *OpBaseReg, SizeT NumConsecRegs, | |
| 322 CondARM32::Cond Cond); | 327 CondARM32::Cond Cond); |
| 323 | 328 |
| 324 void vpush(const Variable *OpBaseReg, SizeT NumConsecRegs, | 329 template <AssemblyOutputForm Form> |
| 330 void vpush(const Cfg *Func, const Variable *OpBaseReg, SizeT NumConsecRegs, | |
| 325 CondARM32::Cond Cond); | 331 CondARM32::Cond Cond); |
| 326 | 332 |
| 327 static bool classof(const Assembler *Asm) { | 333 static bool classof(const Assembler *Asm) { |
| 328 return Asm->getKind() == Asm_ARM32; | 334 return Asm->getKind() == Asm_ARM32; |
| 329 } | 335 } |
| 330 | 336 |
| 331 void emitTextInst(const std::string &Text, SizeT InstSize); | 337 void emitTextInst(const std::string &Text, SizeT InstSize); |
| 332 | 338 |
| 333 private: | 339 private: |
| 334 // A vector of pool-allocated x86 labels for CFG nodes. | 340 // A vector of pool-allocated x86 labels for CFG nodes. |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 415 | 421 |
| 416 // Pattern cccc100aaaalnnnnrrrrrrrrrrrrrrrr where cccc=Cond, | 422 // Pattern cccc100aaaalnnnnrrrrrrrrrrrrrrrr where cccc=Cond, |
| 417 // aaaa<<21=AddressMode, l=IsLoad, nnnn=BaseReg, and | 423 // aaaa<<21=AddressMode, l=IsLoad, nnnn=BaseReg, and |
| 418 // rrrrrrrrrrrrrrrr is bitset of Registers. | 424 // rrrrrrrrrrrrrrrr is bitset of Registers. |
| 419 void emitMultiMemOp(CondARM32::Cond Cond, BlockAddressMode AddressMode, | 425 void emitMultiMemOp(CondARM32::Cond Cond, BlockAddressMode AddressMode, |
| 420 bool IsLoad, IValueT BaseReg, IValueT Registers, | 426 bool IsLoad, IValueT BaseReg, IValueT Registers, |
| 421 const char *InstName); | 427 const char *InstName); |
| 422 | 428 |
| 423 // Pattern ccccxxxxxDxxxxxxddddxxxxiiiiiiii where cccc=Cond, ddddD=BaseReg, | 429 // Pattern ccccxxxxxDxxxxxxddddxxxxiiiiiiii where cccc=Cond, ddddD=BaseReg, |
| 424 // iiiiiiii=NumConsecRegs, and xxxxx0xxxxxx0000xxxx00000000=Opcode. | 430 // iiiiiiii=NumConsecRegs, and xxxxx0xxxxxx0000xxxx00000000=Opcode. |
| 425 void emitVStackOp(CondARM32::Cond Cond, IValueT Opcode, | 431 template <AssemblyOutputForm Form> |
| 432 void emitVStackOp(const Cfg *Func, CondARM32::Cond Cond, IValueT Opcode, | |
| 426 const Variable *OpBaseReg, SizeT NumConsecRegs, | 433 const Variable *OpBaseReg, SizeT NumConsecRegs, |
| 427 const char *InstName); | 434 const char *InstName); |
| 428 | 435 |
| 436 void emitStackTextOp(const Cfg *Func, const IValueT Registers, | |
| 437 CondARM32::Cond Cond, const char *InstName); | |
| 438 | |
| 439 void emitStackTextOp(const Cfg *Func, const Operand *OpRt, | |
| 440 CondARM32::Cond Cond, const char *InstName); | |
| 441 | |
| 429 // Pattern cccc011100x1dddd1111mmmm0001nnn where cccc=Cond, | 442 // Pattern cccc011100x1dddd1111mmmm0001nnn where cccc=Cond, |
| 430 // x=Opcode, dddd=Rd, nnnn=Rn, mmmm=Rm. | 443 // x=Opcode, dddd=Rd, nnnn=Rn, mmmm=Rm. |
| 431 void emitDivOp(CondARM32::Cond Cond, IValueT Opcode, IValueT Rd, IValueT Rn, | 444 void emitDivOp(CondARM32::Cond Cond, IValueT Opcode, IValueT Rd, IValueT Rn, |
| 432 IValueT Rm, const char *InstName); | 445 IValueT Rm, const char *InstName); |
| 433 | 446 |
| 434 // Pattern ccccxxxxxxxfnnnnddddssss1001mmmm where cccc=Cond, dddd=Rd, nnnn=Rn, | 447 // Pattern ccccxxxxxxxfnnnnddddssss1001mmmm where cccc=Cond, dddd=Rd, nnnn=Rn, |
| 435 // mmmm=Rm, ssss=Rs, f=SetFlags and xxxxxxx=Opcode. | 448 // mmmm=Rm, ssss=Rs, f=SetFlags and xxxxxxx=Opcode. |
| 436 void emitMulOp(CondARM32::Cond Cond, IValueT Opcode, IValueT Rd, IValueT Rn, | 449 void emitMulOp(CondARM32::Cond Cond, IValueT Opcode, IValueT Rd, IValueT Rn, |
| 437 IValueT Rm, IValueT Rs, bool SetFlags, const char *InstName); | 450 IValueT Rm, IValueT Rs, bool SetFlags, const char *InstName); |
| 438 | 451 |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 468 // where cccc=Cond, xxxxxxx<<21=Opcode, dddd=Rd, s=SetFlags, and | 481 // where cccc=Cond, xxxxxxx<<21=Opcode, dddd=Rd, s=SetFlags, and |
| 469 // iiiiiiiiiiiiiiii=Imm16. | 482 // iiiiiiiiiiiiiiii=Imm16. |
| 470 void emitMovwt(CondARM32::Cond Cond, bool IsMovw, const Operand *OpRd, | 483 void emitMovwt(CondARM32::Cond Cond, bool IsMovw, const Operand *OpRd, |
| 471 const Operand *OpSrc, const char *MovName); | 484 const Operand *OpSrc, const char *MovName); |
| 472 }; | 485 }; |
| 473 | 486 |
| 474 } // end of namespace ARM32 | 487 } // end of namespace ARM32 |
| 475 } // end of namespace Ice | 488 } // end of namespace Ice |
| 476 | 489 |
| 477 #endif // SUBZERO_SRC_ICEASSEMBLERARM32_H | 490 #endif // SUBZERO_SRC_ICEASSEMBLERARM32_H |
| OLD | NEW |