Commit Graph

52 Commits (540996d21ee3793a1cecce252c81fb76a6b9fd61)

Author SHA1 Message Date
Nicolás Ojeda Bär 540996d21e Remove Spacetime 2020-10-08 20:28:12 +02:00
Xavier Leroy 9fcb295b98 Revised passing of arguments to external C functions
Introduce the type Cmm.exttype to precisely describe arguments to
external C functions, especially unboxed numerical arguments.

Annotate Cmm.Cextcall with the types of the arguments (Cmm.exttype list).
An empty list means "all arguments have default type XInt".

Annotate Mach.Iextcall with the type of the result (Cmm.machtype)
and the types of the arguments (Cmm.exttype list).

Change (slightly) the API for describing calling conventions in Proc:
- loc_external_arguments now takes a Cmm.exttype list,
  in order to know more precisely the types of the arguments.
- loc_arguments, loc_parameters, loc_results, loc_external_results
  now take a Cmm.machype instead of an array of pseudoregisters.
  (Only the types of the pseudoregisters mattered anyway.)

Update the implementations of module Proc accordingly, in every port.

Introduce a new overridable method in Selectgen, insert_move_extcall_arg,
to produce the code that moves an argument of an external C function
to the locations returned by Proc.loc_external_arguments.

Revise the selection of external calls accordingly
(method emit_extcall_args in Selectgen).
2020-07-24 17:39:22 +02:00
Greta Yorsh aeebb62e9b Move contains_calls and num_stack_slots from Proc to Mach.fundecl 2019-09-09 11:33:03 +01:00
KC Sivaramakrishnan 750fd7a795 Support for domain state on arm 2019-08-23 09:50:05 +05:30
Mark Shinwell 4334b2de87
Position [Lprologue] correctly (#2292) 2019-03-29 11:47:53 +00:00
Mark Shinwell 770e662e96
Add [Proc.destroyed_at_reloadretaddr] (#2065) 2018-10-15 12:53:27 +01:00
Mark Shinwell dacb2240a4
DWARF register numberings (#2080) 2018-10-04 11:30:52 +01:00
Xavier Clerc 7e29162582 Pass the elements from `BUILD_PATH_PREFIX_MAP` to the assembler (#1930) 2018-07-27 12:25:23 +02:00
Xavier Leroy e71f1021b8
ARM 32-bit port: add support for ARMv8 in 32-bit mode, a.k.a. AArch32 (#1486)
For ARMv8/AArch32, avoid ITE conditional instruction blocks and use
simpler IT blocks instead.
2017-12-28 19:21:50 +01:00
Fourchaux 72cfdd56e9 Typos and basic grammar error fixing (#1280) 2017-08-10 11:59:23 +01:00
Mark Shinwell cd0bd8aa73 Spacetime: a new memory profiler (#585) 2016-07-29 15:07:10 +01:00
Mark Shinwell c843ca0691 Labels after calls, call GC points and checkbound points (again) (#660) 2016-07-06 11:44:00 +01:00
Mark Shinwell b2e7162546 Second attempt at fixing GPR#167 fallout 2016-04-15 13:41:54 +01:00
alainfrisch 502e4f9336 More warnings when compiling the compiler. 2016-03-15 22:46:35 +01:00
Damien Doligez 5401ce8473 Update headers for the new license.
Remains to be done: remove all headers in testsuite/tests.
2016-02-18 16:59:16 +01:00
Mark Shinwell 05f1746cb5 Rename to max_arguments_for_tailcalls; revise numbers assuming no unboxed floats using the OCaml calling conventions 2016-02-08 15:02:40 +01:00
Mark Shinwell b5618e8642 max_arguments_without_passing_on-stack 2016-01-29 15:57:36 +00:00
Damien Doligez 9ee053bd85 asmcomp/arm/proc.ml: fix missing parenthesis due to commit 16415
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16423 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-09-14 07:10:37 +00:00
Damien Doligez b860d63145 whitespace cleanup, cut long lines, add some missing headers
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16415 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-09-11 11:58:31 +00:00
Jérémie Dimino e7593340c1 Split 64-bit integers on 32-bit architectures
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16385 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-25 16:18:50 +00:00
Xavier Leroy 66e958ef0f Still following up on commit 16278.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16282 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-27 17:25:17 +00:00
Xavier Leroy 7027b858eb Update "register_class" followign the introduction of the Val machine type.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16278 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-27 11:37:52 +00:00
Gabriel Scherer eca0967403 PR#6167: OCAMLPARAM support for disabling PIC generation ('pic=0')
(Gabor Pali)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15793 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-01-24 16:35:26 +00:00
Xavier Leroy a4e637ea62 Reflecting commit 15498 on version/4.02:
PR#6588 part 2: for ARMv4 and ARMv5, make sure architectural constraints
  on the "smull" instruction are respected.  (Patch by Mark Shinwell.)


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15531 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-13 09:07:29 +00:00
Damien Doligez cbfe627f92 merge changes from branch 4.02 from branching (rev 14852) to 4.02.0+rc1 (rev 15121)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15125 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-22 13:45:02 +00:00
Xavier Leroy cd80c42655 Reflecting commit 15006 on version/4.02:
Typo in destroyed_at_alloc and destroyed_at_c_call, D17 was incorrectly claimed to be preserved.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15007 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-07-17 07:39:16 +00:00
Xavier Leroy 657ba73021 Liveness & Deadcode: fix i386-specific issue with move instructions accessing
the x87 FP stack, which must not be eliminated.
CSEgen: harden against the same x87-specific issue + against reuse of
  values in fixed hardware registers that were destroyed by a prior
  operation.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14877 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-16 14:37:22 +00:00
Xavier Leroy 558f40e344 New back-end optimization pass: common subexpression elimination (CSE).
(Reuses results of previous computations instead of recomputing them.)
(Cherry-picked from branch backend-optim.)
Tested on amd64/linux and i386/linux.
Other back-ends compile (after assorted updates) but are untested.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14688 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-26 10:40:22 +00:00
Xavier Leroy 9c1d005ebb New back-end optimization pass: dead code elimination.
(Removes arithmetic and load instructions whose results are unused.)
(Cherry-picked from branch backend-optim.)


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14686 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-26 09:31:18 +00:00
Benedikt Meurer 3bb161216b Perform constant optimizations for integer division and modulus on the C-- level.
This way we can avoid having to duplicate the same functionality for
every backend, and we may also benefit from other optimizations performed
during C-- generation.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14303 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-19 07:01:54 +00:00
Benedikt Meurer 20efbfefe2 [arm] r12 is destroyed for constants that are not a power of 2.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14260 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-02 15:28:26 +00:00
Benedikt Meurer db057d0beb [arm] Optimize integer division and modulus by constant.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14259 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-02 15:19:20 +00:00
Fabrice Le Fessant 9b53f8b10d Re-add configure option -with-frame-pointers
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13738 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-06-03 18:03:59 +00:00
Fabrice Le Fessant 97bc1fa9e2 Reverting -with-frame-pointers
Fails to compile alt-ergo without frame-pointers. No time to debug
before tonight, so I revert and will merge again after fixing the
problem.



git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13732 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-06-03 06:29:33 +00:00
Fabrice Le Fessant 1b2667b9f2 Add -with-frame-pointers to ./configure
This option can be used to tell the native compiler that it should
update frame pointers, so that debuggers and profiling tools 
(especially Linux perf) can use them. For now, it is only supported
by the Unix/amd64 port.



git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13730 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-06-03 04:42:42 +00:00
Benedikt Meurer 25343aa241 [arm] Fix arch selection with ARMv6. Rename EABI_VFP to EABI_HF.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13169 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-12-29 00:49:57 +00:00
Benedikt Meurer 9ae458499e [arm] Improve register pressure for interval splitting.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13168 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-12-28 23:27:56 +00:00
Benedikt Meurer dc0776f551 #5798: Apply patch to add VFPv2 and ARMv6 hard-float support (Jeffrey 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/trunk@13042 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-10-24 06:20:45 +00:00
Damien Doligez def31744f9 remove all $Id keywords
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13013 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-10-15 17:50:56 +00:00
Benedikt Meurer e76218f17d [arm] Update copyright notices as suggested by Xavier.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12125 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-02-05 08:47:16 +00:00
Benedikt Meurer 05627e0de4 Merge the new ARM backend into trunk (PR#5433).
Initial merge of the new ARM backend (commit ec5b444c7f) from my development
repository at https://github.com/bmeurer/ocaml-arm/tree/ec5b444c7f .

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 (PR#5049).
- 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 28% 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.



git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12124 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-02-04 10:15:24 +00:00
Damien Doligez 3b507dd1aa renaming of Objective Caml to OCaml and cleanup of copyright headers
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11156 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2011-07-27 14:17:02 +00:00
Xavier Leroy 4e50c497a8 Updating the ARM port, continued:
- Reserve register r9 and treat r10 as callee-save, as per the EABI.
- Treatment of alloc_limit register.
- Fixed bug in inlined allocation sequence.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@9252 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2009-05-04 13:46:46 +00:00
Xavier Leroy 5732a03e65 Updated ARM port to new ABI (EABI), with software floating-point.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@9211 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2009-03-31 09:45:55 +00:00
Xavier Leroy 9ccb911666 Can select which assembler to use at configuration time (PR#4171)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@8462 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2007-10-30 12:37:16 +00:00
Damien Doligez 851b9cb158 deps
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5020 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2002-07-22 16:38:07 +00:00
Xavier Leroy bae1b84692 Faire Filename.quote sur les noms de fichiers passes au compilo C, etc (PR#896)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@4516 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2002-03-12 16:17:53 +00:00
Xavier Leroy d2d789e8a8 MAJ load/store revus
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@3047 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2000-04-06 14:19:46 +00:00
Damien Doligez ddc7d63689 tabs -> spaces
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2639 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1999-11-29 19:16:30 +00:00
Xavier Leroy cc0f32b054 Changement de la licence
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2553 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1999-11-17 18:59:06 +00:00