Skip to content

Commit

Permalink
[LoongArch64] just skip the array type. (#86290)
Browse files Browse the repository at this point in the history
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 #62885 (comment)

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
  • Loading branch information
shushanhf and jkotas authored May 16, 2023
1 parent 690ded8 commit f452d9c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/coreclr/vm/methodtable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3443,6 +3443,11 @@ int MethodTable::GetLoongArch64PassStructInRegisterFlags(CORINFO_CLASS_HANDLE cl
size = STRUCT_FIRST_FIELD_SIZE_IS8;
}
}
else if (fieldType == ELEMENT_TYPE_CLASS)
{
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 +3539,11 @@ int MethodTable::GetLoongArch64PassStructInRegisterFlags(CORINFO_CLASS_HANDLE cl
size |= STRUCT_SECOND_FIELD_SIZE_IS8;
}
}
else if (fieldType == ELEMENT_TYPE_CLASS)
{
size = STRUCT_NO_FLOAT_FIELD;
goto _End_arg;
}
else if ((size & STRUCT_FLOAT_FIELD_FIRST) == 0)
{
size = STRUCT_NO_FLOAT_FIELD;
Expand Down

0 comments on commit f452d9c

Please sign in to comment.