On Dec 12, 2011, at 18:48 , Stéphane Glondu wrote:

>>> The relevant bug report PR/5404, which includes a backward
>>> compatible patch, is already waiting for a sign of life for 3 weeks
>>> now (maybe wait another 4 years to get the port fixed).
>> 
>> More bile.  What's so urgent about it?  The next release of OCaml is 3-6
>> months in the future; your suggestion will be examined by then. [...]
> 
> It's still unclear to me whether this kind of patches are welcome. I've
> been recently approached by an armhf porter (other than Benedikt)
> interested in having an ocamlopt running there, but I told him to back
> off because I don't know whether needed changes would be merged. Once
> again, I don't say we would have come up with a working solution before
> the next release of OCaml, but the result (if any) would have already
> been tested and deployed in Debian (and/or Ubuntu) before an upstream
> submission.

You can grab my current patch for the new OCaml ARM backend at:

 http://ps.informatik.uni-siegen.de/~meurer/tmp/ocaml-arm-20111213.diff

Compared to the old backend, this one does the following:

- Support for both softfp and VFPv3-D16 (if present).
- Properly supports interworking with Thumb/Thumb-2 code (for both OCaml and C 
code!)
- Supports dynamic linking and large memory models.
- Optional support for position-independent code via -fPIC, disabled by default 
and not required for natdynlink.
- Can emit both ARM and Thumb-2 code (currently Thumb-2 is used for ARMv7+ and 
ARM is used for everything else), with avg. code size savings of 27% for 
Thumb-2 (quite close the optimal 30% advertised by ARM Ltd.). I may also add 
support to emit small functions using Thumb-1 (for pre-ARMv7 / armel) in the 
future to reduce code size.
- Supports both AAPCS (armel) as well as extended VFP calling conventions 
(armhf).
- Properly supports backtraces.
- Recognizes several special ARM instructions (=> reduced code size and 
latency).
- Does not rely on GCC internals, but uses the standard ARM EABI runtime.

Feel free to test the patch, but be aware that it is

(a) highly experimental, it's tested and verified to work with Debian armel on 
ARMv5T and Debian armhf on a Cortex-A8, but YMMV,
(b) it only supports ARMv4T+ using the armel ABI w/o VFPv3, Thumb, etc. or 
ARMv7+ using the armhf ABI w/ VFPv3, Thumb-2, etc., there's no way to choose 
i.e. armel ABI w/ VFPv3, I don't know whether there's anyone except Ubuntu 
using such configurations currently,
(c) incompatible with .cmx/.cmxa/.cmxs files generated by the old ARM backend, 
and
(d) it's still a bit rough around the edges, i.e. the generated code is usually 
better (shorter and runs faster), but there's still room for improvement (i.e. 
instruction selection and scheduling need some more love).

Comments and suggestions are welcome.

> Cheers,
> Stéphane

HTH,
Benedikt


-- 
Caml-list mailing list.  Subscription management and archives:
https://sympa-roc.inria.fr/wws/info/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

Reply via email to