[llvm] [DXIL] Add DXIL version-specific TableGen specification and implementation of DXIL Ops (PR #97593)
S. Bharadwaj Yadavalli via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 30 13:45:29 PDT 2024
================
@@ -13,14 +13,33 @@
include "llvm/IR/Intrinsics.td"
-class DXILOpClass;
+// Abstract class to represent major and minor version values
+class Version<int major, int minor> {
+ int Major = major;
+ int Minor = minor;
+}
+
+// Valid DXIL Version records
+foreach i = 0...8 in {
+ def DXIL1_ #i : Version<1, i>;
+}
-// Following is a set of DXIL Operation classes whose names appear to be
-// arbitrary, yet need to be a substring of the function name used during
-// lowering to DXIL Operation calls. These class name strings are specified
-// as the third argument of add_dixil_op in utils/hct/hctdb.py and case converted
-// in utils/hct/hctdb_instrhelp.py of DirectXShaderCompiler repo. The function
-// name has the format "dx.op.<class-name>.<return-type>".
+// Overload type alias of llvm_any_ty
+defvar overloadTy = llvm_any_ty;
+
+// Type aliases for DXIL Op types to LLVM Types.
+// TODO: Define DXIL Types independent of LLVM types
+defvar i1Ty = llvm_i1_ty;
+defvar i8Ty = llvm_i8_ty;
+defvar i16Ty = llvm_i16_ty;
+defvar i32Ty = llvm_i32_ty;
+defvar i64Ty = llvm_i64_ty;
+defvar halfTy = llvm_half_ty;
+defvar floatTy = llvm_float_ty;
+defvar doubleTy = llvm_double_ty;
+defvar anyfloatTy = llvm_anyfloat_ty;
----------------
bharadwajy wrote:
> I don't think we need `anyfloatTy` - everywhere that it's used currently is really just `overloadTy`
Replaced `anyfloatTy` with `overloadTy`.
https://github.com/llvm/llvm-project/pull/97593
More information about the llvm-commits
mailing list