LLVM  16.0.0git
DXILOperationCommon.h
Go to the documentation of this file.
1 //===-- DXILOperationCommon.h - DXIL Operation ------------------*- 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-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file is created to share common definitions used by both the
10 // DXILOpBuilder and the table
11 // generator.
12 // Documentation for DXIL can be found in
13 // https://github.com/Microsoft/DirectXShaderCompiler/blob/main/docs/DXIL.rst.
14 //
15 //===----------------------------------------------------------------------===//
16 
17 #ifndef LLVM_SUPPORT_DXILOPERATIONCOMMON_H
18 #define LLVM_SUPPORT_DXILOPERATIONCOMMON_H
19 
20 #include "llvm/ADT/StringSwitch.h"
21 
22 namespace llvm {
23 namespace dxil {
24 
25 enum class ParameterKind : uint8_t {
26  INVALID = 0,
27  VOID,
28  HALF,
29  FLOAT,
30  DOUBLE,
31  I1,
32  I8,
33  I16,
34  I32,
35  I64,
36  OVERLOAD,
40 };
41 
43  return StringSwitch<ParameterKind>(Name)
44  .Case("void", ParameterKind::VOID)
45  .Case("half", ParameterKind::HALF)
46  .Case("float", ParameterKind::FLOAT)
47  .Case("double", ParameterKind::DOUBLE)
48  .Case("i1", ParameterKind::I1)
49  .Case("i8", ParameterKind::I8)
50  .Case("i16", ParameterKind::I16)
51  .Case("i32", ParameterKind::I32)
52  .Case("i64", ParameterKind::I64)
54  .Case("dx.types.Handle", ParameterKind::DXIL_HANDLE)
55  .Case("dx.types.CBufRet", ParameterKind::CBUFFER_RET)
56  .Case("dx.types.ResRet", ParameterKind::RESOURCE_RET)
58 }
59 
60 } // namespace dxil
61 } // namespace llvm
62 
63 #endif
llvm::StringSwitch::Case
StringSwitch & Case(StringLiteral S, T Value)
Definition: StringSwitch.h:70
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
llvm::dxil::ParameterKind::I1
@ I1
llvm::dxil::ParameterKind::I16
@ I16
llvm::dxil::ParameterKind::INVALID
@ INVALID
llvm::dxil::parameterTypeNameToKind
ParameterKind parameterTypeNameToKind(StringRef Name)
Definition: DXILOperationCommon.h:42
llvm::dxil::ParameterKind::I8
@ I8
llvm::dxil::ParameterKind::I32
@ I32
llvm::dxil::ParameterKind::VOID
@ VOID
llvm::dxil::ParameterKind::I64
@ I64
llvm::dxil::ParameterKind::FLOAT
@ FLOAT
llvm::dxil::ParameterKind
ParameterKind
Definition: DXILOperationCommon.h:25
llvm::dxil::ParameterKind::CBUFFER_RET
@ CBUFFER_RET
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
llvm::dxil::ParameterKind::HALF
@ HALF
llvm::dxil::ParameterKind::DXIL_HANDLE
@ DXIL_HANDLE
llvm::dxil::ParameterKind::OVERLOAD
@ OVERLOAD
StringSwitch.h
llvm::dxil::ParameterKind::RESOURCE_RET
@ RESOURCE_RET
llvm::StringSwitch::Default
R Default(T Value)
Definition: StringSwitch.h:183
llvm::StringSwitch
A switch()-like statement whose cases are string literals.
Definition: StringSwitch.h:45
llvm::dxil::ParameterKind::DOUBLE
@ DOUBLE