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 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 // BKPT - ARM section A*.8.24 - encoding A1: | 556 // BKPT - ARM section A*.8.24 - encoding A1: |
557 // bkpt #<Imm16> | 557 // bkpt #<Imm16> |
558 // | 558 // |
559 // cccc00010010iiiiiiiiiiii0111iiii where cccc=AL and iiiiiiiiiiiiiiii=Imm16 | 559 // cccc00010010iiiiiiiiiiii0111iiii where cccc=AL and iiiiiiiiiiiiiiii=Imm16 |
560 AssemblerBuffer::EnsureCapacity ensured(&Buffer); | 560 AssemblerBuffer::EnsureCapacity ensured(&Buffer); |
561 const IValueT Encoding = (CondARM32::AL << kConditionShift) | B24 | B21 | | 561 const IValueT Encoding = (CondARM32::AL << kConditionShift) | B24 | B21 | |
562 ((Imm16 >> 4) << 8) | B6 | B5 | B4 | (Imm16 & 0xf); | 562 ((Imm16 >> 4) << 8) | B6 | B5 | B4 | (Imm16 & 0xf); |
563 emitInst(Encoding); | 563 emitInst(Encoding); |
564 } | 564 } |
565 | 565 |
| 566 void AssemblerARM32::bic(const Operand *OpRd, const Operand *OpRn, |
| 567 const Operand *OpSrc1, bool SetFlags, |
| 568 CondARM32::Cond Cond) { |
| 569 // BIC (register) - ARM section A8.8.22, encoding A1: |
| 570 // bic{s}<c> <Rd>, <Rn>, <Rm>{, <shift>} |
| 571 // |
| 572 // cccc0001110snnnnddddiiiiitt0mmmm where cccc=Cond, dddd=Rd, nnnn=Rn, |
| 573 // mmmm=Rm, iiiii=Shift, tt=ShiftKind, and s=SetFlags. |
| 574 // |
| 575 // BIC (immediate) - ARM section A8.8.21, encoding A1: |
| 576 // bic{s}<c> <Rd>, <Rn>, #<RotatedImm8> |
| 577 // |
| 578 // cccc0011110snnnnddddiiiiiiiiiiii where cccc=Cond, dddd=Rn, nnnn=Rn, |
| 579 // s=SetFlags, and iiiiiiiiiiii=Src1Value defining RotatedImm8. |
| 580 IValueT Opcode = B3 | B2 | B1; // i.e. 1110 |
| 581 emitType01(Opcode, OpRd, OpRn, OpSrc1, SetFlags, Cond); |
| 582 } |
| 583 |
566 void AssemblerARM32::bx(RegARM32::GPRRegister Rm, CondARM32::Cond Cond) { | 584 void AssemblerARM32::bx(RegARM32::GPRRegister Rm, CondARM32::Cond Cond) { |
567 // BX - ARM section A8.8.27, encoding A1: | 585 // BX - ARM section A8.8.27, encoding A1: |
568 // bx<c> <Rm> | 586 // bx<c> <Rm> |
569 // | 587 // |
570 // cccc000100101111111111110001mmmm where mmmm=rm and cccc=Cond. | 588 // cccc000100101111111111110001mmmm where mmmm=rm and cccc=Cond. |
571 if (!(isGPRRegisterDefined(Rm) && isConditionDefined(Cond))) | 589 if (!(isGPRRegisterDefined(Rm) && isConditionDefined(Cond))) |
572 return setNeedsTextFixup(); | 590 return setNeedsTextFixup(); |
573 AssemblerBuffer::EnsureCapacity ensured(&Buffer); | 591 AssemblerBuffer::EnsureCapacity ensured(&Buffer); |
574 const IValueT Encoding = (encodeCondition(Cond) << kConditionShift) | B24 | | 592 const IValueT Encoding = (encodeCondition(Cond) << kConditionShift) | B24 | |
575 B21 | (0xfff << 8) | B4 | | 593 B21 | (0xfff << 8) | B4 | |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
962 // sub{s}<c> sp, <Rn>, #<RotatedImm8> | 980 // sub{s}<c> sp, <Rn>, #<RotatedImm8> |
963 // | 981 // |
964 // cccc0010010snnnnddddiiiiiiiiiiii where cccc=Cond, dddd=Rd, nnnn=Rn, | 982 // cccc0010010snnnnddddiiiiiiiiiiii where cccc=Cond, dddd=Rd, nnnn=Rn, |
965 // s=SetFlags and iiiiiiiiiiii=Src1Value defining RotatedImm8 | 983 // s=SetFlags and iiiiiiiiiiii=Src1Value defining RotatedImm8 |
966 constexpr IValueT Sub = B1; // 0010 | 984 constexpr IValueT Sub = B1; // 0010 |
967 emitType01(Sub, OpRd, OpRn, OpSrc1, SetFlags, Cond); | 985 emitType01(Sub, OpRd, OpRn, OpSrc1, SetFlags, Cond); |
968 } | 986 } |
969 | 987 |
970 } // end of namespace ARM32 | 988 } // end of namespace ARM32 |
971 } // end of namespace Ice | 989 } // end of namespace Ice |
OLD | NEW |