[Vm-dev] arm64 float vs double

ken.dickey at whidbey.com ken.dickey at whidbey.com
Tue Jan 22 22:01:03 UTC 2019


>    I don't understand this proposed change.  float is a 32-bit 
> datatype, double is a 64-bit datatype.  My understanding is that on 
> ARM64 floating-point arguments are passed as doubles.  What am I 
> missing?

What I was missing was the rationale for using only even numbered array 
indices for floatRegisters in 
ThreadedARM{32,64}FFIPlugin>>ffiCalloutTo:SpecOnStack:in:

I am following the pattern of ThreadedARM32FFIPlugin:
  - floats get assigned to the register array slots 
[#ffiPushSingleFloat:in:]
  - doubles get mem-copied to the register array slots 
[#ffiPushDoubleFloat:in:]

C casting tricks are then used to interpret memory properly for FFI 
usage.

One could do the other way around.

Case of 6 of one, half a dozen of the other.

This is why we need to leave mouse tracks (er, document) our artifacts.

Hey, this confused the heck out of me!
-KenD


More information about the Vm-dev mailing list