[mono] Add basic Vector128 support for arm64. #47028
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change:
Unpacks SIMD parameters passed via multiple GPRs (
LLVMArgVtypeAsIArgs) intolocal LLVM SSA vector-typed values on function entry. The calling convention we
use on arm and arm64 has "large" value types passed in multiple GPRs when
possible, and the way this is currently encoded in the LLVM IR we emit is by
using parameters with the LLVM type
[Size x {i32 or i64}], where theresulting size of this type, in bytes, is at least as large as the size of the
value type encoded within.
Packs SIMD return values into multiple GPRs (
LLVMArgVtypeAsScalar); the waythis is currently encoded in the LLVM IR we emit for arm64 (but not arm) is by
using a "wide" LLVM integer type (e.g.
i128).Makes
OP_LDADDRaware of our special-case handling of SIMD value types:SIMD value types passed via an indirection (
LLVMArgVtypeAddrorLLVMArgVtypeByRef) are loaded from memory to an LLVM SSA value in the initialbasic block, but
OP_LDADDRhad previously assumed that any value type passedvia an indirection had an associated LLVM SSA value containing an indirection
rather than the actual value.
Adds a debugging utility function (
mono_llvm_dump_type).Gives greppable names to some allocas.
Makes some formerly amd64-specific SIMD-related opcodes also work on arm64.
This code is all a bit messy (especially the parts surrounding parameter
passing); this change does not clean any of this up.