Files
clang-p2996/llvm/lib/Target/SPIRV/SPIRV.td
Ilia Diachkov f61eb41623 [SPIRV] support builtin functions
The patch adds support for OpenCL and SPIR-V built-in functions.
Their detection and properties are implemented using TableGen.
Five tests are added to demonstrate the improvement.

Differential Revision: https://reviews.llvm.org/D132024

Co-authored-by: Aleksandr Bezzubikov <zuban32s@gmail.com>
Co-authored-by: Michal Paszkowski <michal.paszkowski@outlook.com>
Co-authored-by: Andrey Tretyakov <andrey1.tretyakov@intel.com>
Co-authored-by: Konrad Trifunovic <konrad.trifunovic@intel.com>
2022-08-25 00:30:33 +03:00

45 lines
1.6 KiB
TableGen

//===-- SPIRV.td - Describe the SPIR-V Target Machine ------*- tablegen -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
include "llvm/Target/Target.td"
include "SPIRVRegisterInfo.td"
include "SPIRVRegisterBanks.td"
include "SPIRVInstrInfo.td"
include "SPIRVBuiltins.td"
def SPIRVInstrInfo : InstrInfo;
class Proc<string Name, list<SubtargetFeature> Features>
: Processor<Name, NoItineraries, Features>;
def : Proc<"generic", []>;
def SPIRV10 : SubtargetFeature<"spirv1.0", "SPIRVVersion", "10",
"Use SPIR-V version 1.0">;
def SPIRV11 : SubtargetFeature<"spirv1.1", "SPIRVVersion", "11",
"Use SPIR-V version 1.1">;
def SPIRV12 : SubtargetFeature<"spirv1.2", "SPIRVVersion", "12",
"Use SPIR-V version 1.2">;
def SPIRV13 : SubtargetFeature<"spirv1.3", "SPIRVVersion", "13",
"Use SPIR-V version 1.3">;
def SPIRV14 : SubtargetFeature<"spirv1.4", "SPIRVVersion", "14",
"Use SPIR-V version 1.4">;
def SPIRV15 : SubtargetFeature<"spirv1.5", "SPIRVVersion", "15",
"Use SPIR-V version 1.5">;
def SPIRVInstPrinter : AsmWriter {
string AsmWriterClassName = "InstPrinter";
bit isMCAsmWriter = 1;
}
def SPIRV : Target {
let InstructionSet = SPIRVInstrInfo;
let AssemblyWriters = [SPIRVInstPrinter];
}