Path: blob/main/contrib/llvm-project/llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchBaseInfo.h
35294 views
//=- LoongArchBaseInfo.h - Top level definitions for LoongArch MC -*- C++ -*-=//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7//8// This file contains small standalone enum definitions and helper function9// definitions for the LoongArch target useful for the compiler back-end and the10// MC libraries.11//12//===----------------------------------------------------------------------===//13#ifndef LLVM_LIB_TARGET_LOONGARCH_MCTARGETDESC_LOONGARCHBASEINFO_H14#define LLVM_LIB_TARGET_LOONGARCH_MCTARGETDESC_LOONGARCHBASEINFO_H1516#include "MCTargetDesc/LoongArchMCTargetDesc.h"17#include "llvm/ADT/StringRef.h"18#include "llvm/ADT/StringSwitch.h"19#include "llvm/MC/MCInstrDesc.h"20#include "llvm/TargetParser/SubtargetFeature.h"2122namespace llvm {2324// This namespace holds all of the target specific flags that instruction info25// tracks.26namespace LoongArchII {27enum {28MO_None,29MO_CALL,30MO_CALL_PLT,31MO_PCREL_HI,32MO_PCREL_LO,33MO_PCREL64_LO,34MO_PCREL64_HI,35MO_GOT_PC_HI,36MO_GOT_PC_LO,37MO_GOT_PC64_LO,38MO_GOT_PC64_HI,39MO_LE_HI,40MO_LE_LO,41MO_LE64_LO,42MO_LE64_HI,43MO_IE_PC_HI,44MO_IE_PC_LO,45MO_IE_PC64_LO,46MO_IE_PC64_HI,47MO_LD_PC_HI,48MO_GD_PC_HI,49MO_CALL36,50MO_DESC_PC_HI,51MO_DESC_PC_LO,52MO_DESC64_PC_HI,53MO_DESC64_PC_LO,54MO_DESC_LD,55MO_DESC_CALL,56// TODO: Add more flags.57};58} // end namespace LoongArchII5960namespace LoongArchABI {61enum ABI {62ABI_ILP32S,63ABI_ILP32F,64ABI_ILP32D,65ABI_LP64S,66ABI_LP64F,67ABI_LP64D,68ABI_Unknown69};7071ABI computeTargetABI(const Triple &TT, const FeatureBitset &FeatureBits,72StringRef ABIName);73ABI getTargetABI(StringRef ABIName);7475// Returns the register used to hold the stack pointer after realignment.76MCRegister getBPReg();77} // end namespace LoongArchABI7879} // end namespace llvm8081#endif // LLVM_LIB_TARGET_LOONGARCH_MCTARGETDESC_LOONGARCHBASEINFO_H828384