Commit Graph

657 Commits (d3d363a1a65a21ae55669607ea792ce860069d2f)

Author SHA1 Message Date
Benedikt Meurer 354b740a28 [coloring] Validate physical register offsets.
The ARM backend uses several tricks to support selection of
VFP3_D16/VFP3_D32 when ocamlopt is invoked, which introduces
interferences with non-existing floating-point registers when
the VFP3_D16 fpu option is used. These invalid interferences
must be skipped while coloring the graph.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13229 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-01-13 16:57:36 +00:00
Benedikt Meurer 130769e7b4 [arm] Fix typo in is_simple_expr.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13228 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-01-13 16:57:28 +00:00
Benedikt Meurer 2a38b0a232 [coloring] No need to test for "well-typed" interferences.
The interference graph no longer contains "ill-typed" interferences
between registers of different class, so we no longer need to test
in the coloring algorithm.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13208 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-01-07 07:06:18 +00:00
Benedikt Meurer a1ecba1619 [interf] Don't record "ill-typed" interferences.
The coloring algorithm uses only the "well-typed" interferences (registers
with same class). This is because we don't assign the same stack slot to
registers of different register class.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13207 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-01-07 07:06:15 +00:00
Benedikt Meurer 02a3d55135 [arm] Inlined byte-swap operations are simple if their arguments are.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13206 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-01-06 17:40:27 +00:00
Benedikt Meurer e0e2f5fb1b [arm] Implement the byte swap operations (PR#5774).
Use rev16/movt to implement direct 16-bit byte-swap operation
(ARMv6T2 and above) and rev to implement the 32-bit byte-swap
operation (ARMv6 and above).

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13203 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-01-06 17:07:50 +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 5ac5c51914 Slightly improve ordering of constrained registers.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13166 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-12-27 23:39:28 +00:00
Benedikt Meurer 6d46c663db Collect the constrained registers into a set.
Sets allow for faster insertion than ordered lists, while also supporting
iteration according to the comparison function.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13150 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-12-21 18:36:26 +00:00
Benedikt Meurer 6fad047cc0 PR#5181: Merge common floating point constants in ocamlopt.
Instead of generating a unique quadword constant for each and every
floating point constant use within a function, we now collect the floating
point constants on a per-module basis, and generate only one quadword
per floating point constant.

This affects only the amd64 and i386 ports (both Unix/Linux/OS X and Windows).

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13149 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-12-21 18:33:32 +00:00
Benedikt Meurer d3b1fa2c9b Simplify and optimize the coloring algorithm.
There's no need to first split the registers into constrained/unconstrained
sets first and transform these sets into a list using an additional pass;
instead we can directly place the registers on lists, where the constrained
list is sorted by spill cost.
Afterwards all that's left to do is to assign locations to the constrained
and unconstrained registers by traversing the lists.



git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13145 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-12-20 10:38:15 +00:00
Benedikt Meurer 45bc825115 Fix whitespace in emitted AMD64 code.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13144 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-12-20 10:37:55 +00:00
Benedikt Meurer 19ea264f3d Combine the first two coloring passes.
This combines the preallocation of spilled registers and splitting of
the remaining registers into constrained and unconstrained, and thereby
saves one pass on the register set.



git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13143 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-12-20 10:37:37 +00:00
Benedikt Meurer 2f077a9ab7 Compute the degrees while building the interference graph.
This speeds up the register allocator and allows for further optimizations.



git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13142 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-12-20 10:37:13 +00:00
Fabrice Le Fessant 89bdc10350 PR#5774: Add bswap primitives for amd64
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13106 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-11-29 09:55:00 +00:00
Xavier Leroy 23502e1275 PR#5824: avoid tagging before right shifts
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13096 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-11-17 17:23:15 +00:00
Fabrice Le Fessant ec7ac9cb3d PR#5771: Add primitives for reading 2, 4, 8 bytes in strings and bigarrays
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13087 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-11-09 16:15:29 +00:00
Fabrice Le Fessant d34a734947 PR#5795: Generate sqrtsd opcode instead of external call to sqrt on amd64
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13086 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-11-09 13:26:43 +00:00
Xavier Clerc ce37153d1e PR#5810: error in switch printing when using -dclambda
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13073 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-11-07 12:36:09 +00:00
Fabrice Le Fessant 95c20bc6ae PR#5762: Add primitives for fast access to bigarray dimensions
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13069 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-11-06 17:03:34 +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
Alain Frisch 5e8adcd8df #5784: -dclambda option is ignored.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13017 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-10-16 13:40:36 +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
Xavier Leroy 9ac1d4937b PR#5707: in AMD64 port, exchange the roles of r10-r11 and r12-r13,
so that r10 and r11 are no longer used for parameter passing,
  and can therefore be destroyed by the dynamic loader without harm.
(Cherry-picked from version/4.00, commit 12907).


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12908 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-09-08 16:53:39 +00:00
Xavier Leroy c705000ce4 Remove some "open" to please the new warnings.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12866 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-08-20 06:55:29 +00:00
Xavier Leroy 094041bdad PR#5731: take destroyed registers into account during scheduling.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12865 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-08-20 06:54:56 +00:00
Damien Doligez 997a678d5e clean up TABs and whitespace
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12799 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-07-30 18:04:46 +00:00
Damien Doligez 0c3a7de507 merge changes from 4.00 branching to 4.00.0 (part 1)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12784 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-07-26 19:21:54 +00:00
Fabrice Le Fessant 229044d83a Fix PR#5698: remove harcoded limit of 200000 labels in emitaux.ml
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12770 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-07-24 17:33:46 +00:00
Fabrice Le Fessant 930864c9cc Fix PR#5695 (Redoing commit 12756 without unwanted changes)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12758 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-07-22 15:18:52 +00:00
Fabrice Le Fessant 808d083b9f Revert commit r12756 containing unwanted changes
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12757 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-07-22 15:15:55 +00:00
Fabrice Le Fessant 5e74e6f0cc Fix PR#5695
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12756 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-07-22 15:12:43 +00:00
Fabrice Le Fessant f0eff81679 Merge commit 12664 from 4.00 on trunk/
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12665 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-07-09 08:46:10 +00:00
Xavier Leroy 28c206ad37 PR#5643: issues with .cfi and .loc directives generated by ocamlopt -g
(Picking commit 12610 from version/4.00)


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12611 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-06-17 08:17:43 +00:00
Benedikt Meurer deb410085d [arm] Handle backward jumps properly with TBH (PR#5623).
The Thumb-2 TBH instruction supports only forward jumps, which is what is
usually generated for Lswitch. But in some rare cases, the compiler can
generate backward jumps for Lswitch. To properly support these cases, we
emit appropriate trampolines (following the TBH) for these backward jumps
as necessary.



git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12548 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-06-02 18:01:06 +00:00
Alain Frisch db72170ff3 Remove useless opens.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12545 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-06-01 14:34:56 +00:00
Alain Frisch a1f1558227 Remove useless open.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12544 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-06-01 14:33:06 +00:00
Alain Frisch f13111226a Remove useless open.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12543 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-06-01 14:32:15 +00:00
Alain Frisch 4ae32488d8 Fix unused open warning.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12502 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-05-29 12:32:54 +00:00
Alain Frisch a0a14c08fa Enable and fix more warnings.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12498 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-05-29 11:47:28 +00:00
Benedikt Meurer 40e1c415b7 [arm] Also emit CFI directives for the ARM backend.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12466 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-05-17 12:43:58 +00:00
Benedikt Meurer d07d559a2c [arm] Emit debug information in the ARM backend.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12465 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-05-17 12:43:21 +00:00
Xavier Leroy ceabedc058 PR#5603: wrong .file directives generated by ocamlopt -g
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12449 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-05-12 09:51:45 +00:00
Fabrice Le Fessant 7b9f2a7ddf Reverting commits 12385 and 12370, while waiting for a decision to be taken to install compiler files for 4.0
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12389 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-04-22 16:11:51 +00:00
Fabrice Le Fessant 4c85d29786 Asmgen hooks: call cmm hooks once on all phrases, instead of for every function
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12385 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-04-19 16:14:06 +00:00
Fabrice Le Fessant 905143bfa2 Add hooks in Asmgen
Add hooks in Asmgen to allow external developers to add
new passes on the typedtree, lambda, clambda and cmm trees.
A library 'ocamlopt.cm{a/xa}' is installed, with optmain.cm{x/o},
so that developers can create new ocamlopt executables containing
these new passes.



git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12370 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-04-18 08:50:26 +00:00
Alain Frisch 3930c2fd79 #5595: Missed constant propagation.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12368 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-04-18 07:12:54 +00:00
Xavier Leroy 5914913c1c PR#4892: non-strict behavior in Array.set
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12238 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-03-14 09:27:13 +00:00
Damien Doligez 6c24f4f90b merge version 3.12 from 3.12.1 to r12205
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12210 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-03-08 19:52:03 +00:00