-
Notifications
You must be signed in to change notification settings - Fork 277
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
Rename ARMv8 to AArch64 #139
Comments
<pedantry> All the listed names mean different things.
</pedantry> |
Currently, we have the arm intrinsics in the |
Why not just 2 modules, scalar and vector/simd/neon? |
I should rephrase the question. First, the modules are private. Second, we use them only for conditional compilation, that is, for deciding which intrinsics to provide depending on the target triple. |
Ok understood. It's probably not possible to use the target triple for that as they don't have to follow convention. Custom targets can have any name and even some of the builtin targets don't follow a convention. e.g., all the |
AFAIK LLVM cannot emit code that contains This means that run-time feature detection cannot be used to generate an, e.g., I think that what I will do is move the @japaric this doesn't fit good with the reality of the ARMv8 specification but fits better with what users can actually do with Rust right now. @parched thoughts? |
@gnzlbg Yes looking at the current Some other general notes having had a look now,
|
I agree but by design the functions in this crate "guarantee" that a specific instruction is generated, and should only be available on the architectures in which they are available. A higher-level crate built on top of this one (or maybe not for those functions) could do this.
Yes, the goal for this crate is to expose all vendor intrinsics including non-SIMD ones that we want to use in stable at some point. If you take a look at the x86 modules you will find the
I followed the name of the C headers / ARM reference. If I made a mistake on some intrinsic please fill an issue and I'll fix it. The names are not set in stone, but we should have a good idea about them before writing an RFC to stabilize the intrinsics.
The idea is to use For example, consider what happens when calling Since LLVM and downwards regard this as undefined behavior, we agreed to make the API of all intrinsic |
Ok sure, FWIW the Arm instrinsics do for some and not for others [ACLE]
Most of the Arm instrinics start with double underscore but that's only because there's no namespacing in C. I think you can drop the leading double underscore for Rust. |
So this is the refactor that I plan to do:
[*] ideally we should switch v6 on only when |
@gnzlbg I'm still not sure doing conditional compilation like that will work. E.g., where will the CLZ intrinsic go? It's available in the Arm instruction set in Armv5 but in the Thumb instruction set from Armv6T2. How about NEON instrinsics available in Armv8.2 but not Armv8? IMO each instrinsic should be handled on a case by case basis and just group them by category.
LLVM does have target features for every architecture/version combination but currently rust doesn't expose any of them (including |
Currently, the granularity at which I can do arch and feature detection on rustc is very limited, but supposing that we would improve that, we could do something like this:
Note that at the end of the day this is still using conditional compilation based on The hard part of the work is identifying all these groups, and writing the lists of intrinsics that belong to each. We can already start adding intrinsics here and organizing the library in a way that makes sense. Adding the necessary feature detection to rustc can be done in parallel it is pretty trivial if the features are supported by LLVM. |
I don't like the
This should scale to |
IMO we should just do the same as clang and always provide the |
@Amanieu I was just going to ping you here. The whole point of the intrinsics in Exposing portable functionality is useful though, and the job of other |
LLVM calls ARMv8 AArch64. Some ARM documents call it A64 or v8. For consistency with LLVM we should probably rename it to
aarch64
. Thoughts? @parched @japaricThe text was updated successfully, but these errors were encountered: