Skip to content
Discussion options

You must be logged in to vote

It depends on several bits of context. This includes, but isn't limited to:

  • size of the method
  • whether the method will be inlined
  • how the parameters are accessed/used
  • ABI of the underlying target platform
  • Layout of the struct in question
  • etc

Some platforms allow structs that are less than or equal to 2 pointers in length to be passed in multiple registers.
Some platforms allow structs that contain 1-4 floating-point or 1-4 SIMD types to be passed in multiple registers.
Some platforms allow structs with many fields that are less than or equal to a pointer in length to be passed in a single register.

All of this nuance basically means there is no "correct" answer and context has to be tak…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by voroninp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants