Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualAndreas Jonsson

Posted 12 November 2012 - 02:31 PM

Yes, it would seem that the ABI keeps two distinct arrays, one for floats and one for integers. Integers goes to r0, r1, r2, ..., and floats to s0, s1, s2, ...

If each d, register is in fact two s registers, then it is necessary to consider padding when mixing floats and doubles.

It would be interested to see a receivesMixed2(int a, double b, int c, float d). From what we've seen so far, these arguments should be passed as following: a -> r0, b -> d0, c -> r1, d -> s2. The last goes to s2 because d0 occupies both s0 and s1.

receivesMixed3(float a, double b, float c) should be as following: a -> s0, b -> d1, c -> s4. The last goes to s4, because d1 occupies both s2 and s3. In this case s1 is not used.

Another thing that needs to be checked before the best algorithm can be determined is how many registers that may be used for passing arguments. The iOS and Android ABI only uses 4 registers at most (r0 to r3), the arguments that don't fit into these 4 registers are pushed on the stack.

#1Andreas Jonsson

Posted 12 November 2012 - 02:31 PM

Yes, it would seem that the ABI keeps two distinct arrays, one for floats and one for integers. Integers goes to r0, r1, r2, ..., and floats to s0, s1, s2, ...

If each d, register is in fact two s registers, then it is necessary to consider padding when mixing floats and doubles.

It would be interested to see a receivesMixed2(int a, double b, int c, float d). From what we've seen so far, these arguments should be passed as following: a -> r0, b -> d0, c -> r1, d -> s2. The last goes to s2 because d0 occupies both s0 and s1.

receivesMixed3(float a, double b, float c) should be as following: a -> s0, b -> d1, c -> s4. The last goes to s4, because d1 occupies both s2 and s3. In this case s1 is not used.

Another thing that needs to be checked before the best algorithm can be determined is how many registers that may be used for passing arguments. The iOS and Android ABI only uses 4 registers at most, the arguments that don't fit into these 4 arguments are pushed on the stack.

PARTNERS