xref: /llvm-project/llvm/lib/Target/DirectX/DXILConstants.h (revision 011b618644113996e2c0a8e57db40f89d20878e3)
1 //===- DXILConstants.h - Essential DXIL constants -------------------------===//
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 /// \file This file contains essential DXIL constants.
10 //===----------------------------------------------------------------------===//
11 
12 #ifndef LLVM_LIB_TARGET_DIRECTX_DXILCONSTANTS_H
13 #define LLVM_LIB_TARGET_DIRECTX_DXILCONSTANTS_H
14 
15 namespace llvm {
16 namespace dxil {
17 
18 enum class OpCode : unsigned {
19 #define DXIL_OPCODE(Op, Name) Name = Op,
20 #include "DXILOperation.inc"
21 };
22 
23 enum class OpCodeClass : unsigned {
24 #define DXIL_OPCLASS(Name) Name,
25 #include "DXILOperation.inc"
26 };
27 
28 enum class OpParamType : unsigned {
29 #define DXIL_OP_PARAM_TYPE(Name) Name,
30 #include "DXILOperation.inc"
31 };
32 
33 struct Attributes {
34 #define DXIL_ATTRIBUTE(Name) bool Name = false;
35 #include "DXILOperation.inc"
36 };
37 
38 inline Attributes operator|(Attributes a, Attributes b) {
39   Attributes c;
40 #define DXIL_ATTRIBUTE(Name) c.Name = a.Name | b.Name;
41 #include "DXILOperation.inc"
42   return c;
43 }
44 
45 inline Attributes &operator|=(Attributes &a, Attributes &b) {
46   a = a | b;
47   return a;
48 }
49 
50 struct Properties {
51 #define DXIL_PROPERTY(Name) bool Name = false;
52 #include "DXILOperation.inc"
53 };
54 
55 } // namespace dxil
56 } // namespace llvm
57 
58 #endif
59