-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Retype calls as SIMD when applicable. #53578
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
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). |
| // 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/16between importation and lowering.It better aligns with the fact that we retype
System.Numerics.Vector2/3/4locals and returns asSIMD.some IR diffs:
STMT00007 (IL 0x02B... ???) [000027] --C-G------- * RETURN simd8 - [000026] --C-G------- \--* CALL struct Runtime_49489.Program.ReturnSIMD2 + [000026] --C-G------- \--* CALL simd8 Runtime_49489.Program.ReturnSIMD2 STMT00011 (IL 0x003...0x008) [000040] -ACXG------- * ASG simd8 (copy) [000038] D------N---- +--* LCL_VAR simd8 <System.Numerics.Vector2> V03 tmp1 - [000034] --CXG+-N---- \--* CALL struct Runtime_49489.Program.ReturnSIMD2 + [000034] --CXG+-N---- \--* CALL simd8 Runtime_49489.Program.ReturnSIMD2I am not a huge fan of this retyping but the improved check in
gtNewLclvNodeshould make the code overall safer in my opinion.No asm diffs.
Fixes #52864.