xref: /freebsd/contrib/llvm-project/llvm/lib/Target/SPIRV/SPIRV.td (revision 81ad626541db97eb356e2c1d4a20eb2a26a766ab)
1*81ad6265SDimitry Andric//===-- SPIRV.td - Describe the SPIR-V Target Machine ------*- tablegen -*-===//
2*81ad6265SDimitry Andric//
3*81ad6265SDimitry Andric// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*81ad6265SDimitry Andric// See https://llvm.org/LICENSE.txt for license information.
5*81ad6265SDimitry Andric// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6*81ad6265SDimitry Andric//
7*81ad6265SDimitry Andric//===----------------------------------------------------------------------===//
8*81ad6265SDimitry Andric
9*81ad6265SDimitry Andricinclude "llvm/Target/Target.td"
10*81ad6265SDimitry Andric
11*81ad6265SDimitry Andricinclude "SPIRVRegisterInfo.td"
12*81ad6265SDimitry Andricinclude "SPIRVRegisterBanks.td"
13*81ad6265SDimitry Andricinclude "SPIRVInstrInfo.td"
14*81ad6265SDimitry Andric
15*81ad6265SDimitry Andricdef SPIRVInstrInfo : InstrInfo;
16*81ad6265SDimitry Andric
17*81ad6265SDimitry Andricclass Proc<string Name, list<SubtargetFeature> Features>
18*81ad6265SDimitry Andric : Processor<Name, NoItineraries, Features>;
19*81ad6265SDimitry Andric
20*81ad6265SDimitry Andricdef : Proc<"generic", []>;
21*81ad6265SDimitry Andric
22*81ad6265SDimitry Andricdef SPIRV10 : SubtargetFeature<"spirv1.0", "SPIRVVersion", "10",
23*81ad6265SDimitry Andric                             "Use SPIR-V version 1.0">;
24*81ad6265SDimitry Andricdef SPIRV11 : SubtargetFeature<"spirv1.1", "SPIRVVersion", "11",
25*81ad6265SDimitry Andric                             "Use SPIR-V version 1.1">;
26*81ad6265SDimitry Andricdef SPIRV12 : SubtargetFeature<"spirv1.2", "SPIRVVersion", "12",
27*81ad6265SDimitry Andric                             "Use SPIR-V version 1.2">;
28*81ad6265SDimitry Andricdef SPIRV13 : SubtargetFeature<"spirv1.3", "SPIRVVersion", "13",
29*81ad6265SDimitry Andric                             "Use SPIR-V version 1.3">;
30*81ad6265SDimitry Andricdef SPIRV14 : SubtargetFeature<"spirv1.4", "SPIRVVersion", "14",
31*81ad6265SDimitry Andric                             "Use SPIR-V version 1.4">;
32*81ad6265SDimitry Andricdef SPIRV15 : SubtargetFeature<"spirv1.5", "SPIRVVersion", "15",
33*81ad6265SDimitry Andric                             "Use SPIR-V version 1.5">;
34*81ad6265SDimitry Andric
35*81ad6265SDimitry Andricdef SPIRVInstPrinter : AsmWriter {
36*81ad6265SDimitry Andric  string AsmWriterClassName  = "InstPrinter";
37*81ad6265SDimitry Andric  bit isMCAsmWriter = 1;
38*81ad6265SDimitry Andric}
39*81ad6265SDimitry Andric
40*81ad6265SDimitry Andricdef SPIRV : Target {
41*81ad6265SDimitry Andric  let InstructionSet = SPIRVInstrInfo;
42*81ad6265SDimitry Andric  let AssemblyWriters = [SPIRVInstPrinter];
43*81ad6265SDimitry Andric}
44