Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005798OCamlback end (clambda to assembly)public2012-10-23 22:412012-12-10 12:35
Assigned Tomeurer 
PlatformARMOSVariousOS Version
Product Version4.00.1 
Target VersionFixed in Version4.00.2+dev 
Summary0005798: Patch to add ARM VFPv2 support
DescriptionFor 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 Reproducepatch -p0 < ocaml4-vfpv2.diff
TagsNo tags attached.
Attached Filesdiff file icon ocaml4-vfpv2.diff [^] (6,789 bytes) 2012-10-23 22:41 [Show Content]
patch file icon ocaml-vfpe2+config.patch [^] (9,925 bytes) 2012-10-23 23:56 [Show Content]

- Relationships

-  Notes
meurer (reporter)
2012-10-23 23:28

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?
jeffsco (reporter)
2012-10-23 23:35

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.
avsm (developer)
2012-10-24 00:01

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.
meurer (reporter)
2012-10-24 08:25

Ok, looks good, thanks. Patch applied to trunk with revision 13041.
avsm (developer)
2012-11-02 13:33

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.
meurer (reporter)
2012-12-10 12:35

Merged into 4.00 with revision 13125.

- Issue History
Date Modified Username Field Change
2012-10-23 22:41 jeffsco New Issue
2012-10-23 22:41 jeffsco File Added: ocaml4-vfpv2.diff
2012-10-23 23:23 meurer Assigned To => meurer
2012-10-23 23:23 meurer Status new => assigned
2012-10-23 23:28 meurer Note Added: 0008312
2012-10-23 23:35 jeffsco Note Added: 0008313
2012-10-23 23:56 avsm File Added: ocaml-vfpe2+config.patch
2012-10-24 00:01 avsm Note Added: 0008314
2012-10-24 08:25 meurer Note Added: 0008318
2012-10-24 08:25 meurer Status assigned => resolved
2012-10-24 08:25 meurer Fixed in Version => later
2012-10-24 08:25 meurer Resolution open => fixed
2012-11-02 13:33 avsm Note Added: 0008409
2012-12-10 12:35 meurer Note Added: 0008592
2012-12-10 12:35 meurer Status resolved => closed
2012-12-10 12:35 meurer Fixed in Version later => 4.00.2+dev
2017-02-23 16:35 doligez Category OCaml backend (code generation) => Back end (clambda to assembly)
2017-02-23 16:44 doligez Category Back end (clambda to assembly) => back end (clambda to assembly)

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker