[llvm] [SPIR-V] Complete SPV_INTEL_16bit_atomics extension support (PR #184312)
Viktoria Maximova via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 4 05:46:53 PST 2026
================
@@ -1622,10 +1622,44 @@ void addInstrRequirements(const MachineInstr &MI,
assert(InstrPtr->getOperand(1).isReg() && "Unexpected operand in atomic");
Register TypeReg = InstrPtr->getOperand(1).getReg();
SPIRVTypeInst TypeDef = MRI.getVRegDef(TypeReg);
+ unsigned Op = MI.getOpcode();
+
if (TypeDef->getOpcode() == SPIRV::OpTypeInt) {
unsigned BitWidth = TypeDef->getOperand(1).getImm();
if (BitWidth == 64)
Reqs.addCapability(SPIRV::Capability::Int64Atomics);
+ else if (BitWidth == 16) {
+ if (!ST.canUseExtension(SPIRV::Extension::SPV_INTEL_16bit_atomics))
+ report_fatal_error(
+ "16-bit integer atomic operations require the following SPIR-V "
+ "extension: SPV_INTEL_16bit_atomics",
+ false);
----------------
vmaksimo wrote:
I believe the situation without extension is the same for [Vulkan environment](https://docs.vulkan.org/guide/latest/atomics.html#_baseline_support) as well.
> With Vulkan 1.0 and no extensions, an application is allowed to use 32-bit int type for atomics.
Are we aware of other envs which can have the different approach here?
https://github.com/llvm/llvm-project/pull/184312
More information about the llvm-commits
mailing list