Skip to content

Commit 68855f6

Browse files
authored
Rename ConvertFToTF32INTEL to RoundFToTF32INTEL (#1913)
Extension name will be preserved for a while for binary compatibility. Signed-off-by: Sidorov, Dmitry <[email protected]>
1 parent 0933ebb commit 68855f6

File tree

7 files changed

+31
-30
lines changed

7 files changed

+31
-30
lines changed

include/LLVMSPIRVExtensions.inc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ EXT(SPV_INTEL_global_variable_decorations)
5555
EXT(SPV_INTEL_complex_float_mul_div)
5656
EXT(SPV_INTEL_split_barrier)
5757
EXT(SPV_INTEL_masked_gather_scatter)
58-
EXT(SPV_INTEL_tensor_float32_conversion)
58+
EXT(SPV_INTEL_tensor_float32_conversion) // TODO: to remove old extension
59+
EXT(SPV_INTEL_tensor_float32_rounding)
5960
EXT(SPV_EXT_relaxed_printf_string_address_space)
6061
EXT(SPV_INTEL_fpga_argument_interfaces)
6162
EXT(SPV_INTEL_fpga_latency_control)

lib/SPIRV/libSPIRV/SPIRVInstruction.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3587,10 +3587,10 @@ _SPIRV_OP(MaskedScatter, false, 5)
35873587
#undef _SPIRV_OP
35883588

35893589
template <Op OC>
3590-
class SPIRVTensorFloat32ConversionINTELInstBase : public SPIRVUnaryInst<OC> {
3590+
class SPIRVTensorFloat32RoundingINTELInstBase : public SPIRVUnaryInst<OC> {
35913591
protected:
35923592
SPIRVCapVec getRequiredCapability() const override {
3593-
return getVec(internal::CapabilityTensorFloat32ConversionINTEL);
3593+
return getVec(internal::CapabilityTensorFloat32RoundingINTEL);
35943594
}
35953595

35963596
std::optional<ExtensionID> getRequiredExtension() const override {
@@ -3611,8 +3611,8 @@ class SPIRVTensorFloat32ConversionINTELInstBase : public SPIRVUnaryInst<OC> {
36113611
// because it may call a method of class Module that may modify LiteralMap
36123612
// of Module field. That modification is not impacting validate method for
36133613
// these instructions, so const_cast is safe here.
3614-
using SPVTF32ConvTy = SPIRVTensorFloat32ConversionINTELInstBase<OC>;
3615-
SPIRVValue *Input = const_cast<SPVTF32ConvTy *>(this)->getOperand(0);
3614+
using SPVTF32RoundTy = SPIRVTensorFloat32RoundingINTELInstBase<OC>;
3615+
SPIRVValue *Input = const_cast<SPVTF32RoundTy *>(this)->getOperand(0);
36163616

36173617
SPIRVType *InCompTy = Input->getType();
36183618
SPIRVWord InCompCount = 1;
@@ -3640,8 +3640,8 @@ class SPIRVTensorFloat32ConversionINTELInstBase : public SPIRVUnaryInst<OC> {
36403640
};
36413641

36423642
#define _SPIRV_OP(x) \
3643-
typedef SPIRVTensorFloat32ConversionINTELInstBase<internal::Op##x> SPIRV##x;
3644-
_SPIRV_OP(ConvertFToTF32INTEL)
3643+
typedef SPIRVTensorFloat32RoundingINTELInstBase<internal::Op##x> SPIRV##x;
3644+
_SPIRV_OP(RoundFToTF32INTEL)
36453645
#undef _SPIRV_OP
36463646
} // namespace SPIRV
36473647

lib/SPIRV/libSPIRV/SPIRVNameMapEnum.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -632,8 +632,8 @@ template <> inline void SPIRVMap<Capability, std::string>::init() {
632632
"GlobalVariableDecorationsINTEL");
633633
add(internal::CapabilityComplexFloatMulDivINTEL, "ComplexFloatMulDivINTEL");
634634
add(internal::CapabilityMaskedGatherScatterINTEL, "MaskedGatherScatterINTEL");
635-
add(internal::CapabilityTensorFloat32ConversionINTEL,
636-
"TensorFloat32ConversionINTEL");
635+
add(internal::CapabilityTensorFloat32RoundingINTEL,
636+
"TensorFloat32RoundingINTEL");
637637
add(internal::CapabilityJointMatrixWIInstructionsINTEL,
638638
"JointMatrixWIInstructionsINTEL");
639639
add(internal::CapabilityJointMatrixTF32ComponentTypeINTEL,

lib/SPIRV/libSPIRV/SPIRVOpCodeEnumInternal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ _SPIRV_OP_INTERNAL(ComplexFMulINTEL, internal::ComplexFMulINTEL)
2020
_SPIRV_OP_INTERNAL(ComplexFDivINTEL, internal::ComplexFDivINTEL)
2121
_SPIRV_OP_INTERNAL(MaskedGatherINTEL, internal::OpMaskedGatherINTEL)
2222
_SPIRV_OP_INTERNAL(MaskedScatterINTEL, internal::OpMaskedScatterINTEL)
23-
_SPIRV_OP_INTERNAL(ConvertFToTF32INTEL, internal::ConvertFToTF32INTEL)
23+
_SPIRV_OP_INTERNAL(RoundFToTF32INTEL, internal::RoundFToTF32INTEL)

lib/SPIRV/libSPIRV/spirv_internal.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ enum InternalOp {
7272
IOpJointMatrixWorkItemLengthINTEL = 6410,
7373
IOpComplexFMulINTEL = 6415,
7474
IOpComplexFDivINTEL = 6416,
75-
IOpConvertFToTF32INTEL = 6426,
75+
IOpRoundFToTF32INTEL = 6426,
7676
IOpMaskedGatherINTEL = 6428,
7777
IOpMaskedScatterINTEL = 6429,
7878
IOpJointMatrixGetElementCoordINTEL = 6440,
@@ -99,7 +99,7 @@ enum InternalCapability {
9999
ICapFPArithmeticFenceINTEL = 6144,
100100
ICapGlobalVariableDecorationsINTEL = 6146,
101101
ICapabilityComplexFloatMulDivINTEL = 6414,
102-
ICapabilityTensorFloat32ConversionINTEL = 6425,
102+
ICapabilityTensorFloat32RoundingINTEL = 6425,
103103
ICapabilityMaskedGatherScatterINTEL = 6427,
104104
ICapabilityJointMatrixWIInstructionsINTEL = 6435,
105105
ICapabilityJointMatrixTF32ComponentTypeINTEL = 6436,
@@ -168,8 +168,8 @@ _SPIRV_OP(Capability, MaskedGatherScatterINTEL)
168168
_SPIRV_OP(Op, MaskedGatherINTEL)
169169
_SPIRV_OP(Op, MaskedScatterINTEL)
170170

171-
_SPIRV_OP(Capability, TensorFloat32ConversionINTEL)
172-
_SPIRV_OP(Op, ConvertFToTF32INTEL)
171+
_SPIRV_OP(Capability, TensorFloat32RoundingINTEL)
172+
_SPIRV_OP(Op, RoundFToTF32INTEL)
173173
#undef _SPIRV_OP
174174

175175
constexpr SourceLanguage SourceLanguagePython =

test/extensions/INTEL/SPV_INTEL_joint_matrix/joint_matrix_tf32.ll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
; RUN: llvm-spirv -r %t.spv -o %t.rev.bc
88
; RUN: llvm-dis -opaque-pointers=0 < %t.rev.bc | FileCheck %s --check-prefix=CHECK-LLVM
99

10-
; CHECK-SPIRV-DAG: Capability TensorFloat32ConversionINTEL
10+
; CHECK-SPIRV-DAG: Capability TensorFloat32RoundingINTEL
1111
; CHECK-SPIRV-DAG: Capability JointMatrixINTEL
1212
; CHECK-SPIRV-DAG: Capability JointMatrixTF32ComponentTypeINTEL
1313
; CHECK-SPIRV-DAG: Extension "SPV_INTEL_tensor_float32_conversion"
@@ -110,7 +110,7 @@ for.cond30.i: ; preds = %for.body37.i, %for.
110110

111111
for.body37.i: ; preds = %for.cond30.i
112112
%call.i218.i = tail call spir_func noundef float @_Z28__spirv_VectorExtractDynamicIfN4sycl3_V13ext6oneapi12experimental6matrix9precision4tf32ELm8ELm16ELN5__spv9MatrixUseE0ELNS8_12MatrixLayoutE0ELNS8_5Scope4FlagE3EET_PNS8_24__spirv_JointMatrixINTELIT0_XT1_EXT2_EXT4_EXT5_EXT3_EEEm(%spirv.JointMatrixINTEL._tf32_8_16_0_3_0 addrspace(4)* noundef %sub_a.sroa.0.1.i, i64 noundef %conv31.i) #3
113-
%call.i.i = tail call spir_func noundef float @_Z27__spirv_ConvertFToTF32INTELf(float noundef %call.i218.i) #3
113+
%call.i.i = tail call spir_func noundef float @_Z25__spirv_RoundFToTF32INTELf(float noundef %call.i218.i) #3
114114
%call.i225.i = tail call spir_func noundef %spirv.JointMatrixINTEL._tf32_8_16_0_3_0 addrspace(4)* @_Z27__spirv_VectorInsertDynamicIfN4sycl3_V13ext6oneapi12experimental6matrix9precision4tf32ELm8ELm16ELN5__spv9MatrixUseE0ELNS8_12MatrixLayoutE0ELNS8_5Scope4FlagE3EEPNS8_24__spirv_JointMatrixINTELIT0_XT1_EXT2_EXT4_EXT5_EXT3_EEESG_T_m(%spirv.JointMatrixINTEL._tf32_8_16_0_3_0 addrspace(4)* noundef %sub_a.sroa.0.1.i, float noundef %call.i.i, i64 noundef %conv31.i) #3
115115
%inc.i = add nuw nsw i32 %i.0.i, 1
116116
br label %for.cond30.i
@@ -130,7 +130,7 @@ for.cond.cleanup58.i: ; preds = %for.cond52.i
130130

131131
for.body59.i: ; preds = %for.cond52.i
132132
%call.i236.i = tail call spir_func noundef float @_Z28__spirv_VectorExtractDynamicIfN4sycl3_V13ext6oneapi12experimental6matrix9precision4tf32ELm16ELm16ELN5__spv9MatrixUseE1ELNS8_12MatrixLayoutE0ELNS8_5Scope4FlagE3EET_PNS8_24__spirv_JointMatrixINTELIT0_XT1_EXT2_EXT4_EXT5_EXT3_EEEm(%spirv.JointMatrixINTEL._tf32_16_16_0_3_1 addrspace(4)* noundef %sub_b.sroa.0.0.i, i64 noundef %conv53.i) #3
133-
%call.i171.i = tail call spir_func noundef float @_Z27__spirv_ConvertFToTF32INTELf(float noundef %call.i236.i) #3
133+
%call.i171.i = tail call spir_func noundef float @_Z25__spirv_RoundFToTF32INTELf(float noundef %call.i236.i) #3
134134
%call.i243.i = tail call spir_func noundef %spirv.JointMatrixINTEL._tf32_16_16_0_3_1 addrspace(4)* @_Z27__spirv_VectorInsertDynamicIfN4sycl3_V13ext6oneapi12experimental6matrix9precision4tf32ELm16ELm16ELN5__spv9MatrixUseE1ELNS8_12MatrixLayoutE0ELNS8_5Scope4FlagE3EEPNS8_24__spirv_JointMatrixINTELIT0_XT1_EXT2_EXT4_EXT5_EXT3_EEESG_T_m(%spirv.JointMatrixINTEL._tf32_16_16_0_3_1 addrspace(4)* noundef %sub_b.sroa.0.0.i, float noundef %call.i171.i, i64 noundef %conv53.i) #3
135135
%inc74.i = add nuw nsw i32 %i51.0.i, 1
136136
br label %for.cond52.i
@@ -173,7 +173,7 @@ declare dso_local spir_func noundef %spirv.JointMatrixINTEL._tf32_16_16_0_3_1 ad
173173
declare dso_local spir_func noundef i64 @_Z38__spirv_JointMatrixWorkItemLengthINTELIN4sycl3_V13ext6oneapi12experimental6matrix9precision4tf32ELm8ELm16ELN5__spv9MatrixUseE0ELNS8_12MatrixLayoutE0ELNS8_5Scope4FlagE3EEmPNS8_24__spirv_JointMatrixINTELIT_XT0_EXT1_EXT3_EXT4_EXT2_EEE(%spirv.JointMatrixINTEL._tf32_8_16_0_3_0 addrspace(4)* noundef) local_unnamed_addr #2
174174

175175
; Function Attrs: convergent
176-
declare dso_local spir_func noundef float @_Z27__spirv_ConvertFToTF32INTELf(float noundef) local_unnamed_addr #2
176+
declare dso_local spir_func noundef float @_Z25__spirv_RoundFToTF32INTELf(float noundef) local_unnamed_addr #2
177177

178178
; Function Attrs: convergent
179179
declare dso_local spir_func noundef float @_Z28__spirv_VectorExtractDynamicIfN4sycl3_V13ext6oneapi12experimental6matrix9precision4tf32ELm8ELm16ELN5__spv9MatrixUseE0ELNS8_12MatrixLayoutE0ELNS8_5Scope4FlagE3EET_PNS8_24__spirv_JointMatrixINTELIT0_XT1_EXT2_EXT4_EXT5_EXT3_EEEm(%spirv.JointMatrixINTEL._tf32_8_16_0_3_0 addrspace(4)* noundef, i64 noundef) local_unnamed_addr #2

test/extensions/INTEL/SPV_INTEL_tensor_float32_conversion/convert_tensor_float32.ll

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-n8:16:32:64"
1414
target triple = "spir64-unknown-unknown"
1515

16-
; CHECK-SPIRV: Capability TensorFloat32ConversionINTEL
16+
; CHECK-SPIRV: Capability TensorFloat32RoundingINTEL
1717
; CHECK-SPIRV: Extension "SPV_INTEL_tensor_float32_conversion"
1818
; CHECK-SPIRV: TypeFloat [[#FP32Ty:]] 32
1919
; CHECK-SPIRV: TypeVector [[#FP32v8Ty:]] [[#FP32Ty]] 8
@@ -22,24 +22,24 @@ target triple = "spir64-unknown-unknown"
2222
; CHECK-SPIRV: FunctionParameter [[#FP32Ty]] [[FP32ValId:.*]]
2323
; CHECK-SPIRV: FunctionParameter [[#FP32v8Ty]] [[FP32v8ValId:.*]]
2424

25-
; CHECK-SPIRV: ConvertFToTF32INTEL [[#FP32Ty]] [[#]] [[FP32ValId]]
26-
; CHECK-SPIRV: ConvertFToTF32INTEL [[#FP32v8Ty]] [[#]] [[FP32v8ValId]]
27-
; CHECK-SPIRV: ConvertFToTF32INTEL [[#FP32Ty]] [[#]] [[#CONST]]
25+
; CHECK-SPIRV: RoundFToTF32INTEL [[#FP32Ty]] [[#]] [[FP32ValId]]
26+
; CHECK-SPIRV: RoundFToTF32INTEL [[#FP32v8Ty]] [[#]] [[FP32v8ValId]]
27+
; CHECK-SPIRV: RoundFToTF32INTEL [[#FP32Ty]] [[#]] [[#CONST]]
2828

29-
; CHECK-LLVM: call spir_func float @_Z27__spirv_ConvertFToTF32INTELf(float
30-
; CHECK-LLVM: call spir_func <8 x float> @_Z27__spirv_ConvertFToTF32INTELDv8_f(<8 x float>
31-
; CHECK-LLVM: call spir_func float @_Z27__spirv_ConvertFToTF32INTELf(float 1.000000e+00)
29+
; CHECK-LLVM: call spir_func float @_Z25__spirv_RoundFToTF32INTELf(float
30+
; CHECK-LLVM: call spir_func <8 x float> @_Z25__spirv_RoundFToTF32INTELDv8_f(<8 x float>
31+
; CHECK-LLVM: call spir_func float @_Z25__spirv_RoundFToTF32INTELf(float 1.000000e+00)
3232

3333
define spir_func void @_Z2opffv8(float %a, <8 x float> %in) {
34-
%1 = tail call spir_func float @_Z27__spirv_ConvertFToTF32INTELf(float %a)
35-
%2 = tail call spir_func <8 x float> @_Z27__spirv_ConvertFToTF32INTELDv8_f(<8 x float> %in)
36-
%3 = tail call spir_func float @_Z27__spirv_ConvertFToTF32INTELf(float 1.000000e+00)
34+
%1 = tail call spir_func float @_Z25__spirv_RoundFToTF32INTELf(float %a)
35+
%2 = tail call spir_func <8 x float> @_Z25__spirv_RoundFToTF32INTELDv8_f(<8 x float> %in)
36+
%3 = tail call spir_func float @_Z25__spirv_RoundFToTF32INTELf(float 1.000000e+00)
3737
ret void
3838
}
3939

40-
declare spir_func float @_Z27__spirv_ConvertFToTF32INTELf(float)
40+
declare spir_func float @_Z25__spirv_RoundFToTF32INTELf(float)
4141

42-
declare spir_func <8 x float> @_Z27__spirv_ConvertFToTF32INTELDv8_f(<8 x float>)
42+
declare spir_func <8 x float> @_Z25__spirv_RoundFToTF32INTELDv8_f(<8 x float>)
4343

4444
!opencl.spir.version = !{!0}
4545
!spirv.Source = !{!1}

0 commit comments

Comments
 (0)