-
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
Fix arm64 apple hfa<float>. #46034
Fix arm64 apple hfa<float>. #46034
Conversation
/azp list |
This comment has been minimized.
This comment has been minimized.
/azp run runtime-coreclr outerloop, runtime-coreclr jitstress |
Azure Pipelines successfully started running 2 pipeline(s). |
6773295
to
5d4ffe1
Compare
There was no users that required the exact size, but keeping it required rounding all over the place.
Apple doesn't require struct alignment for it.
5d4ffe1
to
2d87c52
Compare
This comment has been minimized.
This comment has been minimized.
ping @dotnet/jit-contrib |
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.
LGTM. Looked through each commit. Each looked reasonable and logical.
// TODO-Review: Sometimes we get called on ARM with HFA struct variables that have been promoted, | ||
// where the struct itself is no longer used because all access is via its member fields. | ||
// When that happens, the struct is marked as unused and its type has been changed to | ||
// TYP_INT (to keep the GC tracking code from looking at it). | ||
// See Compiler::raAssignVars() for details. For example: | ||
// N002 ( 4, 3) [00EA067C] ------------- return struct $346 | ||
// N001 ( 3, 2) [00EA0628] ------------- lclVar struct(U) V03 loc2 | ||
// float V03.f1 (offs=0x00) -> V12 tmp7 | ||
// f8 (last use) (last use) $345 | ||
// Here, the "struct(U)" shows that the "V03 loc2" variable is unused. Not shown is that V03 | ||
// is now TYP_INT in the local variable table. It's not really unused, because it's in the tree. |
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.
Realize this is a pre-existing comment, but raAssignVars
is long gone....
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.
Thank you, I will fix the comment in the next pr.
Apple Arm64 does not require struct alignment for HFA, instead, it uses 4-byte stack alignment for this type. Add Jit support for this. Closes #45780.
The changes:
0296b35: A small fix in dump printing.
ac6fada: Keep the aligned size in
fgArgInfo
.There were no users that required the exact size, but keeping it required roundings all over the place.
So now both
fgArgInfo
andGenTreePutArg
keep the align size (with padding after the arg value), but the alignment is different on different platforms.ee4076f: Fix float HFA stack passing.
Apple doesn't require struct alignment for it.
The main change is introducing
eeGetArgAlignment
that returns alignment for an argument type. I am planning to extend this method soon (see #46026).The second change is fix for
LclVarDsc::lvSize()
so it returns12
for such variables.Also, I am trying to use less
#if defined(OSX_ARM64_ABI)
to make #45501 easier.2d87c52: Fix
lvaMapSimd12ToSimd16
for arm64 apple arguments.Now when
lvSize
returns12
forSIMD12
arguments on arm64 apple we need to fix some asserts that do not expect it.Fixes 46 tests (including pri1 tests):
Note: it does not fully fix
because they are using reflection and additional VM fixes are needed.