Skip to content

Possible optimization on Windows with AVX-512 vs AVX2 #91478

Answered by tannergooding
MadProbe asked this question in Ideas
Discussion options

You must be logged in to vote

The register allocator already takes this into account. We independently track callee save vs callee trash sets and within those order them by encoding cost. Thus xmm0-5 are done first and xmm16-xmm31 are taken after those are used up.

Register preferencing, ABI conventions for passing/returning values, and other factors can also influence the ultimate register selection.

The baseline list/order can be seen here: https://github.com/dotnet/runtime/blob/main/src/coreclr/jit/targetamd64.h#L277-L287 (Unix is in the ifdef just above that).

--Noting that this was adjusted as part of adding AVX-512 support in .NET 8

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by MadProbe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
2 participants