Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect encoding of 16 bit floating point constants on FreeBSD ARM64 #7931

vicuna opened this Issue Feb 25, 2019 · 1 comment


None yet
2 participants
Copy link

vicuna commented Feb 25, 2019

Original bug ID: 7931
Reporter: jfc
Status: new
Resolution: open
Priority: normal
Severity: minor
Platform: ARM64
OS Version: 13
Category: back end (clambda to assembly)
Monitored by: @nojb

Bug description

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)
The assembler will fail on stdlib/ due to the constants 1.0 and 0.5 being encoded as 64 bit values.

File attachments


This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Feb 25, 2019

Comment author: @nojb

Looks like a duplicate of #1904

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.