Skip to content

Conversation

@pvelesko
Copy link

This PR adds validation support for three Intel SPIR-V extensions:

OpConstantFunctionPointerINTEL: Added validation logic and test coverage
ArbitraryPrecisionIntegersINTEL: Added type validation support and tests
OpAliasScopeDeclINTEL/OpAliasScopeListDeclINTEL: Added ID validation support and tests

Fixes #6034

@CLAassistant
Copy link

CLAassistant commented Jul 27, 2025

CLA assistant check
All committers have signed the CLA.

@alan-baker
Copy link
Contributor

Please sign the CLA. Could you also link to the extension text for constant function pointers and alias scopes? I couldn't see them on the SPIRV-Registry.

@pvelesko
Copy link
Author

@alan-baker I can't find info on these extensions but I encountered them in the wild.

Perhaps @bashbaug can shed some light?

@bashbaug
Copy link
Contributor

SPV_INTEL_function_pointers

SPV_INTEL_memory_access_aliasing

These aren't published on the registry since we still consider them "preview extensions", though if you're encountering them in the wild then we really ought to get them finalized and published on the registry.

}

// Validate that the function operand refers to an OpFunction
if (function_inst->opcode() != spv::Op::OpFunction) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The spec seems unclear to me here (since it neglects to properly describe this operand), but I thought it must be a function pointer. @bashbaug thoughts?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bashbaug ping

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the ping, I missed this previously.

I think the code is correct and the function operand should be an OpFunction. This matches what I see generated by SPIR-V LLVM Translator lit tests, e.g. https://github.com/KhronosGroup/SPIRV-LLVM-Translator/blob/main/test/extensions/INTEL/SPV_INTEL_function_pointers/function-pointer.ll :

          %3 = OpTypeFunction %uint %uint
...
%_ptr_Function_3 = OpTypePointer Function %3
...
      %foo_0 = OpConstantFunctionPointerINTEL %_ptr_Function_3 %foo
        %foo = OpFunction %uint DontInline %3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

spirv-val doesn't know about SPV_INTEL_arbitrary_precision_integers

4 participants