1 //===-- ARMMCTargetDesc.h - ARM Target Descriptions -------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // This file provides ARM specific target descriptions.
11 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_LIB_TARGET_ARM_MCTARGETDESC_ARMMCTARGETDESC_H
14 #define LLVM_LIB_TARGET_ARM_MCTARGETDESC_ARMMCTARGETDESC_H
16 #include "llvm/Support/DataTypes.h"
17 #include "llvm/MC/MCInstrDesc.h"
22 class formatted_raw_ostream
;
28 class MCObjectTargetWriter
;
31 class MCSubtargetInfo
;
33 class MCTargetOptions
;
34 class MCRelocationInfo
;
35 class MCTargetStreamer
;
40 class raw_pwrite_stream
;
43 std::string
ParseARMTriple(const Triple
&TT
, StringRef CPU
);
45 /// Create a ARM MCSubtargetInfo instance. This is exposed so Asm parser, etc.
46 /// do not need to go through TargetRegistry.
47 MCSubtargetInfo
*createARMMCSubtargetInfo(const Triple
&TT
, StringRef CPU
,
51 MCTargetStreamer
*createARMNullTargetStreamer(MCStreamer
&S
);
52 MCTargetStreamer
*createARMTargetAsmStreamer(MCStreamer
&S
,
53 formatted_raw_ostream
&OS
,
54 MCInstPrinter
*InstPrint
,
56 MCTargetStreamer
*createARMObjectTargetStreamer(MCStreamer
&S
,
57 const MCSubtargetInfo
&STI
);
59 MCCodeEmitter
*createARMLEMCCodeEmitter(const MCInstrInfo
&MCII
,
60 const MCRegisterInfo
&MRI
,
63 MCCodeEmitter
*createARMBEMCCodeEmitter(const MCInstrInfo
&MCII
,
64 const MCRegisterInfo
&MRI
,
67 MCAsmBackend
*createARMLEAsmBackend(const Target
&T
, const MCSubtargetInfo
&STI
,
68 const MCRegisterInfo
&MRI
,
69 const MCTargetOptions
&Options
);
71 MCAsmBackend
*createARMBEAsmBackend(const Target
&T
, const MCSubtargetInfo
&STI
,
72 const MCRegisterInfo
&MRI
,
73 const MCTargetOptions
&Options
);
75 // Construct a PE/COFF machine code streamer which will generate a PE/COFF
77 MCStreamer
*createARMWinCOFFStreamer(MCContext
&Context
,
78 std::unique_ptr
<MCAsmBackend
> &&MAB
,
79 std::unique_ptr
<MCObjectWriter
> &&OW
,
80 std::unique_ptr
<MCCodeEmitter
> &&Emitter
,
82 bool IncrementalLinkerCompatible
);
84 /// Construct an ELF Mach-O object writer.
85 std::unique_ptr
<MCObjectTargetWriter
> createARMELFObjectWriter(uint8_t OSABI
);
87 /// Construct an ARM Mach-O object writer.
88 std::unique_ptr
<MCObjectTargetWriter
>
89 createARMMachObjectWriter(bool Is64Bit
, uint32_t CPUType
,
92 /// Construct an ARM PE/COFF object writer.
93 std::unique_ptr
<MCObjectTargetWriter
>
94 createARMWinCOFFObjectWriter(bool Is64Bit
);
96 /// Construct ARM Mach-O relocation info.
97 MCRelocationInfo
*createARMMachORelocationInfo(MCContext
&Ctx
);
101 OPERAND_VPRED_R
= MCOI::OPERAND_FIRST_TARGET
,
104 inline bool isVpred(OperandType op
) {
105 return op
== OPERAND_VPRED_R
|| op
== OPERAND_VPRED_N
;
107 inline bool isVpred(uint8_t op
) {
108 return isVpred(static_cast<OperandType
>(op
));
110 } // end namespace ARM
112 } // End llvm namespace
114 // Defines symbolic names for ARM registers. This defines a mapping from
115 // register name to register number.
117 #define GET_REGINFO_ENUM
118 #include "ARMGenRegisterInfo.inc"
120 // Defines symbolic names for the ARM instructions.
122 #define GET_INSTRINFO_ENUM
123 #include "ARMGenInstrInfo.inc"
125 #define GET_SUBTARGETINFO_ENUM
126 #include "ARMGenSubtargetInfo.inc"