-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
[Arm64] Support for Vector Intrinsics and/or SIMD requires 128bit argument registers to be preserved #9079
Comments
Are you planning to change the ABI on ARM64? We try to stick with the default platform calling convention. |
C++ ARM64 ABI is not being followed by CoreCLR in this case. We are only preserving the lower 64 bits of the 128-bit floating point argument registers. This is based on an "optimization" noted above that since CoreCLR only uses double in operands there is no reason to preserve the upper 64 bits. I can look at the ABI again, but I do not see anything prohibiting passing 128-bit arguments in floating point registers. I haven't actually found a test that hits this issue. When I do I will have motivation to change the code to conform to the ARM64 ABI. |
The 128-bit arguments passed in floating point registers are HVAs. CoreCLR does not support HVAs today - there is no way to say "this type is HVA". |
I am not a compiler guy, so you'll have to explain the HVA acronym. I was suspecting SIMD/Intrinsics would add this behavior. Vector128.cs adds
The Intel intrinsics make it look like they are being passed as arguments to the intrinsic. Intel does support passing structs in registers Also Intel is preserving the whole YMM 128-bit register. Presumably for the same reason. |
OK. Found the acronym. https://blogs.msdn.microsoft.com/vcblog/2013/07/11/introducing-vector-calling-convention/ |
The hardware intrinsics are inlined most of the time. In the rare cases where the hardware intrinsics are called as method (e.g. if you call them via reflection), the arguments are passed to them as regular arguments (not HVAs) today. |
Sound like this should be closed until HVAs are on the roadmap |
Related, but I have a proposal to support the |
Reopening because |
Extend HFA support to support vectors as well as floating point types. Also, fix coreclr to preserve 128-bit argument registers. Fix #14371 Fix #16022
Extend HFA support to support vectors as well as floating point types. Also, fix coreclr to preserve 128-bit argument registers. Fix #14371 Fix #16022
Extend HFA support to support vectors as well as floating point types. Also, fix coreclr to preserve 128-bit argument registers. Fix dotnet#14371 Fix dotnet#16022
Extend HFA support to support vectors as well as floating point types. Also, fix coreclr to preserve 128-bit argument registers. Fix dotnet#14371 Fix dotnet#16022
* Preserve Vector Arg registers on Arm64 Fix #14371
@dotnet/jit-contrib @dotnet/arm64-contrib
The following logic and assumptions will no longer be true when SIMD intrinsic support is added.
I plan to change this to save ful 128-bits all the time. If there are any objections, let me know.
This will also affect
SAVE_FLOAT_ARGUMENT_REGISTERS
andRESTORE_FLOAT_ARGUMENT_REGISTERS
macros and related assembly frame layoutscategory:correctness
theme:vector-codegen
skill-level:expert
cost:small
The text was updated successfully, but these errors were encountered: