brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.8 KiB · d36453a Raw
59 lines · c
1//===-- SPIRVMCTargetDesc.h - SPIR-V Target Descriptions --------*- 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 provides SPIR-V specific target descriptions.10//11//===----------------------------------------------------------------------===//12 13#ifndef LLVM_LIB_TARGET_SPIRV_MCTARGETDESC_SPIRVMCTARGETDESC_H14#define LLVM_LIB_TARGET_SPIRV_MCTARGETDESC_SPIRVMCTARGETDESC_H15 16#include "llvm/Support/DataTypes.h"17#include <cassert>18 19namespace llvm {20class MCAsmBackend;21class MCCodeEmitter;22class MCContext;23class MCInstrInfo;24class MCObjectTargetWriter;25class MCRegisterInfo;26class MCSubtargetInfo;27class MCTargetOptions;28class Target;29 30MCCodeEmitter *createSPIRVMCCodeEmitter(const MCInstrInfo &MCII,31                                        MCContext &Ctx);32 33MCAsmBackend *createSPIRVAsmBackend(const Target &T, const MCSubtargetInfo &STI,34                                    const MCRegisterInfo &MRI,35                                    const MCTargetOptions &Options);36} // namespace llvm37 38// Defines symbolic names for SPIR-V registers.  This defines a mapping from39// register name to register number.40#define GET_REGINFO_ENUM41#include "SPIRVGenRegisterInfo.inc"42 43// Defines symbolic names for the SPIR-V instructions.44#define GET_INSTRINFO_ENUM45#define GET_INSTRINFO_MC_HELPER_DECLS46#include "SPIRVGenInstrInfo.inc"47 48#define GET_SUBTARGETINFO_ENUM49#include "SPIRVGenSubtargetInfo.inc"50 51namespace llvm::SPIRV {52inline unsigned getIDFromRegister(unsigned Reg) {53  assert(Reg & (1U << 31));54  return Reg & ~(1U << 31);55}56} // namespace llvm::SPIRV57 58#endif // LLVM_LIB_TARGET_SPIRV_MCTARGETDESC_SPIRVMCTARGETDESC_H59