1//===-- SPIRV.td - Describe the SPIR-V Target Machine ------*- tablegen -*-===// 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 9include "llvm/Target/Target.td" 10 11include "SPIRVRegisterInfo.td" 12include "SPIRVRegisterBanks.td" 13include "SPIRVInstrInfo.td" 14 15def SPIRVInstrInfo : InstrInfo; 16 17class Proc<string Name, list<SubtargetFeature> Features> 18 : Processor<Name, NoItineraries, Features>; 19 20def : Proc<"generic", []>; 21 22def SPIRV10 : SubtargetFeature<"spirv1.0", "SPIRVVersion", "10", 23 "Use SPIR-V version 1.0">; 24def SPIRV11 : SubtargetFeature<"spirv1.1", "SPIRVVersion", "11", 25 "Use SPIR-V version 1.1">; 26def SPIRV12 : SubtargetFeature<"spirv1.2", "SPIRVVersion", "12", 27 "Use SPIR-V version 1.2">; 28def SPIRV13 : SubtargetFeature<"spirv1.3", "SPIRVVersion", "13", 29 "Use SPIR-V version 1.3">; 30def SPIRV14 : SubtargetFeature<"spirv1.4", "SPIRVVersion", "14", 31 "Use SPIR-V version 1.4">; 32def SPIRV15 : SubtargetFeature<"spirv1.5", "SPIRVVersion", "15", 33 "Use SPIR-V version 1.5">; 34 35def SPIRVInstPrinter : AsmWriter { 36 string AsmWriterClassName = "InstPrinter"; 37 bit isMCAsmWriter = 1; 38} 39 40def SPIRV : Target { 41 let InstructionSet = SPIRVInstrInfo; 42 let AssemblyWriters = [SPIRVInstPrinter]; 43} 44