Skip to content
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

[LoongArch64] just skip the array type. #86290

Merged
merged 3 commits into from
May 16, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/coreclr/vm/methodtable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3443,6 +3443,15 @@ int MethodTable::GetLoongArch64PassStructInRegisterFlags(CORINFO_CLASS_HANDLE cl
size = STRUCT_FIRST_FIELD_SIZE_IS8;
}
}
else if (fieldType == ELEMENT_TYPE_CLASS)
{
// Here is just skip the array as its elements' count greater than 1.
// The `struct {int array[1]; float field_2;}` which the array field is only one element,
// just skip it although it can be passed by registers one integer and one float-register.
// Details see github https://github.com/dotnet/runtime/pull/62885#discussion_r821878981
jkotas marked this conversation as resolved.
Show resolved Hide resolved
size = STRUCT_NO_FLOAT_FIELD;
goto _End_arg;
}
else if (pFieldStart[0].GetSize() == 8)
{
size = STRUCT_FIRST_FIELD_SIZE_IS8;
Expand Down Expand Up @@ -3534,6 +3543,15 @@ int MethodTable::GetLoongArch64PassStructInRegisterFlags(CORINFO_CLASS_HANDLE cl
size |= STRUCT_SECOND_FIELD_SIZE_IS8;
}
}
else if (fieldType == ELEMENT_TYPE_CLASS)
{
// Here is just skip the array as its elements' count greater than 1.
// The `struct {int array[1]; float field_2;}` which the array field is only one element,
// just skip it although it can be passed by registers one integer and one float-register.
// Details see github https://github.com/dotnet/runtime/pull/62885#discussion_r821878981
jkotas marked this conversation as resolved.
Show resolved Hide resolved
size = STRUCT_NO_FLOAT_FIELD;
goto _End_arg;
}
else if ((size & STRUCT_FLOAT_FIELD_FIRST) == 0)
{
size = STRUCT_NO_FLOAT_FIELD;
Expand Down