-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Sse2.Set[All]Vector128([u]long, [u]long) crashes with PNSE when run in 32-bit process #10453
Comments
However, it is also one of the Int64 intrinsics that can work on 32-bit, since there is a @CarolEidt, thoughts? |
Also, for reference, the helper methods are currently:
|
@tannergooding - please check the subject of the issue, it tells exactly about SetAllVector128() and SetVector128() for 64-bit values. For some reason these two are not on your list. |
@voinokin, right. The failure is because
(I would imagine the former).
Looks like my list is missing the ones implemented in managed code. I'll update it. |
For |
Taking a note on availability on Here they are at least for SSE, can't tell for AVX since it's incomplete anyway:
I list these here to not create new issue record. |
For the most part, yes. The containment support basically allows us to take a:
and convert it into either
or
Depending on what the instruction supports. For example, |
There are still some cases where the API shape doesn't exactly match the semantics of the underlying instruction, however (such as |
I vote for this option. And they are also marked as "HELPER" methods in ref assembly ( https://github.com/dotnet/coreclr/blob/73369eb914dc7df2118727a36f23e8c5e5d119f5/src/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Sse2.cs#L1259 and https://github.com/dotnet/coreclr/blob/73369eb914dc7df2118727a36f23e8c5e5d119f5/src/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Sse2.cs#L1067) So I wonder why these methods are not called helper anymore :-) |
In my case the throughoutput is everything, so issueing extra memory access is not an option - I'll have to work this around with my own helper which will use just xmm regs. |
Like I said above, it was just that my reference list was missing the helper methods implemented in managed code.
It's probably worth profiling whether or not it hurts performance. The general way to do this is (and what the native compilers do) is to generate a 16-byte constant and directly load that from memory. The JIT doesn't currently support creating these 16-byte constants and it is a TODO work item. |
The reason this API was left unimplemented is exactly one you have indicated. If you want to use 64 bit scalar values to set xmm registers workaround is to use Set(All)Vector128 with 32 bit integers splitted from 64 bit integers, otherwise, you will have to use memory based approach which may or may not be very effective (if you will load from cache it can be done in 1 CPU cycle). It is possible to use 64 bit integer handling JIT implementation for x86 to work with 64 bit integers in xmm registers but due to time limitations before 2.1 commit window close it was not implemented. @fiigii is planning to do some work on moving managed implementation of Set(All)Vector128 to JIT codegen to increase flexibility and it seems a good opportunity to implement missing functionality. |
This is solved by the platform-agnostic helpers, please close. |
My guess is - these method have managed implementation behind them involving
ConvertScalarToVector128[U]Int64()
(MOVQ xmm, r64
) unavailable in 32-bit mode.Since these are all just helper methods not necessarily mapped to some specific HW intrinsic directly, my understanding is that the implementation should behave considering current process bitness - eg. use set of 32-bit HW intrinsics to setup the result when in 32-bit mode.
The text was updated successfully, but these errors were encountered: