1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408
|
// RUN: mlir-opt --split-input-file --verify-diagnostics --mlir-disable-threading \
// RUN: --test-spirv-target-env %s | FileCheck %s
// Note: The following tests check that a spirv.target_env can properly control
// the conversion target and filter unavailable ops during the conversion.
// We don't care about the op argument consistency too much; so certain enum
// values for enum attributes may not make much sense for the test op.
// spirv.AtomicCompareExchangeWeak is available from SPIR-V 1.0 to 1.3 under
// Kernel capability.
// spirv.AtomicCompareExchangeWeak has two memory semantics enum attribute,
// whose value, if containing AtomicCounterMemory bit, additionally requires
// AtomicStorage capability.
// spirv.BitReverse is available in all SPIR-V versions under Shader capability.
// spirv.GroupNonUniformBallot is available starting from SPIR-V 1.3 under
// GroupNonUniform capability.
// spirv.KHR.SubgroupBallot is available under in all SPIR-V versions under
// SubgroupBallotKHR capability and SPV_KHR_shader_ballot extension.
// Integer Dot Product ops (spirv.*Dot*) require the
// SPV_KHR_integer_dot_product extension and a number of related capabilities.
// The GeometryPointSize capability implies the Geometry capability, which
// implies the Shader capability.
// PhysicalStorageBuffer64 addressing model is available via extension
// SPV_EXT_physical_storage_buffer or SPV_KHR_physical_storage_buffer;
// both extensions are incorporated into SPIR-V 1.5.
// Vulkan memory model is available via extension SPV_KHR_vulkan_memory_model,
// which extensions are incorporated into SPIR-V 1.5.
// expected-error @+1 {{missing 'spirv.target_env' attribute}}
func.func @main() {
return
}
// -----
//===----------------------------------------------------------------------===//
// MaxVersion
//===----------------------------------------------------------------------===//
// CHECK-LABEL: @cmp_exchange_weak_suitable_version_capabilities
func.func @cmp_exchange_weak_suitable_version_capabilities(%ptr: !spirv.ptr<i32, Workgroup>, %value: i32, %comparator: i32) -> i32 attributes {
spirv.target_env = #spirv.target_env<#spirv.vce<v1.1, [Kernel, AtomicStorage], []>, #spirv.resource_limits<>>
} {
// CHECK: spirv.AtomicCompareExchangeWeak "Workgroup" "AcquireRelease|AtomicCounterMemory" "Acquire"
%0 = "test.convert_to_atomic_compare_exchange_weak_op"(%ptr, %value, %comparator): (!spirv.ptr<i32, Workgroup>, i32, i32) -> (i32)
return %0: i32
}
// CHECK-LABEL: @cmp_exchange_weak_unsupported_version
func.func @cmp_exchange_weak_unsupported_version(%ptr: !spirv.ptr<i32, Workgroup>, %value: i32, %comparator: i32) -> i32 attributes {
spirv.target_env = #spirv.target_env<#spirv.vce<v1.4, [Kernel, AtomicStorage], []>, #spirv.resource_limits<>>
} {
// CHECK: test.convert_to_atomic_compare_exchange_weak_op
%0 = "test.convert_to_atomic_compare_exchange_weak_op"(%ptr, %value, %comparator): (!spirv.ptr<i32, Workgroup>, i32, i32) -> (i32)
return %0: i32
}
//===----------------------------------------------------------------------===//
// MinVersion
//===----------------------------------------------------------------------===//
// CHECK-LABEL: @group_non_uniform_ballot_suitable_version
func.func @group_non_uniform_ballot_suitable_version(%predicate: i1) -> vector<4xi32> attributes {
spirv.target_env = #spirv.target_env<#spirv.vce<v1.4, [GroupNonUniformBallot], []>, #spirv.resource_limits<>>
} {
// CHECK: spirv.GroupNonUniformBallot <Workgroup>
%0 = "test.convert_to_group_non_uniform_ballot_op"(%predicate): (i1) -> (vector<4xi32>)
return %0: vector<4xi32>
}
// CHECK-LABEL: @group_non_uniform_ballot_unsupported_version
func.func @group_non_uniform_ballot_unsupported_version(%predicate: i1) -> vector<4xi32> attributes {
spirv.target_env = #spirv.target_env<#spirv.vce<v1.1, [GroupNonUniformBallot], []>, #spirv.resource_limits<>>
} {
// CHECK: test.convert_to_group_non_uniform_ballot_op
%0 = "test.convert_to_group_non_uniform_ballot_op"(%predicate): (i1) -> (vector<4xi32>)
return %0: vector<4xi32>
}
//===----------------------------------------------------------------------===//
// Capability
//===----------------------------------------------------------------------===//
// CHECK-LABEL: @cmp_exchange_weak_missing_capability_kernel
func.func @cmp_exchange_weak_missing_capability_kernel(%ptr: !spirv.ptr<i32, Workgroup>, %value: i32, %comparator: i32) -> i32 attributes {
spirv.target_env = #spirv.target_env<#spirv.vce<v1.3, [AtomicStorage], []>, #spirv.resource_limits<>>
} {
// CHECK: test.convert_to_atomic_compare_exchange_weak_op
%0 = "test.convert_to_atomic_compare_exchange_weak_op"(%ptr, %value, %comparator): (!spirv.ptr<i32, Workgroup>, i32, i32) -> (i32)
return %0: i32
}
// CHECK-LABEL: @cmp_exchange_weak_missing_capability_atomic_storage
func.func @cmp_exchange_weak_missing_capability_atomic_storage(%ptr: !spirv.ptr<i32, Workgroup>, %value: i32, %comparator: i32) -> i32 attributes {
spirv.target_env = #spirv.target_env<#spirv.vce<v1.3, [Kernel], []>, #spirv.resource_limits<>>
} {
// CHECK: test.convert_to_atomic_compare_exchange_weak_op
%0 = "test.convert_to_atomic_compare_exchange_weak_op"(%ptr, %value, %comparator): (!spirv.ptr<i32, Workgroup>, i32, i32) -> (i32)
return %0: i32
}
// CHECK-LABEL: @subgroup_ballot_missing_capability
func.func @subgroup_ballot_missing_capability(%predicate: i1) -> vector<4xi32> attributes {
spirv.target_env = #spirv.target_env<#spirv.vce<v1.4, [], [SPV_KHR_shader_ballot]>, #spirv.resource_limits<>>
} {
// CHECK: test.convert_to_subgroup_ballot_op
%0 = "test.convert_to_subgroup_ballot_op"(%predicate): (i1) -> (vector<4xi32>)
return %0: vector<4xi32>
}
// CHECK-LABEL: @bit_reverse_directly_implied_capability
func.func @bit_reverse_directly_implied_capability(%operand: i32) -> i32 attributes {
spirv.target_env = #spirv.target_env<#spirv.vce<v1.0, [Geometry], []>, #spirv.resource_limits<>>
} {
// CHECK: spirv.BitReverse
%0 = "test.convert_to_bit_reverse_op"(%operand): (i32) -> (i32)
return %0: i32
}
// CHECK-LABEL: @bit_reverse_recursively_implied_capability
func.func @bit_reverse_recursively_implied_capability(%operand: i32) -> i32 attributes {
spirv.target_env = #spirv.target_env<#spirv.vce<v1.0, [GeometryPointSize], []>, #spirv.resource_limits<>>
} {
// CHECK: spirv.BitReverse
%0 = "test.convert_to_bit_reverse_op"(%operand): (i32) -> (i32)
return %0: i32
}
// CHECK-LABEL: @sdot_scalar_i32_i32_capabilities
func.func @sdot_scalar_i32_i32_capabilities(%operand: i32) -> i32 attributes {
spirv.target_env = #spirv.target_env<#spirv.vce<v1.0,
[DotProduct, DotProductInput4x8BitPacked], [SPV_KHR_integer_dot_product]>, #spirv.resource_limits<>>
} {
// CHECK: spirv.SDot
%0 = "test.convert_to_sdot_op"(%operand, %operand) {format = #spirv.packed_vector_format<PackedVectorFormat4x8Bit>}: (i32, i32) -> (i32)
return %0: i32
}
// CHECK-LABEL: @sdot_scalar_i32_i32_missing_capability1
func.func @sdot_scalar_i32_i32_missing_capability1(%operand: i32) -> i32 attributes {
spirv.target_env = #spirv.target_env<#spirv.vce<v1.0,
[DotProduct], [SPV_KHR_integer_dot_product]>, #spirv.resource_limits<>>
} {
// CHECK: test.convert_to_sdot_op
%0 = "test.convert_to_sdot_op"(%operand, %operand) {format = #spirv.packed_vector_format<PackedVectorFormat4x8Bit>}: (i32, i32) -> (i32)
return %0: i32
}
// CHECK-LABEL: @sdot_scalar_i32_i32_missing_capability2
func.func @sdot_scalar_i32_i32_missing_capability2(%operand: i32) -> i32 attributes {
spirv.target_env = #spirv.target_env<#spirv.vce<v1.0,
[DotProductInput4x8BitPacked], [SPV_KHR_integer_dot_product]>, #spirv.resource_limits<>>
} {
// CHECK: test.convert_to_sdot_op
%0 = "test.convert_to_sdot_op"(%operand, %operand) {format = #spirv.packed_vector_format<PackedVectorFormat4x8Bit>}: (i32, i32) -> (i32)
return %0: i32
}
// CHECK-LABEL: @sudot_vector_4xi8_i32_capabilities
func.func @sudot_vector_4xi8_i32_capabilities(%operand: vector<4xi8>) -> i32 attributes {
spirv.target_env = #spirv.target_env<#spirv.vce<v1.0,
[DotProduct, DotProductInput4x8Bit], [SPV_KHR_integer_dot_product]>, #spirv.resource_limits<>>
} {
// CHECK: spirv.SUDot
%0 = "test.convert_to_sudot_op"(%operand, %operand): (vector<4xi8>, vector<4xi8>) -> (i32)
return %0: i32
}
// CHECK-LABEL: @sudot_vector_4xi8_i32_missing_capability1
func.func @sudot_vector_4xi8_i32_missing_capability1(%operand: vector<4xi8>) -> i32 attributes {
spirv.target_env = #spirv.target_env<#spirv.vce<v1.0,
[DotProduct], [SPV_KHR_integer_dot_product]>, #spirv.resource_limits<>>
} {
// CHECK: test.convert_to_sudot_op
%0 = "test.convert_to_sudot_op"(%operand, %operand): (vector<4xi8>, vector<4xi8>) -> (i32)
return %0: i32
}
// CHECK-LABEL: @sudot_vector_4xi8_i32_missing_capability2
func.func @sudot_vector_4xi8_i32_missing_capability2(%operand: vector<4xi8>) -> i32 attributes {
spirv.target_env = #spirv.target_env<#spirv.vce<v1.0,
[DotProductInput4x8Bit], [SPV_KHR_integer_dot_product]>, #spirv.resource_limits<>>
} {
// CHECK: test.convert_to_sudot_op
%0 = "test.convert_to_sudot_op"(%operand, %operand): (vector<4xi8>, vector<4xi8>) -> (i32)
return %0: i32
}
// CHECK-LABEL: @udot_vector_4xi16_i64_capabilities
func.func @udot_vector_4xi16_i64_capabilities(%operand: vector<4xi16>) -> i64 attributes {
spirv.target_env = #spirv.target_env<#spirv.vce<v1.0,
[DotProduct, DotProductInputAll, Int16, Int64], [SPV_KHR_integer_dot_product]>, #spirv.resource_limits<>>
} {
// CHECK: spirv.UDot
%0 = "test.convert_to_udot_op"(%operand, %operand): (vector<4xi16>, vector<4xi16>) -> (i64)
return %0: i64
}
// CHECK-LABEL: @udot_vector_4xi16_i64_missing_capability1
func.func @udot_vector_4xi16_i64_missing_capability1(%operand: vector<4xi16>) -> i64 attributes {
spirv.target_env = #spirv.target_env<#spirv.vce<v1.0,
[DotProduct, Int16, Int64], [SPV_KHR_integer_dot_product]>, #spirv.resource_limits<>>
} {
// CHECK: test.convert_to_udot_op
%0 = "test.convert_to_udot_op"(%operand, %operand): (vector<4xi16>, vector<4xi16>) -> (i64)
return %0: i64
}
// CHECK-LABEL: @udot_vector_4xi16_i64_missing_capability2
func.func @udot_vector_4xi16_i64_missing_capability2(%operand: vector<4xi16>) -> i64 attributes {
spirv.target_env = #spirv.target_env<#spirv.vce<v1.0,
[DotProductInputAll, Int16, Int64], [SPV_KHR_integer_dot_product]>, #spirv.resource_limits<>>
} {
// CHECK: test.convert_to_udot_op
%0 = "test.convert_to_udot_op"(%operand, %operand): (vector<4xi16>, vector<4xi16>) -> (i64)
return %0 : i64
}
// CHECK-LABEL: @sdot_acc_sat_scalar_i32_i32_capabilities
func.func @sdot_acc_sat_scalar_i32_i32_capabilities(%operand: i32) -> i32 attributes {
spirv.target_env = #spirv.target_env<#spirv.vce<v1.0,
[DotProduct, DotProductInput4x8BitPacked], [SPV_KHR_integer_dot_product]>, #spirv.resource_limits<>>
} {
// CHECK: spirv.SDotAccSat
%0 = "test.convert_to_sdot_acc_sat_op"(%operand, %operand, %operand)
{format = #spirv.packed_vector_format<PackedVectorFormat4x8Bit>}: (i32, i32, i32) -> (i32)
return %0: i32
}
// CHECK-LABEL: @sudot_acc_sat_vector_4xi8_i32_capabilities
func.func @sudot_acc_sat_vector_4xi8_i32_capabilities(%operand: vector<4xi8>, %acc: i32) -> i32 attributes {
spirv.target_env = #spirv.target_env<#spirv.vce<v1.0,
[DotProduct, DotProductInput4x8Bit], [SPV_KHR_integer_dot_product]>, #spirv.resource_limits<>>
} {
// CHECK: spirv.SUDotAccSat
%0 = "test.convert_to_sudot_acc_sat_op"(%operand, %operand, %acc): (vector<4xi8>, vector<4xi8>, i32) -> (i32)
return %0: i32
}
// CHECK-LABEL: @udot_acc_sat_vector_4xi8_i32_missing_capability1
func.func @udot_acc_sat_vector_4xi8_i32_missing_capability1(%operand: vector<4xi8>, %acc: i32) -> i32 attributes {
spirv.target_env = #spirv.target_env<#spirv.vce<v1.0,
[DotProduct, DotProductInputAll, Int16, Int64], [SPV_KHR_integer_dot_product]>, #spirv.resource_limits<>>
} {
// CHECK: test.convert_to_udot_acc_sat_op
%0 = "test.convert_to_udot_acc_sat_op"(%operand, %operand, %acc): (vector<4xi8>, vector<4xi8>, i32) -> (i32)
return %0: i32
}
// CHECK-LABEL: @udot_acc_sat_vector_4xi8_i32_missing_capability2
func.func @udot_acc_sat_vector_4xi8_i32_missing_capability2(%operand: vector<4xi8>, %acc: i32) -> i32 attributes {
spirv.target_env = #spirv.target_env<#spirv.vce<v1.0,
[DotProductInputAll, DotProductInput4x8Bit, Int16, Int64], [SPV_KHR_integer_dot_product]>, #spirv.resource_limits<>>
} {
// CHECK: test.convert_to_udot_acc_sat_op
%0 = "test.convert_to_udot_acc_sat_op"(%operand, %operand, %acc): (vector<4xi8>, vector<4xi8>, i32) -> (i32)
return %0: i32
}
// CHECK-LABEL: @udot_acc_sat_vector_4xi16_i64_capabilities
func.func @udot_acc_sat_vector_4xi16_i64_capabilities(%operand: vector<4xi16>, %acc: i64) -> i64 attributes {
spirv.target_env = #spirv.target_env<#spirv.vce<v1.0,
[DotProduct, DotProductInputAll, Int16, Int64], [SPV_KHR_integer_dot_product]>, #spirv.resource_limits<>>
} {
// CHECK: spirv.UDotAccSat
%0 = "test.convert_to_udot_acc_sat_op"(%operand, %operand, %acc): (vector<4xi16>, vector<4xi16>, i64) -> (i64)
return %0: i64
}
// CHECK-LABEL: @udot_acc_sat_vector_4xi16_i64_missing_capability1
func.func @udot_acc_sat_vector_4xi16_i64_missing_capability1(%operand: vector<4xi16>, %acc: i64) -> i64 attributes {
spirv.target_env = #spirv.target_env<#spirv.vce<v1.0,
[DotProductInputAll, Int16, Int64], [SPV_KHR_integer_dot_product]>, #spirv.resource_limits<>>
} {
// CHECK: test.convert_to_udot_acc_sat_op
%0 = "test.convert_to_udot_acc_sat_op"(%operand, %operand, %acc): (vector<4xi16>, vector<4xi16>, i64) -> (i64)
return %0: i64
}
// CHECK-LABEL: @udot_acc_sat_vector_4xi16_i64_missing_capability2
func.func @udot_acc_sat_vector_4xi16_i64_missing_capability2(%operand: vector<4xi16>, %acc: i64) -> i64 attributes {
spirv.target_env = #spirv.target_env<#spirv.vce<v1.0,
[DotProduct, Int16, Int64], [SPV_KHR_integer_dot_product]>, #spirv.resource_limits<>>
} {
// CHECK: test.convert_to_udot_acc_sat_op
%0 = "test.convert_to_udot_acc_sat_op"(%operand, %operand, %acc): (vector<4xi16>, vector<4xi16>, i64) -> (i64)
return %0: i64
}
//===----------------------------------------------------------------------===//
// Extension
//===----------------------------------------------------------------------===//
// CHECK-LABEL: @subgroup_ballot_suitable_extension
func.func @subgroup_ballot_suitable_extension(%predicate: i1) -> vector<4xi32> attributes {
spirv.target_env = #spirv.target_env<#spirv.vce<v1.4, [SubgroupBallotKHR], [SPV_KHR_shader_ballot]>, #spirv.resource_limits<>>
} {
// CHECK: spirv.KHR.SubgroupBallot
%0 = "test.convert_to_subgroup_ballot_op"(%predicate): (i1) -> (vector<4xi32>)
return %0: vector<4xi32>
}
// CHECK-LABEL: @subgroup_ballot_missing_extension
func.func @subgroup_ballot_missing_extension(%predicate: i1) -> vector<4xi32> attributes {
spirv.target_env = #spirv.target_env<#spirv.vce<v1.4, [SubgroupBallotKHR], []>, #spirv.resource_limits<>>
} {
// CHECK: test.convert_to_subgroup_ballot_op
%0 = "test.convert_to_subgroup_ballot_op"(%predicate): (i1) -> (vector<4xi32>)
return %0: vector<4xi32>
}
// CHECK-LABEL: @module_suitable_extension1
func.func @module_suitable_extension1() attributes {
spirv.target_env = #spirv.target_env<#spirv.vce<v1.0, [VulkanMemoryModel, PhysicalStorageBufferAddresses], [SPV_KHR_vulkan_memory_model, SPV_EXT_physical_storage_buffer]>, #spirv.resource_limits<>>
} {
// CHECK: spirv.module PhysicalStorageBuffer64 Vulkan
"test.convert_to_module_op"() : () ->()
return
}
// CHECK-LABEL: @module_suitable_extension2
func.func @module_suitable_extension2() attributes {
spirv.target_env = #spirv.target_env<#spirv.vce<v1.0, [VulkanMemoryModel, PhysicalStorageBufferAddresses], [SPV_KHR_vulkan_memory_model, SPV_KHR_physical_storage_buffer]>, #spirv.resource_limits<>>
} {
// CHECK: spirv.module PhysicalStorageBuffer64 Vulkan
"test.convert_to_module_op"() : () -> ()
return
}
// CHECK-LABEL: @module_missing_extension_mm
func.func @module_missing_extension_mm() attributes {
spirv.target_env = #spirv.target_env<#spirv.vce<v1.0, [VulkanMemoryModel, PhysicalStorageBufferAddresses], [SPV_KHR_physical_storage_buffer]>, #spirv.resource_limits<>>
} {
// CHECK: test.convert_to_module_op
"test.convert_to_module_op"() : () -> ()
return
}
// CHECK-LABEL: @module_missing_extension_am
func.func @module_missing_extension_am() attributes {
spirv.target_env = #spirv.target_env<#spirv.vce<v1.0, [VulkanMemoryModel, PhysicalStorageBufferAddresses], [SPV_KHR_vulkan_memory_model]>, #spirv.resource_limits<>>
} {
// CHECK: test.convert_to_module_op
"test.convert_to_module_op"() : () -> ()
return
}
// CHECK-LABEL: @module_implied_extension
func.func @module_implied_extension() attributes {
// Version 1.5 implies SPV_KHR_vulkan_memory_model and SPV_KHR_physical_storage_buffer.
spirv.target_env = #spirv.target_env<#spirv.vce<v1.5, [VulkanMemoryModel, PhysicalStorageBufferAddresses], []>, #spirv.resource_limits<>>
} {
// CHECK: spirv.module PhysicalStorageBuffer64 Vulkan
"test.convert_to_module_op"() : () -> ()
return
}
// CHECK-LABEL: @udot_vector_4xi16_i64_implied_extension
func.func @udot_vector_4xi16_i64_implied_extension(%operand: vector<4xi16>) -> i64 attributes {
// Version 1.6 implies SPV_KHR_integer_to_product.
spirv.target_env = #spirv.target_env<#spirv.vce<v1.6,
[DotProduct, DotProductInputAll, Int16, Int64], []>, #spirv.resource_limits<>>
} {
// CHECK: spirv.UDot
%0 = "test.convert_to_udot_op"(%operand, %operand): (vector<4xi16>, vector<4xi16>) -> (i64)
return %0: i64
}
// CHECK-LABEL: @udot_vector_4xi16_i64_missing_extension
func.func @udot_vector_4xi16_i64_missing_extension(%operand: vector<4xi16>) -> i64 attributes {
// Version 1.5 does not imply SPV_KHR_integer_to_product.
spirv.target_env = #spirv.target_env<#spirv.vce<v1.5,
[DotProduct, DotProductInputAll, Int16, Int64], []>, #spirv.resource_limits<>>
} {
// CHECK: test.convert_to_udot_op
%0 = "test.convert_to_udot_op"(%operand, %operand): (vector<4xi16>, vector<4xi16>) -> (i64)
return %0: i64
}
// CHECK-LABEL: @sdot_acc_sat_vector_4xi16_i64_implied_extension
func.func @sdot_acc_sat_vector_4xi16_i64_implied_extension(%operand: vector<4xi16>, %acc: i64) -> i64 attributes {
// Version 1.6 implies SPV_KHR_integer_to_product.
spirv.target_env = #spirv.target_env<#spirv.vce<v1.6,
[DotProduct, DotProductInputAll, Int16, Int64], []>, #spirv.resource_limits<>>
} {
// CHECK: spirv.SDotAccSat
%0 = "test.convert_to_sdot_acc_sat_op"(%operand, %operand, %acc): (vector<4xi16>, vector<4xi16>, i64) -> (i64)
return %0: i64
}
// CHECK-LABEL: @sdot_acc_sat_vector_4xi16_i64_missing_extension
func.func @sdot_acc_sat_vector_4xi16_i64_missing_extension(%operand: vector<4xi16>, %acc: i64) -> i64 attributes {
// Version 1.5 does not imply SPV_KHR_integer_to_product.
spirv.target_env = #spirv.target_env<#spirv.vce<v1.5,
[DotProduct, DotProductInputAll, Int16, Int64], []>, #spirv.resource_limits<>>
} {
// CHECK: test.convert_to_sdot_acc_sat_op
%0 = "test.convert_to_sdot_acc_sat_op"(%operand, %operand, %acc): (vector<4xi16>, vector<4xi16>, i64) -> (i64)
return %0: i64
}
|