Page MenuHomePhabricator

Correct VectorCall x86 (32 bit) behavior for SSE Register Assignment
ClosedPublic

Authored by erichkeane on Jun 21 2017, 8:44 AM.

Details

Summary

In running some internal vectorcall tests in 32 bit mode, we discovered that the behavior I'd previously implemented for x64 (and applied to x32) regarding the assignment of SSE registers was incorrect. See spec here: https://msdn.microsoft.com/en-us/library/dn375768.aspx

My previous implementation applied register argument position from the x64 version to both. This isn't correct for x86, so this removes and refactors that section. Additionally, it corrects the integer/int-pointer assignments. Unlike x64, x86 permits integers to be assigned independent of position.

Finally, the code for 32 bit was cleaned up a little to clarify the intent, as well as given a descriptive comment.

Diff Detail

Repository
rL LLVM

Event Timeline

erichkeane created this revision.Jun 21 2017, 8:44 AM
rnk accepted this revision.Jun 21 2017, 9:23 AM

Oh joy. :)

lgtm, thanks for debugging this. The difference makes sense after the fact when you think about Win x64's approach to va_arg and /homeparams, and how that isn't relevant for x86.

This revision is now accepted and ready to land.Jun 21 2017, 9:23 AM
This revision was automatically updated to reflect the committed changes.