Commit Graph

86 Commits (d30af127d806d2dbda32e7af5c774975129349b5)

Author SHA1 Message Date
Xavier Leroy 3ce32fba4f Wrong MASM syntax, try again.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14704 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-29 09:58:51 +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
Xavier Leroy 452390e0ea Follow-up to commit 14673: MASM has its own syntax for hex constants
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14683 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-26 07:11:11 +00:00
Xavier Leroy 2633ff77ce Follow-up to commit 14673: Iconst_float now takes a float, no longer a string.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14675 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-25 14:02:43 +00:00
Xavier Leroy 29b34438e0 - Constant ropagation for float and int32/int64/nativeint arithmetic.
Constant propagation for floats can be turned off with option
  -no-float-const-prop, for codes that change FP rounding modes at
  run-time.
- Clambda / C-- / Mach: represent float constants as FP numbers of type 
  float rather than literals of type string.
- Tested for AMD64; other archs need testing.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14673 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-25 08:41:13 +00:00
Mark Shinwell cceb1c7361 fix regression (extraneous moves) caused by previous Cconst_blockheader patch
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14648 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-21 06:28:16 +00:00
Gabriel Scherer d74aa291d3 on i386 and AMD64, mark 'morally tail' C function calls as non-leaf
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14610 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-16 08:34:21 +00:00
Damien Doligez be92c8e70e fix msvc64 port by removing unused open Misc (untested, esp. on other Windows ports)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14501 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-27 15:06:28 +00:00
Mark Shinwell 583bfd46c2 be explicit when constructing integers that are block headers
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14464 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-17 14:34:00 +00:00
Damien Doligez aa58e55958 port to cygwin-64
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14337 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-12-03 14:43:02 +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
Alain Frisch f16534ef1a Reintegrate raise_variants branch.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14289 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-13 13:55:13 +00:00
Alain Frisch ff18f681bc #6042: fix msvc64 port.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14268 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-05 14:24:37 +00:00
Xavier Leroy e32b161074 Follow-up to commit r14254: update destroyed_at_oper and max_register_pressure
for immediate Idiv and Imod.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14255 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-01 17:05:21 +00:00
Xavier Leroy ab9f3e38fb PR#6042: optimize integer division and modulus when divisor is constant.
So far, implemented only for amd64.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14254 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-01 16:35:54 +00:00
Alain Frisch 804007bfc5 Support for AMD64, Intel syntax (i.e. MVSC 64 port).
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/raise_variants@14234 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-15 14:13:26 +00:00
Alain Frisch 164c307ae3 Support for raise variants in ocamlopt. Only amd64 for now.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/raise_variants@14226 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-14 14:33:27 +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
Damien Doligez 0f6e0a35fb fix broken bswap on MSVC64
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13653 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-05-07 09:36:53 +00:00
Gabriel Scherer 75b8c0184f PR#5933 type-specialize 'let compare = compare' on ints and strings
According to the reporter 'sliquister', type-specialized comparison
can nearly halve compilation time in some cases. This patch applies
type-specialization throughout the OCaml distribution sources, so not
all changes will have performance utility, but in this case I think
it's best to be consistent, as I see no downside to the change.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13410 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-19 07:22:12 +00:00
Damien Doligez c63f9e0957 fix a few problems with whitespace and over-long lines
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13393 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-09 22:38:52 +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 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
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
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
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
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
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
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
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
Xavier Leroy 79eab1a6e2 PR#5513: protect against min_int / -1 crashing on x86
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12187 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-02-24 10:13:02 +00:00
Xavier Leroy 2eecf2d4c0 PR#5487: addition of CFI directives and a few filename/linenumber info to generated amd64 and i386 assembly files.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12179 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-02-21 17:41:02 +00:00
Damien Doligez e7f5b858c2 More renaming to OCaml
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12149 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-02-10 16:15:24 +00:00
Benedikt Meurer 78e2ed88d8 [amd64] Don't override insert_op.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12122 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-02-04 10:00:09 +00:00
Benedikt Meurer fb327a7c2b Also pass Cmm.memory_chunk to select_addressing.
The rational behind this change is that for the ARM instruction sets, the
valid range for address offsets depends on the type of data being loaded
or stored.



git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12120 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-02-04 09:43:33 +00:00
Xavier Leroy ac0aa0778d PR#5179: giant steps towards a Mingw64 port.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11927 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2011-12-21 16:31:01 +00:00
Xavier Leroy ca0c236919 PR#4869: rare collisions between assembly labels for code and data
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11887 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2011-12-18 10:00:56 +00:00
Xavier Leroy e10723e701 Merged proc_nt.ml into proc.ml in directories asmcomp/i386 and asmcomp/amd64.
This avoids much code duplication and is a baby step towards Mingw-64 bits 
support (PR#5179).  (There will be no need to create a third proc_xxx.ml
file for this configuration.)
Also, in amd64/emit_nt.mlp, the ml64 assembler didn't like my label subtractions, so I put the jumptable in code area instead of in data area.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11319 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2011-12-16 17:02:48 +00:00
Xavier Leroy 854afdd4e9 Reverted most of previous change re: local labels in AMD64/MacOSX.
The wretched MacOSX "ld -shared" (under 10.6 at least) balks on
subtracting two local labels, while it deigns subtracting two
nonlocal labels.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11224 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2011-10-15 09:44:07 +00:00
Xavier Leroy fc82a408a3 AMD64/MacOSX code generator: make local asm labels really local. (L100 instead of .L100)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11221 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2011-10-15 08:55:43 +00:00
Xavier Leroy 012bc6eb1d PR#5319: Lswitch compilation for Win64 / MSVC. (Untested.)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11201 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2011-09-18 07:52:55 +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
Damien Doligez c91db736b1 merge changes from 3.12.0 to 3.12.1
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11123 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2011-07-20 09:17:07 +00:00
Xavier Leroy 80384c6d84 PR#5237: incorrect .size directives generated for x86-32 and x86-64
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@10981 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2011-03-13 13:36:00 +00:00