mirror of
https://github.com/RPCS3/llvm.git
synced 2025-04-02 21:31:41 +00:00
Enable binary encoding of some simple instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116022 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c9f1cddc51
commit
58f38bfa24
@ -112,6 +112,8 @@ EncodeInstruction(const MCInst &MI, raw_ostream &OS,
|
|||||||
unsigned Opcode = MI.getOpcode();
|
unsigned Opcode = MI.getOpcode();
|
||||||
const TargetInstrDesc &Desc = TII.get(Opcode);
|
const TargetInstrDesc &Desc = TII.get(Opcode);
|
||||||
uint64_t TSFlags = Desc.TSFlags;
|
uint64_t TSFlags = Desc.TSFlags;
|
||||||
|
// Keep track of the current byte being emitted.
|
||||||
|
unsigned CurByte = 0;
|
||||||
|
|
||||||
// Pseudo instructions don't get encoded.
|
// Pseudo instructions don't get encoded.
|
||||||
if ((TSFlags & ARMII::FormMask) == ARMII::Pseudo)
|
if ((TSFlags & ARMII::FormMask) == ARMII::Pseudo)
|
||||||
@ -119,6 +121,12 @@ EncodeInstruction(const MCInst &MI, raw_ostream &OS,
|
|||||||
|
|
||||||
++MCNumEmitted; // Keep track of the # of mi's emitted
|
++MCNumEmitted; // Keep track of the # of mi's emitted
|
||||||
switch (TSFlags & ARMII::FormMask) {
|
switch (TSFlags & ARMII::FormMask) {
|
||||||
|
case ARMII::BrMiscFrm:
|
||||||
|
case ARMII::MiscFrm: {
|
||||||
|
unsigned Value = getBinaryCodeForInstr(MI);
|
||||||
|
EmitConstant(Value, 4, CurByte, OS);
|
||||||
|
break;
|
||||||
|
}
|
||||||
default: {
|
default: {
|
||||||
llvm_unreachable("Unhandled instruction encoding format!");
|
llvm_unreachable("Unhandled instruction encoding format!");
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user