Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005433OCamlOCaml generalpublic2011-12-18 14:132013-05-08 15:26
Reportermeurer 
Assigned Tomeurer 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformARMOSLinuxOS Version
Product Version3.12.1 
Target VersionFixed in Version4.00.0+beta2/+rc1 
Summary0005433: New ARM backend
DescriptionThe following is basically copy&paste from https://github.com/bmeurer/ocaml-arm/wiki: [^]

This patch contains my work on a new ARM backend for the OCaml native code compiler, currently based on the 3.12.1 release. Compared to the old ARM backend, this one does the following:

- Support for both software and hardware floating-point (VFPv3).
- 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 a command line option -fPIC. This is disabled by default and not required for natdynlink.
- Can emit both ARM and Thumb-2 code, with avg. code size savings of 27% for Thumb-2 (quite close the optimal 30% advertised by ARM Ltd.).
- Supports both AAPCS (armel) as well as extended VFP calling conventions (armhf).
- Supports several special ARM instructions to reduce code size and latency.
- Uses standard ARM EABI runtime functions instead of relying on GCC internals.
- Supports exception backtraces.
- Supports profiling using gprof.

See https://github.com/bmeurer/ocaml-arm/wiki [^] for up-to-date information about the current state of the patch.

The latest patch is attached, but it's not necessarily the final patch. It's almost a complete rewrite of the ARM backend, so it will need some more testing.
TagsNo tags attached.
Attached Filesbz2 file icon ocaml-arm-3.12.1+20111218.diff.bz2 [^] (40,417 bytes) 2011-12-18 14:13
bz2 file icon ocaml-arm-3.12.1+20111222.diff.bz2 [^] (21,176 bytes) 2011-12-22 11:41

- Relationships
has duplicate 0005404closedlefessan Support for position-independent code and natdynlink on ARM 

-  Notes
(0006497)
meurer (developer)
2011-12-22 11:43

Attached a new patch, which does no longer includes the config.guess/config.sub upgrade (see PR#5439 for that), therefore only half the size of the previous patch.
(0006780)
xleroy (administrator)
2012-01-23 15:48

I have a concern about Proc.destroyed_at_oper, case Iop(Iextcall(_, true)): the result should really be all_phys_regs as in the original code. Indeed, an allocating extcall can raise a Caml exception, which will not reload any of the callee-save registers. Also, such an extcall can trigger a GC, and if GC roots are stored in callee-save regs across the Iextcall, the GC assumes that these callee-save regs have been saved in memory in a location pointed to by caml_gc_regs (cf. caml_call_gc in asmrun/<proc>.S). For both reasons, all Caml values live across a Iextcall(_, true) must be stack-allocated, and this is achieved by saying that the Iextcall destroys all registers.
(0006787)
meurer (developer)
2012-01-23 19:44

Ok, makes sense. It's fixed in ocaml-arm:

https://github.com/bmeurer/ocaml-arm/commit/7658da046c3fe4066c6753691e9131d73b2bde4a [^]
(0006877)
meurer (developer)
2012-02-04 11:18

I just merged the latest commit ec5b444c7f of my development repository at https://github.com/bmeurer/ocaml-arm/tree/ec5b444c7f [^] into trunk with revision 12124.

- Issue History
Date Modified Username Field Change
2011-12-18 14:13 meurer New Issue
2011-12-18 14:13 meurer File Added: ocaml-arm-3.12.1+20111218.diff.bz2
2011-12-22 11:41 meurer File Added: ocaml-arm-3.12.1+20111222.diff.bz2
2011-12-22 11:43 meurer Note Added: 0006497
2012-01-17 11:04 lefessan Relationship added has duplicate 0005404
2012-01-23 15:48 xleroy Note Added: 0006780
2012-01-23 15:48 xleroy Status new => feedback
2012-01-23 19:44 meurer Note Added: 0006787
2012-01-23 19:44 meurer Status feedback => new
2012-01-31 08:49 xleroy Assigned To => meurer
2012-01-31 08:49 xleroy Status new => assigned
2012-02-04 11:18 meurer Note Added: 0006877
2012-02-04 11:19 meurer Status assigned => resolved
2012-02-04 11:19 meurer Resolution open => fixed
2013-05-08 15:26 meurer Status resolved => closed
2013-05-08 15:26 meurer Fixed in Version => 4.00.0+beta2/+rc1


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker