-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Retype calls as SIMD when applicable. #53578
Conversation
PTAL @AndyAyersMS @dotnet/jit-contrib |
/azp run runtime-coreclr jitstress |
Azure Pipelines successfully started running 1 pipeline(s). |
I have pushed a change to retype multireg returns as well, note that now the change has some diffs but they are potential bug fixes: Generating: N065 ( 18, 3) [000012] --CXG------- t12 = * CALL ind unman struct REG mm0,mm1 $280
+IN0014: vpslldq xmm1, 12
+IN0015: vpsrldq xmm1, 12
/--* t12 struct
Generating: N081 ( 18, 3) [000015] DA-XG------- * STORE_LCL_VAR simd16<System.Numerics.Vector3> V06 tmp3 d:1 mm0 REG mm0
IN001c: vshufpd xmm0, xmm1, 0
as we see from runtime/src/coreclr/jit/codegenxarch.cpp Lines 5414 to 5418 in 2c508d4
there were no guarantees that top bytes of xmm1 were zeroed by the native compiler. diffs:
all in
|
/azp run runtime-coreclr jitstress |
Azure Pipelines successfully started running 1 pipeline(s). |
@@ -5414,7 +5414,7 @@ void CodeGen::genCallInstruction(GenTreeCall* call) | |||
// A Vector3 return value is stored in xmm0 and xmm1. | |||
// RyuJIT assumes that the upper unused bits of xmm1 are cleared but | |||
// the native compiler doesn't guarantee it. | |||
if (returnType == TYP_SIMD12) | |||
if (call->IsUnmanaged() && (returnType == TYP_SIMD12)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just noting, the shift left, shift right idiom isn't the "best" codegen for modern hardware. It would likely be better for us to use one of the zero insertion idioms instead.
I'll log a bug for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logged #53713
Retype calls that return System.Numerics.Vector2/3/4 as
TYP_SIMD8/12/16
between importation and lowering.It better aligns with the fact that we retype
System.Numerics.Vector2/3/4
locals and returns asSIMD
.some IR diffs:
I am not a huge fan of this retyping but the improved check in
gtNewLclvNode
should make the code overall safer in my opinion.No asm diffs.
Fixes #52864.