ebitengine / purego

Apache License 2.0
1.95k stars 63 forks source link

Increase max argument to 15 #182

Closed TotallyGamerJet closed 7 months ago

TotallyGamerJet commented 7 months ago

This increases the max number of arguments to be 15. This is necessary because amd64 puts almost everything on the stack when passing structs. This meant that there wasn't enough room with just 9 arguments to pass all the tests that arm64 has in the struct branch.

TotallyGamerJet commented 7 months ago

I'm looking into why it's failing with morestack on g0. It doesn't fail on my machine. @hajimehoshi do you remember how you fixed that for the Switch?

hajimehoshi commented 7 months ago

morestack on g0

This should be fixed in 1.21.4 (https://github.com/golang/go/issues/62440). This doesn't occur in 1.20 and older.

TotallyGamerJet commented 7 months ago

But the 1.19 test is the one that failed?

hajimehoshi commented 7 months ago

But the 1.19 test is the one that failed?

So unfortunately this seems a different thing from what I've seen in Switch.

TotallyGamerJet commented 7 months ago

This is now ready for review!

TotallyGamerJet commented 7 months ago

No there shouldn't be since once all the float registers are full they get placed on the stack. I'll add a test to this PR to prove that.

EDIT: to clarify the limit is the same as integers.

progrium commented 7 months ago

👀

hajimehoshi commented 7 months ago

Let me know when this pr is ready

TotallyGamerJet commented 7 months ago

@hajimehoshi it is ready to be merged if the new test also looks good