Resolving a few issues with the HWIntrinsic code#15901
Conversation
emitIns_R_A_I, emitIns_R_C_I, and emitIns_R_S_IemitIns_R_A_I, emitIns_R_C_I, and emitIns_R_S_I and fixing an issue with the LoadAlignedVector128 test
|
FYI. @CarolEidt, @fiigii |
|
roundsd and roundss are actually 3-operand AVX instructions. I'm not sure how useful the 3-operand form is, but IIRC we need to actually model is as 3-operand to ensure that we duplicate the source to both source registers in the encoding. |
Yes, on AVX machines, where they are still being modeled correctly (this is handled in the This assert was impacting non-AVX machines, where they are emitted as their 2-operand SSE4.1 encoding. |
This assert is present on many non-AVX paths, yet doesn't cause an issue. I believe that these two instructions should be in the |
They are: https://github.com/dotnet/coreclr/blob/master/src/jit/emitxarch.cpp#L203
That's surprising to me. The check just does Non AVX machinese will return |
|
@tannergooding - you're right. I was mistaken. All the |
|
Looks like something is still incorrect for the SSE4.2 (non-vex) path. Investigating. |
What kind of failing did you get? Is it a managed exception? |
Yes. It currently throws an |
|
Looked into the Math.Round intrinsic failures and discovered there was some more significant changes required to get them working. After talking with @CarolEidt, I have disabled the changes for non-AVX machines and logged https://github.com/dotnet/coreclr/issues/15908 to track getting the issue resolved (the other option I raised was reverting the changes altogether). The above work also needs to get done in order to support some of the SSE4.1 and SSE4.2 HWIntrinsics, so there will be a double benefit in getting it fixed. |
…I`, and `emitIns_R_S_I` methods
…always read from an aligned address.
|
Adding the fields to Latest commit updates the HWIntrinsic nodes to skip struct promotion for TYP_SIMD locals using the same mechanism as the SIMD nodes. Ideally, we can clean this up more as part of https://github.com/dotnet/coreclr/issues/15641 |
|
I've requeued the
|
emitIns_R_A_I, emitIns_R_C_I, and emitIns_R_S_I and fixing an issue with the LoadAlignedVector128 test|
@CarolEidt, I believe all issues have been resolved now. |
Bad merge between two of my PRs (#15538) and (#14736) that resulted in the
System.Math.Round,System.Math.Floor, andSystem.Math.Ceilingfunctions asserting inDebug/Checkedbuilds on non-AVX enabled machines.roundssandroundsdgo down these code paths and are SSE4.1 instructions, and will fail theIsThreeOperandAVXInstructioncheck,Also fixing the
LoadAlignedVector128test, which was sometimes failing due to the stack not guaranteeing 16-byte alignment.Also marking TYP_SIMD nodes to not undergo struct promotion if they are part of a GT_HWIntrinsic node.