Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Patch to add ARM VFPv2 support #5798
Original bug ID: 5798
For my port of OCaml 4.00.0 to older iOS devices, I added support for VFPv2 (older floating point). I'm attaching a patch that applies cleanly against 4.00.0 and 4.00.1. I tested the 4.00.0 version under iOS and it works great for me. There is also a report from Anil Madhavapeddy that this patch works for Raspberry Pi.
Steps to reproduce
patch -p0 < ocaml4-vfpv2.diff
Comment author: jeffsco
I think you have it right. The change is indeed very small. VFPv2 doesn't support the FCONSTD/FCONSTS instructions. Otherwise it looks just like VFPv3_D16 (with respect to current ARM code generator). The other changes are all just to fit the new fpu variant into the existing code. I don't know about raspberry changes.
Comment author: @avsm
I've uploaded an updated version of Jeff's patch that also adds the right flags to the runtime for VFPE2 support.
The Raspberry Pi is an ARMv6, and so the default Debian distribution is soft float. There is an alternative recompiled "Raspbian" distribution which is hard float, and this patch prevents ocamlopt from outputting VFPE3/ThumbII instructions and segfaulting there. It now uses VFPE2 and no Thumb.
I've tested this on Raspbian/OCaml-4 and it works great. The patch should have no effect on soft float distributions. It's also available as the "4.00.1+raspberrypi" compiler switch if you use OPAM.