Join GitHub today
Incorrect encoding of 16 bit floating point constants on FreeBSD ARM64 #7931
Original bug ID: 7931
The ARM64 instruction fmov takes a 16 bit constant representing a 64 bit floating point number. Ocaml generates an instruction like "fmov d0, #0x3ff0000000000000" to load a register with 1.0, providing the full 64 bit value. The assembler on FreeBSD (clang) requires a 16 bit constant instead, in this case "fmov d0,#0x70". I don't know if this short form works with the GNU assembler. I only have BSD installed.
The FreeBSD assembler also accepts "fmov d0, #0.5".
I attached a patch to generate the 16 bit form instead of the 64 bit form. As I said, I don't know if it works on any OS except FreeBSD. I am willing to test a patch from INRIA.
Probably clang is the same on all operating systems and GNU as is the same on all operating systems.
Steps to reproduce
make opt on FreeBSD ARM64 (see configure patch in issue 7930)