Uh oh!
There was an error while loading. Please reload this page.
[mono][amd64] Pass and return SIMD values in SIMD registers. - #93182
[mono][amd64] Pass and return SIMD values in SIMD registers.#93182vargaz wants to merge 6 commits into
Conversation
ee2220b to
7098675Comparevargaz
commented
Oct 11, 2023
/azp run runtime-extra-platforms |
|
Azure Pipelines successfully started running 1 pipeline(s). |
vargaz
commented
Oct 11, 2023
Can't reproduce the x64 failures. |
05d0b47 to
0672fb3Comparevargaz
commented
Oct 12, 2023
/azp run runtime |
|
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Is it intentional this doesn't match the native ABI for the platform?
There are particular rules for when and how certain SIMD types are passed depending on the ABI of the underlying platform (Windows x64, Unix SysV, etc).
There was a problem hiding this comment.
This is just an experiment right now, it has many problems, including this one.
vargaz
commented
Oct 18, 2023
/azp run runtime |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Remaining issues:
|
@vargaz What happens if gsharedvt is used, will we fallback and use none SIMD regs as we did before this PR or will just not when having SIMD types in parameters or return type? |
lateralusX
commented
Oct 19, 2023
I will look into windows support for this, working on it in a downstream repro to see how it behaves and will then upstream. Don't think that should block us from progressing on this PR. |
vargaz
commented
Oct 30, 2023
Another significant problem is that the generic instances used by generic sharing like Vector<T_INT> are not marked as simd types, so for |
lateralusX
commented
Oct 30, 2023
I guess it will be possible for caller to detect this scenario and choose calling convention accordingly? |
XMOVE can be optimized away which creates problems if the argument is on the stack, since mono_spill_global_vars () doesn't process call arguments, it only processes the move instructions before it. If a normal argument is on the stack, it means its volatile/indirect, so its move is not optimized away, but for simd args, they can become indirect when the xcall opcode is decomposed which can happen after the xmove was optimized away, so we end up with code like: ``` ldaddr R19 <- R20 vcall2 voidcall [..] [s:xmm0 <- R20] ```
vargaz
commented
Nov 6, 2023
So it looks like gshared support for the simd types cannot really be enabled right now, because gsharing for primitive types works by erasing the difference between primitive types and enums, so a Vector128<T_INT> can be instantiated by both an int an enums whose base type is int, but the simd types don't allow enum element types. will no longer throw an exception. |
vargaz
commented
Dec 3, 2023
Closing for now. |
No description provided.