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

Patch to add ARM VFPv2 support #5798

Closed
vicuna opened this issue Oct 23, 2012 · 6 comments
Closed

Patch to add ARM VFPv2 support #5798

vicuna opened this issue Oct 23, 2012 · 6 comments

Comments

@vicuna
Copy link

vicuna commented Oct 23, 2012

Original bug ID: 5798
Reporter: jeffsco
Assigned to: meurer
Status: closed (set by meurer on 2012-12-10T11:35:56Z)
Resolution: fixed
Priority: normal
Severity: feature
Platform: ARM
OS: Various
Version: 4.00.1
Fixed in version: 4.00.2+dev
Category: back end (clambda to assembly)
Monitored by: @avsm

Bug description

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

File attachments

@vicuna
Copy link
Author

vicuna commented Oct 23, 2012

Comment author: meurer

Unless I am overlooking something, this will introduce an armhf variant with VFPv2, right? And the only real difference in code generation is the loading of float constants?
Is this exactly what the "raspbian" ABI is about?

@vicuna
Copy link
Author

vicuna commented Oct 23, 2012

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.

@vicuna
Copy link
Author

vicuna commented Oct 23, 2012

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.

@vicuna
Copy link
Author

vicuna commented Oct 24, 2012

Comment author: meurer

Ok, looks good, thanks. Patch applied to trunk with revision 13041.

@vicuna
Copy link
Author

vicuna commented Nov 2, 2012

Comment author: @avsm

would it be possible to merge this into one of the 4.0x branches? It's needed to generate binary packages for the Raspberry Pi hardfloat distributions.

@vicuna
Copy link
Author

vicuna commented Dec 10, 2012

Comment author: meurer

Merged into 4.00 with revision 13125.

@vicuna vicuna closed this as completed Dec 10, 2012
dra27 pushed a commit to dra27/ocaml that referenced this issue Feb 27, 2021
…ffrey Scofield, Anil Madhavapeddy).

[PATCH] Detect and support armv6/VFPE2, which is sufficient to get
ocamlopt working on the Raspberry Pi hardfloat Debian variant

Original patch: Jeffrey Scofield via http://psellos.com/pub/ocamlxarm/ocaml4-vfpv2.diff
Fixes from: Anil Madhavapeddy <anil@recoil.org>



git-svn-id: http://caml.inria.fr/svn/ocaml/version/4.00@13125 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant