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

Arm NEON vector types #534

Open
dkolsen-pgi opened this issue Apr 5, 2024 · 7 comments
Open

Arm NEON vector types #534

dkolsen-pgi opened this issue Apr 5, 2024 · 7 comments
Labels
good first issue Good for newcomers

Comments

@dkolsen-pgi
Copy link
Collaborator

Implement Arm NEON vector types in ClangIR.

Issue #284 implemented GNU vector types. Other issues are being created for other kinds of vector types. See https://clang.llvm.org/docs/LanguageExtensions.html#vectors-and-extended-vectors

@bcardosolopes
Copy link
Member

I stumble into some neon builtins we need to build, and it's possible I might need to work on this soon. @dkolsen-pgi let me know if you have any plans to work on this - just wanna make sure we're don't duplicate work.

@bcardosolopes bcardosolopes self-assigned this May 13, 2024
@dkolsen-pgi
Copy link
Collaborator Author

I don't have any immediate plans to work on this issue. It was a possible near-term issue, but those plans can easily change. In general, I will assign an issue to myself if I am planning to do any significant work.

@bcardosolopes
Copy link
Member

I actually don't yet need anything other than plain fixed vectors for the things I need to support right now, so making this available again in case anyone needs it first then we do.

@bcardosolopes bcardosolopes removed their assignment May 23, 2024
@bcardosolopes bcardosolopes added the good first issue Good for newcomers label May 23, 2024
@bcardosolopes
Copy link
Member

Actually, seems like the specific bits are already supported, the extensions probably gets unified, see https://godbolt.org/z/coGr5xh9K

@dkolsen-pgi am I missing something or should we just close this?

@bcardosolopes
Copy link
Member

To be more specific: different vector types might restrict or change behavior of operations, but what I need to double check is whether this is already enforced by Sema (even though we might want to have extra verification at the CIR level).

@dkolsen-pgi
Copy link
Collaborator Author

I don't enough of the details about Arm NEON vector types to know if everything you can do with them is already covered by the existing CodeGen and Lowering support for GNU vector types. But I wouldn't be surprised if that was the case. There are different semantic rules for GNU vector types and Arm NEON vector types, but that's the responsibility of Clang's Sema to enforce that. But once code makes it past semantic checking, it's quite possible that the behavior is the same.

I wouldn't close this issue just yet. But put it on the back burner for now. If we implement Arm SVE vectors without finding any necessary NEON-specific changes, then we should close this one.

@bcardosolopes
Copy link
Member

Sounds good.

Note for later: There are probably better links, but this doc on page 131 has a table that might be helpful. Even though Sema does most of the job, we could run into issues for transformations on top of CIR. Since fixed vectors are shared right now, it's possible vector transformations could generate code that isn't really supported by the type - we probably need an example to confirm. One possible solution is to add an attribute kind to vector type to distinguish between neon, etc, so that verifiers would catch subtle issues like that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants