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
[ARM/Linux] ARM-softfp delegate code generation issue #5954
Comments
|
For generics we pass an additional parameter in r0, which makes the last soft-fp argument go to the stack. And so the r0 gets spoiled for the arm-softfp abi. if we try to do the same with the integer arguments for ARM hard then debugging the calls we'll see the trampoline code looking like the following: could someone give me a hint of where to look for the source of the generated trampoline? |
|
If I replace the occurrence of Point in the above example with a new structure PointInt which has the members X and Y integers, then in the code generation process I see the call to |
|
The whole call tree looks like this, so it is the call with the 2 structs and additional this argument in r0: |
|
The issue is in fact related to the delegate calls: see the changed text of the description of the issue. |
|
The delegate call for the last example looks like this: |
|
@papaslavik - the delegate thunk is generated by the COMDelegate::SetupShuffleThunk, which uses GenerateShuffleArray to determine what shuffles are necessary. |
|
at code execution the trampoline for the delegate example with Point based on floats looks like the following: |
|
@janvorli thanks a lot! will look in that direction. |
|
So, in src/vm/comdelegate.cpp we work with the calling conventions, in particular we have the code working for ARM with the following comments: And that is done before we do the fgMorphCall in which the convention is in fact implemented, so there's no information about ARM soft fp abi at that point of compilation. Presumably, we need to fix ShuffleIterator::HasNextOfs() function for ARM softfp |
|
@papaslavik - what is the difference between the soft and hard abi in argument passing? Does the softfp mean that floating point arguments are passed in general purpose registers? |
|
@janvorli yes, the float arguments are passed on integer registers. |
|
In fact that is very similar to varargs passing, so I will stick to that in the code you pointed at: |
|
@janvorli are there simplified tests for the delegates in the framework, or perhaps, where we could add our simple test to check that the conventions work? |
|
@papaslavik There are delegate tests in tests/src/CoreMangLib/cti/system/delegate and tests/src/CoreMangLib/cti/system/multicastdelegate. I don't see tests related to passing floats or doubles, so it seems it would make sense to add one in there. |
Update:
the issue in fact occurs in delegate code generation, and this small example shows the problem:
What follows below is my initial description of the issue.
Testing JIT.SIMD.CircleInConvex_r.CircleInConvex_r in arm-softfp we discovered an issue with generics when the floating point arguments were passed.
There's a simplified code which will demostrate the issue:
The text was updated successfully, but these errors were encountered: