2009-10-19 19:56:26 +00:00
|
|
|
//===-- ARMInstPrinter.h - Convert ARM MCInst to assembly syntax ----------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This class prints an ARM MCInst to a .s file.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef ARMINSTPRINTER_H
|
|
|
|
#define ARMINSTPRINTER_H
|
|
|
|
|
|
|
|
#include "llvm/MC/MCInstPrinter.h"
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
class MCOperand;
|
|
|
|
|
|
|
|
class ARMInstPrinter : public MCInstPrinter {
|
2009-10-19 21:21:39 +00:00
|
|
|
bool VerboseAsm;
|
2009-10-19 19:56:26 +00:00
|
|
|
public:
|
2009-10-19 21:21:39 +00:00
|
|
|
ARMInstPrinter(raw_ostream &O, const MCAsmInfo &MAI, bool verboseAsm)
|
|
|
|
: MCInstPrinter(O, MAI), VerboseAsm(verboseAsm) {}
|
2009-10-19 19:56:26 +00:00
|
|
|
|
|
|
|
virtual void printInst(const MCInst *MI);
|
|
|
|
|
|
|
|
// Autogenerated by tblgen.
|
|
|
|
void printInstruction(const MCInst *MI);
|
|
|
|
static const char *getRegisterName(unsigned RegNo);
|
|
|
|
|
|
|
|
|
|
|
|
void printOperand(const MCInst *MI, unsigned OpNo,
|
2009-10-19 20:59:55 +00:00
|
|
|
const char *Modifier = 0);
|
2009-10-19 19:56:26 +00:00
|
|
|
|
2009-10-19 21:21:39 +00:00
|
|
|
void printSOImmOperand(const MCInst *MI, unsigned OpNum);
|
2009-10-20 00:40:56 +00:00
|
|
|
void printSOImm2PartOperand(const MCInst *MI, unsigned OpNum);
|
2009-10-19 21:21:39 +00:00
|
|
|
|
2009-10-20 00:40:56 +00:00
|
|
|
void printSORegOperand(const MCInst *MI, unsigned OpNum);
|
add addrmode2 support, getting us up to:
_main:
stm ,
mov r7, sp
sub sp, sp, #4
mov r0, #0
str r0, [sp]
ldr r0, LCPI1_0
bl _printf
ldr r0, [sp]
mov sp, r7
ldm ,
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84543 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 21:57:05 +00:00
|
|
|
void printAddrMode2Operand(const MCInst *MI, unsigned OpNum);
|
2009-10-20 06:15:28 +00:00
|
|
|
void printAddrMode2OffsetOperand(const MCInst *MI, unsigned OpNum);
|
|
|
|
void printAddrMode3Operand(const MCInst *MI, unsigned OpNum);
|
|
|
|
void printAddrMode3OffsetOperand(const MCInst *MI, unsigned OpNum);
|
2009-10-19 19:56:26 +00:00
|
|
|
void printAddrMode4Operand(const MCInst *MI, unsigned OpNum,
|
add register list and hacked up addrmode #4 support, we now get this:
_main:
stmsp! sp!, {r7, lr}
mov r7, sp
sub sp, sp, #4
mov r0, #0
str r0, [sp]
ldr r0, LCPI1_0
bl _printf
ldr r0, [sp]
mov sp, r7
ldmsp! sp!, {r7, pc}
Note the unhappy ldm/stm because of modifiers being ignored.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84546 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 22:09:23 +00:00
|
|
|
const char *Modifier = 0);
|
2009-10-19 19:56:26 +00:00
|
|
|
void printAddrMode5Operand(const MCInst *MI, unsigned OpNum,
|
2009-10-20 06:15:28 +00:00
|
|
|
const char *Modifier = 0);
|
2009-10-20 06:22:33 +00:00
|
|
|
void printAddrMode6Operand(const MCInst *MI, unsigned OpNum);
|
2009-10-19 19:56:26 +00:00
|
|
|
void printAddrModePCOperand(const MCInst *MI, unsigned OpNum,
|
2009-10-20 06:22:33 +00:00
|
|
|
const char *Modifier = 0);
|
|
|
|
|
2009-10-21 04:10:24 +00:00
|
|
|
void printBitfieldInvMaskImmOperand(const MCInst *MI, unsigned OpNum);
|
2009-11-19 06:57:41 +00:00
|
|
|
|
|
|
|
void printThumbS4ImmOperand(const MCInst *MI, unsigned OpNum);
|
2009-10-19 19:56:26 +00:00
|
|
|
void printThumbITMask(const MCInst *MI, unsigned OpNum) {}
|
|
|
|
void printThumbAddrModeRROperand(const MCInst *MI, unsigned OpNum) {}
|
|
|
|
void printThumbAddrModeRI5Operand(const MCInst *MI, unsigned OpNum,
|
|
|
|
unsigned Scale) {}
|
|
|
|
void printThumbAddrModeS1Operand(const MCInst *MI, unsigned OpNum) {}
|
|
|
|
void printThumbAddrModeS2Operand(const MCInst *MI, unsigned OpNum) {}
|
|
|
|
void printThumbAddrModeS4Operand(const MCInst *MI, unsigned OpNum) {}
|
|
|
|
void printThumbAddrModeSPOperand(const MCInst *MI, unsigned OpNum) {}
|
|
|
|
|
|
|
|
void printT2SOOperand(const MCInst *MI, unsigned OpNum) {}
|
|
|
|
void printT2AddrModeImm12Operand(const MCInst *MI, unsigned OpNum) {}
|
|
|
|
void printT2AddrModeImm8Operand(const MCInst *MI, unsigned OpNum) {}
|
|
|
|
void printT2AddrModeImm8s4Operand(const MCInst *MI, unsigned OpNum) {}
|
|
|
|
void printT2AddrModeImm8OffsetOperand(const MCInst *MI, unsigned OpNum) {}
|
|
|
|
void printT2AddrModeSoRegOperand(const MCInst *MI, unsigned OpNum) {}
|
|
|
|
|
2009-10-20 00:42:49 +00:00
|
|
|
void printPredicateOperand(const MCInst *MI, unsigned OpNum);
|
2009-10-20 00:46:11 +00:00
|
|
|
void printSBitModifierOperand(const MCInst *MI, unsigned OpNum);
|
add register list and hacked up addrmode #4 support, we now get this:
_main:
stmsp! sp!, {r7, lr}
mov r7, sp
sub sp, sp, #4
mov r0, #0
str r0, [sp]
ldr r0, LCPI1_0
bl _printf
ldr r0, [sp]
mov sp, r7
ldmsp! sp!, {r7, pc}
Note the unhappy ldm/stm because of modifiers being ignored.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84546 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 22:09:23 +00:00
|
|
|
void printRegisterList(const MCInst *MI, unsigned OpNum);
|
2009-10-19 19:56:26 +00:00
|
|
|
void printCPInstOperand(const MCInst *MI, unsigned OpNum,
|
2009-10-19 22:33:05 +00:00
|
|
|
const char *Modifier);
|
2009-10-19 19:56:26 +00:00
|
|
|
void printJTBlockOperand(const MCInst *MI, unsigned OpNum) {}
|
|
|
|
void printJT2BlockOperand(const MCInst *MI, unsigned OpNum) {}
|
|
|
|
void printTBAddrMode(const MCInst *MI, unsigned OpNum) {}
|
2009-10-20 06:15:28 +00:00
|
|
|
void printNoHashImmediate(const MCInst *MI, unsigned OpNum);
|
2009-10-28 01:44:26 +00:00
|
|
|
void printVFPf32ImmOperand(const MCInst *MI, int OpNum) {}
|
|
|
|
void printVFPf64ImmOperand(const MCInst *MI, int OpNum) {}
|
2009-11-06 23:33:28 +00:00
|
|
|
void printHex8ImmOperand(const MCInst *MI, int OpNum) {}
|
|
|
|
void printHex16ImmOperand(const MCInst *MI, int OpNum) {}
|
|
|
|
void printHex32ImmOperand(const MCInst *MI, int OpNum) {}
|
|
|
|
void printHex64ImmOperand(const MCInst *MI, int OpNum) {}
|
2009-10-19 22:23:04 +00:00
|
|
|
|
|
|
|
void printPCLabel(const MCInst *MI, unsigned OpNum);
|
|
|
|
// FIXME: Implement.
|
2009-10-19 19:56:26 +00:00
|
|
|
void PrintSpecial(const MCInst *MI, const char *Kind) {}
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|