brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.1 KiB · fbfca4b Raw
71 lines · c
1//===-- CSKYBaseInfo.h - Top level definitions for CSKY ---*- 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-exception6//7//===----------------------------------------------------------------------===//8//9// This file contains small standalone helper functions and enum definitions for10// the CSKY target useful for the compiler back-end and the MC libraries.11// As such, it deliberately does not include references to LLVM core12// code gen types, passes, etc..13//14//===----------------------------------------------------------------------===//15 16#ifndef LLVM_LIB_TARGET_CSKY_MCTARGETDESC_CSKYBASEINFO_H17#define LLVM_LIB_TARGET_CSKY_MCTARGETDESC_CSKYBASEINFO_H18 19#include "MCTargetDesc/CSKYMCTargetDesc.h"20#include "llvm/MC/MCInstrDesc.h"21 22namespace llvm {23 24// CSKYII - This namespace holds all of the target specific flags that25// instruction info tracks. All definitions must match CSKYInstrFormats.td.26namespace CSKYII {27 28enum AddrMode {29  AddrModeNone = 0,30  AddrMode32B = 1,   // ld32.b, ld32.bs, st32.b, st32.bs, +4kb31  AddrMode32H = 2,   // ld32.h, ld32.hs, st32.h, st32.hs, +8kb32  AddrMode32WD = 3,  // ld32.w, st32.w, ld32.d, st32.d, +16kb33  AddrMode16B = 4,   // ld16.b, +32b34  AddrMode16H = 5,   // ld16.h, +64b35  AddrMode16W = 6,   // ld16.w, +128b or +1kb36  AddrMode32SDF = 7, // flds, fldd, +1kb37};38 39// CSKY Specific MachineOperand Flags.40enum TOF {41  MO_None = 0,42  MO_ADDR32,43  MO_GOT32,44  MO_GOTOFF,45  MO_PLT32,46  MO_ADDR_HI16,47  MO_ADDR_LO16,48 49  // Used to differentiate between target-specific "direct" flags and "bitmask"50  // flags. A machine operand can only have one "direct" flag, but can have51  // multiple "bitmask" flags.52  MO_DIRECT_FLAG_MASK = 1553};54 55enum {56  AddrModeMask = 0x1f,57};58 59} // namespace CSKYII60 61namespace CSKYOp {62enum OperandType : unsigned {63  OPERAND_BARESYMBOL = MCOI::OPERAND_FIRST_TARGET,64  OPERAND_CONSTPOOL65};66} // namespace CSKYOp67 68} // namespace llvm69 70#endif // LLVM_LIB_TARGET_CSKY_MCTARGETDESC_CSKYBASEINFO_H71