@@ -210,6 +210,7 @@ def CooperativeMatrixLayoutOperand : OperandCategory;
210
210
def CooperativeMatrixOperandsOperand : OperandCategory;
211
211
def SpecConstantOpOperandsOperand : OperandCategory;
212
212
def MatrixMultiplyAccumulateOperandsOperand : OperandCategory;
213
+ def FPEncodingOperand : OperandCategory;
213
214
214
215
//===----------------------------------------------------------------------===//
215
216
// Definition of the Environments
@@ -382,6 +383,7 @@ defm SPV_INTEL_2d_block_io : ExtensionOperand<122, [EnvOpenCL]>;
382
383
defm SPV_INTEL_int4 : ExtensionOperand<123, [EnvOpenCL]>;
383
384
defm SPV_KHR_float_controls2 : ExtensionOperand<124, [EnvVulkan, EnvOpenCL]>;
384
385
defm SPV_INTEL_tensor_float32_conversion : ExtensionOperand<125, [EnvOpenCL]>;
386
+ defm SPV_KHR_bfloat16 : ExtensionOperand<126, [EnvVulkan, EnvOpenCL]>;
385
387
386
388
//===----------------------------------------------------------------------===//
387
389
// Multiclass used to define Capabilities enum values and at the same time
@@ -594,6 +596,9 @@ defm Subgroup2DBlockTransposeINTEL : CapabilityOperand<6230, 0, 0, [SPV_INTEL_2d
594
596
defm Int4TypeINTEL : CapabilityOperand<5112, 0, 0, [SPV_INTEL_int4], []>;
595
597
defm Int4CooperativeMatrixINTEL : CapabilityOperand<5114, 0, 0, [SPV_INTEL_int4], [Int4TypeINTEL, CooperativeMatrixKHR]>;
596
598
defm TensorFloat32RoundingINTEL : CapabilityOperand<6425, 0, 0, [SPV_INTEL_tensor_float32_conversion], []>;
599
+ defm BFloat16TypeKHR : CapabilityOperand<5116, 0, 0, [SPV_KHR_bfloat16], []>;
600
+ defm BFloat16DotProductKHR : CapabilityOperand<5117, 0, 0, [SPV_KHR_bfloat16], [BFloat16TypeKHR]>;
601
+ defm BFloat16CooperativeMatrixKHR : CapabilityOperand<5118, 0, 0, [SPV_KHR_bfloat16], [BFloat16TypeKHR, CooperativeMatrixKHR]>;
597
602
598
603
//===----------------------------------------------------------------------===//
599
604
// Multiclass used to define SourceLanguage enum values and at the same time
@@ -1996,3 +2001,28 @@ defm MatrixAPackedFloat16INTEL : MatrixMultiplyAccumulateOperandsOperand<0x400,
1996
2001
defm MatrixBPackedFloat16INTEL : MatrixMultiplyAccumulateOperandsOperand<0x800, [SPV_INTEL_subgroup_matrix_multiply_accumulate]>;
1997
2002
defm MatrixAPackedBFloat16INTEL : MatrixMultiplyAccumulateOperandsOperand<0x1000, [SPV_INTEL_subgroup_matrix_multiply_accumulate]>;
1998
2003
defm MatrixBPackedBFloat16INTEL : MatrixMultiplyAccumulateOperandsOperand<0x2000, [SPV_INTEL_subgroup_matrix_multiply_accumulate]>;
2004
+
2005
+ //===----------------------------------------------------------------------===//
2006
+ // Multiclass used to define FPEncoding enum values and at the
2007
+ // same time SymbolicOperand entries with extensions.
2008
+ //===----------------------------------------------------------------------===//
2009
+ def FPEncoding : GenericEnum, Operand<i32> {
2010
+ let FilterClass = "FPEncoding";
2011
+ let NameField = "Name";
2012
+ let ValueField = "Value";
2013
+ let PrintMethod = !strconcat("printSymbolicOperand<OperandCategory::", FilterClass, "Operand>");
2014
+ }
2015
+
2016
+ class FPEncoding<string name, bits<32> value> {
2017
+ string Name = name;
2018
+ bits<32> Value = value;
2019
+ }
2020
+
2021
+ multiclass FPEncodingOperand<bits<32> value, list<Extension> reqExtensions>{
2022
+ def NAME : FPEncoding<NAME, value>;
2023
+ defm : SymbolicOperandWithRequirements<
2024
+ FPEncodingOperand, value, NAME, 0, 0,
2025
+ reqExtensions, [], []>;
2026
+ }
2027
+
2028
+ defm BFloat16KHR : FPEncodingOperand<0, [SPV_KHR_bfloat16]>;
0 commit comments