Skip to content

What is the rationale for Vector128.ConvertToDouble having a codepath for SSE2 in C#? #111195

Answered by tannergooding
tgjones asked this question in Q&A
Discussion options

You must be logged in to vote

But (as far as I can tell) this method also has JIT support:

For x64, this is notably only done when Avx512F or Avx10v1 is available. This fallsback to the managed implementation for hardware with only [SSE2, AVX2] support

why not implement that optimization entirely in the JIT?

Not all code is trivial to implement in the JIT, due to the size of the IR required to be inserted. In the case of ConvertToDouble, there are 7-9 IR nodes that need to be inserted for this operation.

Sometimes, particularly for methods where it isn't critical to have it done in the JIT we instead do it in managed for simplicity. In many cases its just point in time and it would be possible to add a path to the…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@tgjones
Comment options

Answer selected by tgjones
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants