diff --git a/docs/command-line-slangc-reference.md b/docs/command-line-slangc-reference.md index e14dea96906..3657c4c06be 100644 --- a/docs/command-line-slangc-reference.md +++ b/docs/command-line-slangc-reference.md @@ -1196,7 +1196,6 @@ A capability describes an optional feature that a target may or may not support. * `metallib_3_1` * `hlsl_nvapi` * `hlsl_2018` -* `hlsl_coopvec_poc` * `optix_coopvec` * `optix_multilevel_traversal` * `vertex` @@ -1295,7 +1294,6 @@ A capability describes an optional feature that a target may or may not support. * `spvVulkanMemoryModelDeviceScopeKHR` * `spvBindlessTextureNV` * `metallib_latest` -* `hlsl_coopvec_poc_sm_6_9` * `dxil_lib` * `any_target` * `any_textual_target` diff --git a/docs/user-guide/a3-02-reference-capability-atoms.md b/docs/user-guide/a3-02-reference-capability-atoms.md index 3bc5b5a4fc4..50226d20b44 100644 --- a/docs/user-guide/a3-02-reference-capability-atoms.md +++ b/docs/user-guide/a3-02-reference-capability-atoms.md @@ -206,9 +206,6 @@ Versions `hlsl_2018` > Represent HLSL compatibility support. -`hlsl_coopvec_poc` -> Represent compatibility support for the deprecated POC DXC - `hlsl_nvapi` > Represents HLSL NVAPI support. @@ -1107,11 +1104,6 @@ Compound Capabilities `helper_lane` > Capabilities required to enable helper-lane demotion -`hlsl_coopvec_poc_sm_6_9` -> Represent compatibility support for the deprecated POC DXC, but we need to use -> this capability to be compatible with cooperative_vector in target_switch, so -> join '_sm_6_9' here. - `hlsl_spirv` > HLSL, and SPIRV code-gen targets diff --git a/source/slang/hlsl.meta.slang b/source/slang/hlsl.meta.slang index d37d916faf0..3759d9ba7e0 100644 --- a/source/slang/hlsl.meta.slang +++ b/source/slang/hlsl.meta.slang @@ -25920,7 +25920,6 @@ struct CoopVec : IArray, IArithmeti [ForceInline] [require(cooperative_vector)] - [require(hlsl_coopvec_poc)] __init() { this = CoopVec(T(0)); @@ -25928,7 +25927,6 @@ struct CoopVec : IArray, IArithmeti [ForceInline] [require(cooperative_vector)] - [require(hlsl_coopvec_poc)] __init(T t) { this.fill(t); @@ -25936,7 +25934,6 @@ struct CoopVec : IArray, IArithmeti [ForceInline] [require(cooperative_vector)] - [require(hlsl_coopvec_poc)] [require(optix_coopvec)] __init(CoopVec other) { @@ -25954,7 +25951,6 @@ struct CoopVec : IArray, IArithmeti [OverloadRank(-10)] [ForceInline] [require(cooperative_vector)] - [require(hlsl_coopvec_poc)] __init(int i) { this = CoopVec(T(i)); @@ -25976,7 +25972,6 @@ struct CoopVec : IArray, IArithmeti [mutating] [ForceInline] [require(cooperative_vector)] - [require(hlsl_coopvec_poc)] [require(optix_coopvec)] void copyFrom(CoopVec other) { @@ -25984,8 +25979,6 @@ struct CoopVec : IArray, IArithmeti { case hlsl: __intrinsic_asm "$0 = $1"; - case hlsl_coopvec_poc: - __intrinsic_asm ".CopyFrom"; case optix_coopvec: __intrinsic_asm "optixCoopVecCvt>(*($0))", T, N; default: @@ -26004,7 +25997,6 @@ struct CoopVec : IArray, IArithmeti /// @param t The value to fill all elements with. [mutating] [require(cooperative_vector)] - [require(hlsl_coopvec_poc)] void fill(T t) { __target_switch @@ -26017,8 +26009,6 @@ struct CoopVec : IArray, IArithmeti }; case hlsl: __intrinsic_asm "$0 = $1"; - case hlsl_coopvec_poc: - __intrinsic_asm ".Fill"; default: for(int i = 0; i < N; ++i) this[i] = t; @@ -26035,7 +26025,6 @@ struct CoopVec : IArray, IArithmeti /// @param buffer The destination buffer to store the values into. /// @param byteOffset16ByteAligned The byte offset from the start of the buffer where the data will be stored. Must be 16-byte aligned. [require(cooperative_vector)] - [require(hlsl_coopvec_poc)] void store(RWByteAddressBuffer buffer, int32_t byteOffset16ByteAligned = 0) { __target_switch @@ -26048,11 +26037,7 @@ struct CoopVec : IArray, IArithmeti OpCooperativeVectorStoreNV $ptr $byteOffset16ByteAligned $this None; }; case hlsl: - __intrinsic_asm "$1.Store< vector<$[0], $[1]> >($2, $0)", T, N; - case hlsl_coopvec_poc: - for(int i = 0; i < N; ++i) - buffer.StoreByteOffset(byteOffset16ByteAligned + __elemToByteOffset(i), this[i]); - return; + __intrinsic_asm "$1.Store< vector<$[0], $[1]> >($2, $0)", T, N; default: for(int i = 0; i < N; ++i) buffer.StoreByteOffset(byteOffset16ByteAligned + __elemToByteOffset(i), this[i]); @@ -26106,7 +26091,6 @@ struct CoopVec : IArray, IArithmeti [ForceInline] [require(cooperative_vector)] - [require(hlsl_coopvec_poc)] void store(__ref groupshared T[M] data, int32_t byteOffset16ByteAligned = 0) { static_assert(N <= M, "The destination vector size is smaller than the input."); @@ -26116,8 +26100,6 @@ struct CoopVec : IArray, IArithmeti spirv_asm{ OpCooperativeVectorStoreNV &data $byteOffset16ByteAligned $this None; }; - case hlsl_coopvec_poc: - this.__Store(data, __byteToElemOffset(byteOffset16ByteAligned)); return; default: for(int i = 0; i < N; ++i) @@ -26163,7 +26145,6 @@ struct CoopVec : IArray, IArithmeti /// @return A new cooperative vector containing the loaded values. [__NoSideEffect] [require(cooperative_vector)] - [require(hlsl_coopvec_poc)] [require(optix_coopvec)] static CoopVec load(ByteAddressBuffer buffer, int32_t byteOffset16ByteAligned = 0) { @@ -26176,7 +26157,6 @@ struct CoopVec : IArray, IArithmeti result:$$CoopVec = OpCooperativeVectorLoadNV $ptr $byteOffset16ByteAligned None; }; case hlsl: - case hlsl_coopvec_poc: CoopVec ret; ret.__Load(buffer, byteOffset16ByteAligned); return ret; @@ -26193,7 +26173,6 @@ struct CoopVec : IArray, IArithmeti [__NoSideEffect] [require(cooperative_vector)] - [require(hlsl_coopvec_poc)] [require(optix_coopvec)] static CoopVec load(RWByteAddressBuffer buffer, int32_t byteOffset16ByteAligned = 0) { @@ -26206,7 +26185,6 @@ struct CoopVec : IArray, IArithmeti result:$$CoopVec = OpCooperativeVectorLoadNV $ptr $byteOffset16ByteAligned None; }; case hlsl: - case hlsl_coopvec_poc: CoopVec ret; ret.__Load(buffer, byteOffset16ByteAligned); return ret; @@ -26223,7 +26201,6 @@ struct CoopVec : IArray, IArithmeti [__NoSideEffect] [require(cooperative_vector)] - [require(hlsl_coopvec_poc)] static CoopVec load(StructuredBuffer buffer, int32_t byteOffset16ByteAligned = 0) { __target_switch @@ -26294,7 +26271,6 @@ struct CoopVec : IArray, IArithmeti [ForceInline] [__NoSideEffect] [require(cooperative_vector)] - [require(hlsl_coopvec_poc)] [require(optix_coopvec)] static CoopVec load(__constref groupshared const T[M] data, int32_t byteOffset16ByteAligned = 0) { @@ -26306,7 +26282,6 @@ struct CoopVec : IArray, IArithmeti result:$$CoopVec = OpCooperativeVectorLoadNV &data $byteOffset16ByteAligned None }; case hlsl: - case hlsl_coopvec_poc: CoopVec ret; ret.__Load(data, __byteToElemOffset(byteOffset16ByteAligned)); return ret; @@ -26381,13 +26356,10 @@ struct CoopVec : IArray, IArithmeti [__NoSideEffect] [nonmutating] [require(cooperative_vector)] - [require(hlsl_coopvec_poc)] get { __target_switch { - case hlsl_coopvec_poc: - __intrinsic_asm ".ReadFromIndex"; default: return __indexRead(index); } } @@ -26395,13 +26367,10 @@ struct CoopVec : IArray, IArithmeti [ForceInline] [mutating] [require(cooperative_vector)] - [require(hlsl_coopvec_poc)] set { __target_switch { - case hlsl_coopvec_poc: - __intrinsic_asm ".WriteToIndex"; default: __indexRef(index) = newValue; } } @@ -26418,7 +26387,6 @@ struct CoopVec : IArray, IArithmeti /// @param t The scalar value to replicate across all elements. /// @return A new cooperative vector where each element equals the input value. [require(cooperative_vector)] - [require(hlsl_coopvec_poc)] static CoopVec replicate(T t) { CoopVec ret; @@ -26499,15 +26467,12 @@ struct CoopVec : IArray, IArithmeti [mutating] [ForceInline] [require(hlsl)] - [require(hlsl_coopvec_poc)] void __mutAdd(This other) { __target_switch { case hlsl: __intrinsic_asm "$0 += $1"; - case hlsl_coopvec_poc: - __intrinsic_asm ".Add"; } } @@ -26517,7 +26482,6 @@ struct CoopVec : IArray, IArithmeti // TODO: Why is this ForceInline necessary for hlsl, dxc bug? [ForceInline] [require(cooperative_vector)] - [require(hlsl_coopvec_poc)] [require(optix_coopvec)] This add(This other) { @@ -26525,10 +26489,6 @@ struct CoopVec : IArray, IArithmeti { case hlsl: __intrinsic_asm "$0 + $1"; - case hlsl_coopvec_poc: - This ret = this; - ret.__mutAdd(other); - return ret; case optix_coopvec: __intrinsic_asm "optixCoopVecAdd($0, $1)"; default: return __pureAdd(other); @@ -26540,13 +26500,11 @@ struct CoopVec : IArray, IArithmeti [mutating] [require(hlsl)] - [require(hlsl_coopvec_poc)] void __mutSub(This other) { __target_switch { case hlsl: __intrinsic_asm "$0 -= $1"; - case hlsl_coopvec_poc: __intrinsic_asm ".Subtract"; } } @@ -26555,7 +26513,6 @@ struct CoopVec : IArray, IArithmeti /// @return A new cooperative vector containing the difference of the two vectors. [ForceInline] [require(cooperative_vector)] - [require(hlsl_coopvec_poc)] [require(optix_coopvec)] This sub(This other) { @@ -26563,10 +26520,6 @@ struct CoopVec : IArray, IArithmeti { case hlsl: __intrinsic_asm "$0 - $1"; - case hlsl_coopvec_poc: - This ret = this; - ret.__mutSub(other); - return ret; case optix_coopvec: __intrinsic_asm "optixCoopVecSub($0, $1)"; default: return __pureSub(other); @@ -26578,13 +26531,11 @@ struct CoopVec : IArray, IArithmeti [mutating] [require(hlsl)] - [require(hlsl_coopvec_poc)] void __mutMul(This other) { __target_switch { case hlsl: __intrinsic_asm "$0 *= $1"; - case hlsl_coopvec_poc: __intrinsic_asm ".Multiply"; } } @@ -26593,7 +26544,6 @@ struct CoopVec : IArray, IArithmeti /// @return A new cooperative vector containing the product of the two vectors. [ForceInline] [require(cooperative_vector)] - [require(hlsl_coopvec_poc)] [require(optix_coopvec)] This mul(This other) { @@ -26601,10 +26551,6 @@ struct CoopVec : IArray, IArithmeti { case hlsl: __intrinsic_asm "$0 * $1"; - case hlsl_coopvec_poc: - This ret = this; - ret.__mutMul(other); - return ret; case optix_coopvec: __intrinsic_asm "optixCoopVecMul($0, $1)"; default: return __pureMul(other); @@ -26616,13 +26562,11 @@ struct CoopVec : IArray, IArithmeti [mutating] [require(hlsl)] - [require(hlsl_coopvec_poc)] void __mutDiv(This other) { __target_switch { case hlsl: __intrinsic_asm "$0 /= $1"; - case hlsl_coopvec_poc: __intrinsic_asm ".Divide"; } } @@ -26631,30 +26575,23 @@ struct CoopVec : IArray, IArithmeti /// @return A new cooperative vector containing the quotient of the two vectors. [ForceInline] [require(cooperative_vector)] - [require(hlsl_coopvec_poc)] This div(This other) { __target_switch { case hlsl: __intrinsic_asm "$0 / $1"; - case hlsl_coopvec_poc: - This ret = this; - ret.__mutDiv(other); - return ret; default: return __pureDiv(other); } } [mutating] [require(hlsl)] - [require(hlsl_coopvec_poc)] void __mutMod(This other) { __target_switch { case hlsl: __intrinsic_asm "$0 %= %1"; - case hlsl_coopvec_poc: __intrinsic_asm ".Mod"; } } @@ -26663,17 +26600,12 @@ struct CoopVec : IArray, IArithmeti /// @return A new cooperative vector containing the remainder of the division between corresponding components. [ForceInline] [require(cooperative_vector)] - [require(hlsl_coopvec_poc)] This mod(This other) { __target_switch { case hlsl: __intrinsic_asm "$0 % $1"; - case hlsl_coopvec_poc: - This ret = this; - ret.__mutMod(other); - return ret; default: This ret; for(int i = 0; i < N; ++i) @@ -26689,67 +26621,53 @@ struct CoopVec : IArray, IArithmeti /// @return A new cooperative vector containing the negated values. //[ForceInline] [require(cooperative_vector)] - [require(hlsl_coopvec_poc)] This neg() { __target_switch { case hlsl: __intrinsic_asm "-$0"; - case hlsl_coopvec_poc: - This ret = this; - for(int i = 0; i < N; ++i) - ret[i] = -this[i]; - return ret; default: return __pureNeg(this); } } [mutating] [require(hlsl)] - [require(hlsl_coopvec_poc)] void __mutScalarMul(T t) { __target_switch { case hlsl: __intrinsic_asm "$0 *= $1"; - case hlsl_coopvec_poc: __intrinsic_asm ".ScalarMultiply"; } } [mutating] [require(hlsl)] - [require(hlsl_coopvec_poc)] void __mutMin(This other) { __target_switch { case hlsl: static_assert(false, "Not supported"); - case hlsl_coopvec_poc: __intrinsic_asm ".Min"; } } [mutating] [require(hlsl)] - [require(hlsl_coopvec_poc)] void __mutMax(This other) { __target_switch { case hlsl: static_assert(false, "Not supported"); - case hlsl_coopvec_poc: __intrinsic_asm ".Max"; } } [mutating] [require(hlsl)] - [require(hlsl_coopvec_poc)] void __mutClamp(This minVal, This maxVal) { __target_switch { case hlsl: static_assert(false, "Not supported"); - case hlsl_coopvec_poc: __intrinsic_asm ".Clamp"; } } @@ -26760,30 +26678,24 @@ struct CoopVec : IArray, IArithmeti [mutating] [ForceInline] [require(hlsl, byteaddressbuffer)] - [require(hlsl_coopvec_poc, byteaddressbuffer)] void __Load(const ByteAddressBuffer buffer, uint byteOffset, uint alignment = 0) { __target_switch { case hlsl: __intrinsic_asm "$0 = $1.Load< vector<$[0], $[1]> >($2)", T, N; - case hlsl_coopvec_poc: - __intrinsic_asm ".Load"; } } [mutating] [ForceInline] [require(hlsl, byteaddressbuffer_rw)] - [require(hlsl_coopvec_poc, byteaddressbuffer_rw)] void __Load(const RWByteAddressBuffer buffer, uint byteOffset, uint alignment = 0) { __target_switch { case hlsl: __intrinsic_asm "$0 = $1.Load< vector<$[0], $[1]> >($2)", T, N; - case hlsl_coopvec_poc: - __intrinsic_asm ".Load"; } } @@ -26792,7 +26704,6 @@ struct CoopVec : IArray, IArithmeti // Careful, this takes the offset in elements [ForceInline] [require(hlsl)] - [require(hlsl_coopvec_poc_sm_6_9)] void __Load(__constref groupshared T buffer[M], uint elemOffset) { static_assert(N <= M, "The given groupshared array is smaller than the given CoopVec"); @@ -26803,32 +26714,26 @@ struct CoopVec : IArray, IArithmeti for(int i = 0; i < N; ++i) this[i] = buffer[i + elemOffset]; return; - case hlsl_coopvec_poc_sm_6_9: - __intrinsic_asm ".Load"; } } [require(hlsl, byteaddressbuffer_rw)] - [require(hlsl_coopvec_poc, byteaddressbuffer_rw)] void __Store(RWByteAddressBuffer buffer, uint byteOffset, uint alignment = 0) { __target_switch { case hlsl: static_assert(false, "Not supported"); - case hlsl_coopvec_poc: __intrinsic_asm ".Store"; } } __generic [require(hlsl)] - [require(hlsl_coopvec_poc)] // Careful, this takes the offset in elements void __Store(__ref groupshared T buffer[M], uint elemOffset) { __target_switch { case hlsl: static_assert(false, "Not supported"); - case hlsl_coopvec_poc: __intrinsic_asm ".Store"; } } @@ -26846,7 +26751,6 @@ $} [mutating] [ForceInline] [require(hlsl, byteaddressbuffer_rw)] - [require(hlsl_coopvec_poc, byteaddressbuffer_rw)] void __mutMatMul( CoopVec input, uint inputInterpretationHLSL, $(buffer.type) matrix, uint matrixOffset, uint matrixInterpretationHLSL, @@ -26869,15 +26773,12 @@ $} else __intrinsic_asm "__builtin_MatVecMul($0, true, $1, true, $2, $3, $4, $5, $6, $7, $8, $9, $10)"; } - case hlsl_coopvec_poc: - __intrinsic_asm ".MatMul"; } } [mutating] [ForceInline] [require(hlsl, byteaddressbuffer_rw)] - [require(hlsl_coopvec_poc, byteaddressbuffer_rw)] void __mutMatMulAdd( CoopVec input, uint inputInterpretationHLSL, $(buffer.type) matrix, uint matrixOffset, uint matrixInterpretationHLSL, @@ -26901,8 +26802,6 @@ $} else __intrinsic_asm "__builtin_MatVecMulAdd($0, true, $1, true, $2, $3, $4, $5, $9, $10, $11, $12, $13, $6, $7, $8)"; } - case hlsl_coopvec_poc: - __intrinsic_asm ".MatMulAdd"; } } @@ -26921,7 +26820,6 @@ $} /// values to use from the packed input. [mutating] [require(cooperative_vector)] - [require(hlsl_coopvec_poc)] [require(optix_coopvec)] void matMulAccumPacked( CoopVec input, @@ -26987,7 +26885,6 @@ $} [mutating] [ForceInline] [require(cooperative_vector)] - [require(hlsl_coopvec_poc)] [require(optix_coopvec)] void matMulAccum( CoopVec input, @@ -27017,7 +26914,6 @@ $} [mutating] [require(cooperative_vector)] - [require(hlsl_coopvec_poc)] [require(optix_coopvec)] void matMulAddAccumPacked( CoopVec input, @@ -27098,7 +26994,6 @@ $} [mutating] [ForceInline] [require(cooperative_vector)] - [require(hlsl_coopvec_poc)] [require(optix_coopvec)] void matMulAddAccum( CoopVec input, @@ -27182,7 +27077,6 @@ CoopVec __float_to_int_cast(CoopVec val); __generic [ForceInline] [require(cooperative_vector)] -[require(hlsl_coopvec_poc)] CoopVec operator *(CoopVec lhs, const T rhs) { __target_switch @@ -27205,10 +27099,6 @@ CoopVec operator *(CoopVec lhs, const T rhs) } case hlsl: __intrinsic_asm "$0 * $1"; - case hlsl_coopvec_poc: - CoopVec ret = lhs; - ret.__mutScalarMul(rhs); - return ret; default: for (int i = 0; i < N; ++i) { @@ -27221,7 +27111,6 @@ CoopVec operator *(CoopVec lhs, const T rhs) __generic [ForceInline] [require(cooperative_vector)] -[require(hlsl_coopvec_poc)] CoopVec operator *(const T lhs, CoopVec rhs) { return rhs * lhs; @@ -27229,7 +27118,6 @@ CoopVec operator *(const T lhs, CoopVec rhs) [ForceInline] [require(cooperative_vector)] -[require(hlsl_coopvec_poc)] [require(optix_coopvec)] CoopVec min(CoopVec x, CoopVec y) { @@ -27242,10 +27130,6 @@ CoopVec min(CoopVec x, }; case hlsl: __intrinsic_asm "min($0, $1)"; - case hlsl_coopvec_poc: - CoopVec ret = x; - ret.__mutMin(y); - return ret; case optix_coopvec: __intrinsic_asm "optixCoopVecMin($0, $1)"; default: @@ -27259,7 +27143,6 @@ CoopVec min(CoopVec x, [ForceInline] [require(cooperative_vector)] -[require(hlsl_coopvec_poc)] [require(optix_coopvec)] CoopVec max(CoopVec x, CoopVec y) { @@ -27272,10 +27155,6 @@ CoopVec max(CoopVec x, }; case hlsl: __intrinsic_asm "max($0, $1)"; - case hlsl_coopvec_poc: - CoopVec ret = x; - ret.__mutMax(y); - return ret; case optix_coopvec: __intrinsic_asm "optixCoopVecMax($0, $1)"; default: @@ -27288,7 +27167,6 @@ CoopVec max(CoopVec x, [ForceInline] [require(cooperative_vector)] -[require(hlsl_coopvec_poc)] CoopVec clamp(CoopVec x, CoopVec minVal, CoopVec maxVal) { __target_switch @@ -27300,10 +27178,6 @@ CoopVec clamp(CoopVec x }; case hlsl: __intrinsic_asm "clamp($0, $1, $2)"; - case hlsl_coopvec_poc: - CoopVec ret = x; - ret.__mutClamp(minVal, maxVal); - return ret; default: CoopVec ret; for(int i = 0; i < N; ++i) @@ -27314,7 +27188,6 @@ CoopVec clamp(CoopVec x [ForceInline] [require(cooperative_vector)] -[require(hlsl_coopvec_poc)] CoopVec min(CoopVec x, CoopVec y) { __target_switch @@ -27336,10 +27209,6 @@ CoopVec min(CoopVec x, CoopVe } case hlsl: __intrinsic_asm "min($0, $1)"; - case hlsl_coopvec_poc: - CoopVec ret = x; - ret.__mutMin(y); - return ret; default: CoopVec ret; for(int i = 0; i < N; ++i) @@ -27351,7 +27220,6 @@ CoopVec min(CoopVec x, CoopVe // [ForceInline] [require(cooperative_vector)] -[require(hlsl_coopvec_poc)] CoopVec max(CoopVec x, CoopVec y) { __target_switch @@ -27373,10 +27241,6 @@ CoopVec max(CoopVec x, CoopVe } case hlsl: __intrinsic_asm "max($0, $1)"; - case hlsl_coopvec_poc: - CoopVec ret = x; - ret.__mutMax(y); - return ret; default: CoopVec ret; for(int i = 0; i < N; ++i) @@ -27387,7 +27251,6 @@ CoopVec max(CoopVec x, CoopVe // [ForceInline] [require(cooperative_vector)] -[require(hlsl_coopvec_poc)] CoopVec clamp(CoopVec x, CoopVec minVal, CoopVec maxVal) { __target_switch @@ -27409,10 +27272,6 @@ CoopVec clamp(CoopVec x, Coop } case hlsl: __intrinsic_asm "clamp($0, $1, $2)"; - case hlsl_coopvec_poc: - CoopVec ret = x; - ret.__mutClamp(minVal, maxVal); - return ret; default: CoopVec ret; for(int i = 0; i < N; ++i) @@ -27423,7 +27282,6 @@ CoopVec clamp(CoopVec x, Coop // [ForceInline] [require(cooperative_vector)] -[require(hlsl_coopvec_poc)] [require(optix_coopvec)] CoopVec step(CoopVec edge, CoopVec x) { @@ -27431,11 +27289,6 @@ CoopVec step(CoopVec ed { case hlsl: __intrinsic_asm "step($0, $1)"; - case hlsl_coopvec_poc: - CoopVec ret; - for(int i = 0; i < N; ++i) - ret[i] = step(edge[i], x[i]); - return ret; case spirv: return spirv_asm { @@ -27453,18 +27306,12 @@ CoopVec step(CoopVec ed // [ForceInline] [require(cooperative_vector)] -[require(hlsl_coopvec_poc)] CoopVec exp(CoopVec x) { __target_switch { case hlsl: __intrinsic_asm "exp($0)"; - case hlsl_coopvec_poc: - CoopVec ret; - for(int i = 0; i < N; ++i) - ret[i] = exp(x[i]); - return ret; case spirv: return spirv_asm { @@ -27480,18 +27327,12 @@ CoopVec exp(CoopVec x) // [ForceInline] [require(cooperative_vector)] -[require(hlsl_coopvec_poc)] CoopVec log(CoopVec x) { __target_switch { case hlsl: __intrinsic_asm "log($0)"; - case hlsl_coopvec_poc: - CoopVec ret; - for(int i = 0; i < N; ++i) - ret[i] = log(x[i]); - return ret; case spirv: return spirv_asm { @@ -27507,7 +27348,6 @@ CoopVec log(CoopVec x) // [ForceInline] [require(cooperative_vector)] -[require(hlsl_coopvec_poc)] [require(optix_coopvec)] CoopVec log2(CoopVec x) { @@ -27525,7 +27365,6 @@ CoopVec log2(CoopVec x) // [ForceInline] [require(cooperative_vector)] -[require(hlsl_coopvec_poc)] [require(optix_coopvec)] CoopVec exp2(CoopVec x) { @@ -27543,7 +27382,6 @@ CoopVec exp2(CoopVec x) // [ForceInline] [require(cooperative_vector)] -[require(hlsl_coopvec_poc)] [require(optix_coopvec)] CoopVec tanh(CoopVec x) { @@ -27551,11 +27389,6 @@ CoopVec tanh(CoopVec x) { case hlsl: __intrinsic_asm "tanh($0)"; - case hlsl_coopvec_poc: - CoopVec ret; - for(int i = 0; i < N; ++i) - ret[i] = tanh(x[i]); - return ret; case spirv: return spirv_asm { @@ -27573,18 +27406,12 @@ CoopVec tanh(CoopVec x) // [ForceInline] [require(cooperative_vector)] -[require(hlsl_coopvec_poc)] CoopVec atan(CoopVec yOverX) { __target_switch { case hlsl: __intrinsic_asm "atan($0)"; - case hlsl_coopvec_poc: - CoopVec ret; - for(int i = 0; i < N; ++i) - ret[i] = atan(yOverX[i]); - return ret; case spirv: return spirv_asm { @@ -27601,7 +27428,6 @@ CoopVec atan(CoopVec yO // [ForceInline] [require(cooperative_vector)] [require(cooperative_vector)] -[require(hlsl_coopvec_poc)] [require(optix_coopvec)] [require(GL_ARB_gpu_shader5)] CoopVec fma(CoopVec a, CoopVec b, CoopVec c) @@ -27613,11 +27439,6 @@ CoopVec fma(CoopVec a, { case hlsl: __intrinsic_asm "mad($0, $1, $2)"; - case hlsl_coopvec_poc: - CoopVec ret; - for(int i = 0; i < N; ++i) - ret[i] = mad(a[i], b[i], c[i]); - return ret; case spirv: return spirv_asm { @@ -27928,37 +27749,6 @@ uint32_t __getHLSLCoopVecComponentType(CoopVecComponentType componentType) static_assert(false, "unsupported componentType value"); } return 0; // ComponentType::Invalid - case hlsl_coopvec_poc: - switch (componentType) - { - case CoopVecComponentType::Float16: - return 0; - case CoopVecComponentType::Float32: - return 1; - case CoopVecComponentType::UnsignedInt8: - return 2; - case CoopVecComponentType::UnsignedInt16: - return 3; - case CoopVecComponentType::UnsignedInt32: - return 4; - case CoopVecComponentType::SignedInt8: - return 5; - case CoopVecComponentType::SignedInt16: - return 6; - case CoopVecComponentType::SignedInt32: - return 7; - case CoopVecComponentType::SignedInt8Packed: - return 8; - case CoopVecComponentType::UnsignedInt8Packed: - return 9; - case CoopVecComponentType::FloatE4M3: - return 10; - case CoopVecComponentType::FloatE5M2: - return 11; - default: - static_assert(false, "unsupported componentType value"); - } - return 32; } } @@ -28014,7 +27804,6 @@ $} // Internal implementation without static_assert; github issue 8620 [ForceInline] [require(cooperative_vector)] -[require(hlsl_coopvec_poc)] [require(optix_coopvec)] __generic CoopVec __coopVecMatMulPacked_impl( @@ -28173,7 +27962,6 @@ CoopVec __coopVecMatMulPacked_impl( // need it [ForceInline] [require(cooperative_vector)] -[require(hlsl_coopvec_poc)] [require(optix_coopvec)] __generic CoopVec coopVecMatMulPacked( @@ -28229,7 +28017,6 @@ CoopVec coopVecMatMulPacked( /// When `memoryLayout` is `InferencingOptimal` or `TrainingOptimal`, `matrixStride` is ignored. [ForceInline] [require(cooperative_vector)] -[require(hlsl_coopvec_poc)] [require(optix_coopvec)] __generic CoopVec coopVecMatMul( @@ -28261,7 +28048,6 @@ CoopVec coopVecMatMul( // Internal implementation without static_assert; github issue 8620 [ForceInline] [require(cooperative_vector)] -[require(hlsl_coopvec_poc)] [require(optix_coopvec)] CoopVec __coopVecMatMulAddPacked_impl( CoopVec input, @@ -28422,7 +28208,6 @@ CoopVec __coopVecMatMulAddPacked_impl coopVecMatMulAddPacked( CoopVec input, @@ -28471,7 +28256,6 @@ CoopVec coopVecMatMulAddPacked CoopVec coopVecMatMulAdd( @@ -28540,7 +28324,6 @@ $} /// } /// ``` [require(cooperative_vector)] -[require(hlsl_coopvec_poc_sm_6_9)] [require(optix_coopvec)] void coopVecOuterProductAccumulate( CoopVec a, @@ -28558,8 +28341,6 @@ void coopVecOuterProductAccumulate( CoopVec v, @@ -28650,8 +28430,6 @@ void coopVecReduceSumAccumulate( { case hlsl: __intrinsic_asm "__builtin_VectorAccumulate($0, $1, $2)"; - case hlsl_coopvec_poc: - __intrinsic_asm "$0.ReduceSumAccumulate($1, $2)"; case spirv: let bufferPtr = buffer.GetBufferPointer(); spirv_asm diff --git a/source/slang/slang-capabilities.capdef b/source/slang/slang-capabilities.capdef index e2de792fa73..6f208f92e36 100644 --- a/source/slang/slang-capabilities.capdef +++ b/source/slang/slang-capabilities.capdef @@ -224,16 +224,6 @@ def hlsl_nvapi : hlsl; /// [Version] def hlsl_2018 : _sm_5_1; -/// Represent compatibility support for the deprecated POC DXC -/// [Version] -def hlsl_coopvec_poc : _sm_6_8; - -/// Represent compatibility support for the deprecated POC DXC, but we need to use -/// this capability to be compatible with cooperative_vector in target_switch, so -/// join '_sm_6_9' here. -/// [Compound] -alias hlsl_coopvec_poc_sm_6_9 = hlsl_coopvec_poc + _sm_6_9; - /// Represents capabilities required for DXIL Library compilation. /// [Version] alias dxil_lib = _sm_6_3; diff --git a/source/slang/slang-emit-c-like.cpp b/source/slang/slang-emit-c-like.cpp index 11ea2e98913..765b8ebddb7 100644 --- a/source/slang/slang-emit-c-like.cpp +++ b/source/slang/slang-emit-c-like.cpp @@ -111,7 +111,6 @@ CLikeSourceEmitter::CLikeSourceEmitter(const Desc& desc) m_effectiveProfile = desc.effectiveProfile; auto targetCaps = getTargetReq()->getTargetCaps(); - isCoopvecPoc = targetCaps.implies(CapabilityAtom::hlsl_coopvec_poc); isOptixCoopVec = targetCaps.implies(CapabilityAtom::optix_coopvec); } @@ -3146,33 +3145,18 @@ void CLikeSourceEmitter::_emitInst(IRInst* inst) case kIROp_MakeCoopVector: { emitType(coopVecType, getName(inst)); - m_writer->emit(isCoopvecPoc ? ";\n" : " = { "); + m_writer->emit(" = { "); auto elemCount = as(coopVecType->getOperand(1)); IRIntegerValue elemCountValue = elemCount->getValue(); - if (isCoopvecPoc) + IRIntegerValue i = 0; + for (; i < elemCountValue - 1; ++i) { - for (IRIntegerValue i = 0; i < elemCountValue; ++i) - { - m_writer->emit(getName(inst)); - m_writer->emit(".WriteToIndex("); - m_writer->emit(i); - m_writer->emit(", "); - emitDereferenceOperand(inst->getOperand(i), getInfo(EmitOp::General)); - m_writer->emit(");\n"); - } - } - else - { - IRIntegerValue i = 0; - for (; i < elemCountValue - 1; ++i) - { - emitDereferenceOperand(inst->getOperand(i), getInfo(EmitOp::General)); - m_writer->emit(", "); - } emitDereferenceOperand(inst->getOperand(i), getInfo(EmitOp::General)); - m_writer->emit("};\n"); + m_writer->emit(", "); } + emitDereferenceOperand(inst->getOperand(i), getInfo(EmitOp::General)); + m_writer->emit("};\n"); return; } case kIROp_Call: @@ -3180,7 +3164,7 @@ void CLikeSourceEmitter::_emitInst(IRInst* inst) m_writer->emit(";\n"); m_writer->emit(getName(inst)); - m_writer->emit(isCoopvecPoc ? ".CopyFrom(" : " = ("); + m_writer->emit(" = ("); emitCallExpr((IRCall*)inst, getInfo(EmitOp::General)); m_writer->emit(");\n"); return; @@ -3189,7 +3173,7 @@ void CLikeSourceEmitter::_emitInst(IRInst* inst) m_writer->emit(";\n"); m_writer->emit(getName(inst)); - m_writer->emit(isCoopvecPoc ? ".CopyFrom(" : " = ("); + m_writer->emit(" = ("); emitDereferenceOperand(inst->getOperand(0), getInfo(EmitOp::General)); m_writer->emit(");\n"); return; @@ -3453,21 +3437,11 @@ void CLikeSourceEmitter::_emitStoreImpl(IRStore* store) auto dstPtr = store->getPtr(); if (isPointerOfType(dstPtr->getDataType(), kIROp_CoopVectorType)) { - if (isCoopvecPoc) - { - emitDereferenceOperand(dstPtr, getInfo(EmitOp::General)); - m_writer->emit(".CopyFrom("); - emitDereferenceOperand(srcVal, getInfo(EmitOp::General)); - m_writer->emit(");\n"); - } - else - { - auto prec = getInfo(EmitOp::Assign); - emitDereferenceOperand(dstPtr, leftSide(getInfo(EmitOp::General), prec)); - m_writer->emit(" = "); - emitOperand(srcVal, rightSide(prec, getInfo(EmitOp::General))); - m_writer->emit(";\n"); - } + auto prec = getInfo(EmitOp::Assign); + emitDereferenceOperand(dstPtr, leftSide(getInfo(EmitOp::General), prec)); + m_writer->emit(" = "); + emitOperand(srcVal, rightSide(prec, getInfo(EmitOp::General))); + m_writer->emit(";\n"); } else { @@ -4760,7 +4734,7 @@ void CLikeSourceEmitter::emitVar(IRVar* varDecl) { m_writer->emit(";\n"); m_writer->emit(getName(varDecl)); - m_writer->emit(isCoopvecPoc ? ".CopyFrom(" : " = ("); + m_writer->emit(" = ("); emitDereferenceOperand(store->getVal()->getOperand(0), getInfo(EmitOp::General)); m_writer->emit(")"); } @@ -4768,7 +4742,7 @@ void CLikeSourceEmitter::emitVar(IRVar* varDecl) { m_writer->emit(";\n"); m_writer->emit(getName(varDecl)); - m_writer->emit(isCoopvecPoc ? ".CopyFrom(" : " = ("); + m_writer->emit(" = ("); emitCallExpr((IRCall*)store->getVal(), getInfo(EmitOp::General)); m_writer->emit(")"); } @@ -4781,14 +4755,12 @@ void CLikeSourceEmitter::emitVar(IRVar* varDecl) { m_writer->emit(";\n"); m_writer->emit(getName(varDecl)); - m_writer->emit(isCoopvecPoc ? ".WriteToIndex(" : "["); + m_writer->emit("["); m_writer->emit(i); - m_writer->emit(isCoopvecPoc ? ", " : "] = "); + m_writer->emit("] = "); emitDereferenceOperand( store->getVal()->getOperand(i), getInfo(EmitOp::General)); - if (isCoopvecPoc) - m_writer->emit(")"); } } else diff --git a/source/slang/slang-emit-c-like.h b/source/slang/slang-emit-c-like.h index caf1a913b52..d9cff204f15 100644 --- a/source/slang/slang-emit-c-like.h +++ b/source/slang/slang-emit-c-like.h @@ -766,9 +766,6 @@ class CLikeSourceEmitter : public SourceEmitterBase // Rename entry point if target doesn't allow the name (e.g., 'main') virtual String maybeMakeEntryPointNameValid(String name, DiagnosticSink* sink); - // Indicates if we are emiting for DXC cooperative vector POC. - bool isCoopvecPoc = false; - // Indicates if we are emiting for Optix cooperative vector. bool isOptixCoopVec = false; diff --git a/source/slang/slang-emit-hlsl.cpp b/source/slang/slang-emit-hlsl.cpp index a5d634ebfbe..e424431e5b6 100644 --- a/source/slang/slang-emit-hlsl.cpp +++ b/source/slang/slang-emit-hlsl.cpp @@ -1176,7 +1176,7 @@ void HLSLSourceEmitter::emitVectorTypeNameImpl(IRType* elementType, IRIntegerVal // although we should not expect to run into types that don't // have a sugared form. // - m_writer->emit(isCoopvecPoc ? "CoopVector<" : "vector<"); + m_writer->emit("vector<"); emitType(elementType); m_writer->emit(","); m_writer->emit(elementCount); @@ -1469,7 +1469,7 @@ void HLSLSourceEmitter::emitSimpleTypeImpl(IRType* type) case kIROp_CoopVectorType: { auto coopVecType = (IRCoopVectorType*)type; - m_writer->emit(isCoopvecPoc ? "CoopVector<" : "vector<"); + m_writer->emit("vector<"); emitType(coopVecType->getElementType()); m_writer->emit(","); m_writer->emit(getIntVal(coopVecType->getElementCount())); diff --git a/tests/cooperative-vector/exp2.slang b/tests/cooperative-vector/exp2.slang index 41b1c3cdf38..9d72d87e318 100644 --- a/tests/cooperative-vector/exp2.slang +++ b/tests/cooperative-vector/exp2.slang @@ -1,5 +1,5 @@ //TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type -emit-spirv-directly -//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc +//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. //TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type // CHECK: type: float diff --git a/tests/cooperative-vector/log2.slang b/tests/cooperative-vector/log2.slang index 85fb889b1d4..49e8c5f2315 100644 --- a/tests/cooperative-vector/log2.slang +++ b/tests/cooperative-vector/log2.slang @@ -1,5 +1,5 @@ //TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type -emit-spirv-directly -//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc +//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. //TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type // CHECK: type: float