1 //=- LoongArchBaseInfo.h - Top level definitions for LoongArch MC -*- C++ -*-=//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains small standalone enum definitions and helper function
10 // definitions for the LoongArch target useful for the compiler back-end and the
11 // MC libraries.
12 //
13 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_LIB_TARGET_LOONGARCH_MCTARGETDESC_LOONGARCHBASEINFO_H
15 #define LLVM_LIB_TARGET_LOONGARCH_MCTARGETDESC_LOONGARCHBASEINFO_H
16 
17 #include "MCTargetDesc/LoongArchMCTargetDesc.h"
18 #include "llvm/ADT/StringRef.h"
19 #include "llvm/ADT/StringSwitch.h"
20 #include "llvm/MC/MCInstrDesc.h"
21 #include "llvm/MC/SubtargetFeature.h"
22 
23 namespace llvm {
24 
25 namespace LoongArchABI {
26 enum ABI {
27   ABI_ILP32S,
28   ABI_ILP32F,
29   ABI_ILP32D,
30   ABI_LP64S,
31   ABI_LP64F,
32   ABI_LP64D,
33   ABI_Unknown
34 };
35 
36 ABI getTargetABI(StringRef ABIName);
37 
38 // Returns the register used to hold the stack pointer after realignment.
39 MCRegister getBPReg();
40 } // end namespace LoongArchABI
41 
42 } // end namespace llvm
43 
44 #endif // LLVM_LIB_TARGET_LOONGARCH_MCTARGETDESC_LOONGARCHBASEINFO_H
45