Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing support for SPV_INTEL_inline_assembly extension #5923

Open
jdnk opened this issue Dec 19, 2024 · 0 comments
Open

Missing support for SPV_INTEL_inline_assembly extension #5923

jdnk opened this issue Dec 19, 2024 · 0 comments

Comments

@jdnk
Copy link

jdnk commented Dec 19, 2024

OpAsmINTEL and OpAsmTargetINTEL instructions from SPV_INTEL_inline_assembly should be allowed in the same section as type declarations. This is currently not allowed in SPIRV-Tools which triggers an error during validation.

Reproducible example (using LLVM 19):

// foo.c
void foo (const float * restrict a, const float * restrict b, float * restrict c) {
    __asm__ ("nop");
}
> clang -S -emit-llvm foo.c -o foo.ll
> llc -O3 -mtriple=spirv64-unknown-unknown --spirv-ext=+SPV_INTEL_inline_assembly foo.ll -o foo.spt
> spirv-as foo.spt -o foo.spv
> spirv-val foo.spv
error: line 24: AsmTargetINTEL must appear in a block
  %12 = OpAsmTargetINTEL "spirv64-unknown-unknown"

Note that the spirv-as line works only with fixed headers.

When trying to link the module containing inline assembly, spirv-link complains with a similar error:

> spirv-link foo.spv foo.spv -o foo_linked.spv
error: 0: Unhandled inst type (opcode: 5609) found outside function definition.
error: 0: Failed to build module 1 out of 1.

@mmerecki FYI

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

No branches or pull requests

1 participant