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