Commit Graph

190 Commits (c3b4e9aa93255ddcc13c68e6c4ca7600ce85642d)

Author SHA1 Message Date
alainfrisch ff0d2345da Hacks so that check_all_arches works even with a 32-bit compiler. 2016-07-11 11:57:08 +02:00
Alain Frisch e3ee2805b7 Merge pull request #645 from mshinwell/delete_cmm_label_stuff
Remove Cdefine_label and Clabel_address
2016-07-10 14:52:07 +02:00
Mark Shinwell 5f00ce793e Improve location handling in the middle end (version for merging) (#666) 2016-07-06 15:42:29 +01:00
Mark Shinwell c843ca0691 Labels after calls, call GC points and checkbound points (again) (#660) 2016-07-06 11:44:00 +01:00
Alain Frisch c3c523109e Revert "Labels after calls, call GC points and checkbound points" 2016-07-01 18:42:51 +02:00
Mark Shinwell 432f87f077 Labels after calls, call GC points and checkbound points (#644) 2016-07-01 15:16:03 +01:00
Mark Shinwell 1d3a6c3038 Rename Cconst_blockheader to Cblockheader (#642) 2016-06-30 07:46:45 +01:00
Mark Shinwell 8e16cdd85d Remove Cdefine_label and Clabel_address 2016-06-29 10:01:03 +01:00
Mark Shinwell ca03b4e500 Decorate more Cmm terms with location information (#627) 2016-06-27 08:49:26 +01:00
Xavier Leroy 5d02ca6f28 In frame tables, distinguish data pointers from code pointers
Since GPR#247 (stack backtraces aware of inlining) was merged, frame tables contain two kinds of addresses of labels: code labels (as before) and data labels (new, pointing to sub-frames).

On ARM in Thumb mode, the two kinds of pointers must be distinguished, because pointers to Thumb code have the low bit set, and the assembler needs to know whether a label denotes code or data to set the low bit or not.

This commit fixes this problem by splitting the "efa_label" action of record Emitaux.emit_frame_actions into two actions, "efa_code_label" and "efa_data_label".  On all ports except ARM, the two actions are identical.  On ARM, the actions add the appropriate ".type" declaration.

Tested on ARM-32 and x86-64 only.  CI will test the other platforms.
2016-06-27 09:14:54 +02: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
Damien Doligez ee8f71101b clean up whitespace and cut long lines 2016-02-17 13:36:27 +01:00
Damien Doligez 59a4fd6615 Merge pull request #408 from btj/trunk
Fixes bugs in stack unwinding metadata (PR#7118,7120)
2016-02-12 11:20:02 +01:00
Bart Jacobs 0a914a4765 Generate local jump labels on OS X (PR#7133)
See [PR#7133](http://caml.inria.fr/mantis/view.php?id=7133)
2016-02-10 15:24:37 +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
Mark Shinwell 029e1bbbbc Merge remote-tracking branch 'ocaml/trunk' into flambda_prereq-init_assign 2016-01-12 15:33:54 +01:00
Bart Jacobs 4183ce5225 Add missing .cfi_adjust_cfa_offset before .cfi_endproc
Fixes bug 7120.
2016-01-08 23:58:12 -08:00
Xavier Leroy 098e69aa66 Add notes and pointers to reference documents for each ocamlopt architecture. 2015-12-20 12:48:28 +01:00
Mark Shinwell 933fdb2687 Improved annotations on Psetfield etc 2015-12-18 16:42:40 +00:00
Xavier Leroy 6cd8656249 PR#7024 and GPR#295: CSE confuses +0.0 and -0.0
The fix consists in representing float literals by their bit patterns (int64) in the Mach and Linear intermediate languages.

A regression test was added to the test suite.
2015-11-19 09:25:02 +01: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 09428028b1 More precise typing at the C-- and Mach level.
(Merge of branch cmm-mach-types and PR#115.)

- Register type "Addr" is split into
    . "Val" (well-formed OCaml values, appropriate as GC roots)
    . "Addr" (derived pointers within the heap, must not survive a GC)
- memory_chunk "Word" is split into
    . "Word_val" (OCaml value)
    . "Word_int" (native-sized integer, not a pointer into the heap)

Cmmgen was updated to use Word_val or Word_int as appropriate.

Application #1: fail at compile-time if a derived pointer within the heap
survives a GC point (cf. PR#6484).

Application #2: CSE can do a better job across allocation points
(keep factoring expressions of type Int, Val, Float, but not Addr).

Application #3: slightly fewer roots given to the GC
(e.g. pointers into bigarray data).



git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16269 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-27 09:20:39 +00:00
Xavier Leroy 53231bcdc3 Update to trunk r16267.
A change on trunk in cmmgen was causing problems: the use of array_indexing
in bigarray_indexing was constructing derived pointers of Addr type
instead of the correct Int type.  (Because bigarray inner pointers
are outside the heap, and because they are live across allocations.)
Added an optional argument to array_indexing to specify expected
pointer type, and adapted bigarray_indexing to use it with type Int.


git-svn-id: http://caml.inria.fr/svn/ocaml/branches/cmm-mach-types@16268 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-27 08:18:53 +00:00
Damien Doligez 860c670848 merge branch 4.02 from 4.02.1 (rev 15540) to a few fixes after 4.02.2 (rev 16205)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16214 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-17 14:31:05 +00:00
Alain Frisch a836f8e47b GPR#197: Do not emit [add zsh, %rsp] and [sub zsh, %rsp] (patch from cgaebel).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16175 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-06-17 09:21:36 +00:00
Alain Frisch 654521cbd4 Support far relocations in Win64, using a custom local implementation of something similar to the GOT table. This allows loading .cmxs units far from the main process. Might fix #6594 as well.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15900 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-03-11 16:02:20 +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
Alain Frisch e5c5963a36 Revert previous commits (not ready yet).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15792 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-01-22 16:31:51 +00:00
Alain Frisch e594fd27ad Use __flimp_ prefix understood by flexlink, not __imp_.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15791 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-01-22 16:28:37 +00:00
Alain Frisch 2535da8317 Adapt amd64 backends under windows in order to avoid relative relocations to symbols that could be defined in other images. This is necessary to allow .cmxs to be loaded at arbitrary addresses. 32-bit relative relocations could previously fail if the .cmxs was loaded too far from the main program. Require flexdll 0.34, which has improved support for __imp_X symbols.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15789 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-01-22 13:18:45 +00:00
Alain Frisch 22cb7ff170 Use curried style for X86_dsl. Will adapt 32-bit emit.mlp later.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/abstract_intel_emit@15613 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-11-27 17:20:22 +00:00
Alain Frisch 9decba7731 Rename Intel_* to X86_*.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/abstract_intel_emit@15612 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-11-27 17:12:21 +00:00
Xavier Leroy ac02f56351 More precise typing at the C-- and Mach level:
- Register type "Addr" is split into
    . "Val" (well-formed OCaml values, appropriate as GC roots)
    . "Addr" (derived pointers within the heap, must not survive a GC)
- memory_chunk "Word" is split into
    . "Word_val" (OCaml value)
    . "Word_int" (native-sized integer, not a pointer into the heap)

Cmmgen was updated to use Word_val or Word_int as appropriate.

Application #1: fail at compile-time if a derived pointer within the heap
survives a GC point (cf. PR#6484).

Application #2: CSE can do a better job across allocation points
(keep factoring expressions of type Int, Val, Float, but not Addr).


git-svn-id: http://caml.inria.fr/svn/ocaml/branches/cmm-mach-types@15568 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-11-06 08:54:14 +00:00
Alain Frisch 0af5541604 Fix for MacOSX.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/abstract_intel_emit@15480 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-06 16:18:35 +00:00
Alain Frisch 376ea01574 Fix .section directives for MacOSX.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/abstract_intel_emit@15478 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-06 15:35:01 +00:00
Alain Frisch 7b91064895 Typo.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/abstract_intel_emit@15458 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-03 15:44:54 +00:00
Alain Frisch cf2cdb9fc1 Typos.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/abstract_intel_emit@15447 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-03 12:48:45 +00:00
Alain Frisch 3b6f79b288 Get rid of warning attribute.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/abstract_intel_emit@15402 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-30 15:08:18 +00:00
Alain Frisch cf495ee713 Inline inner DSL module.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/abstract_intel_emit@15401 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-30 15:07:29 +00:00
Alain Frisch 0fd13b09d7 Get rid of End directive (hard-code in masm backend).
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/abstract_intel_emit@15400 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-30 15:03:02 +00:00
Alain Frisch 8e12390dd5 ascii -> bytes
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/abstract_intel_emit@15399 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-30 15:00:52 +00:00
Alain Frisch 493b049c59 llabel -> label
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/abstract_intel_emit@15398 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-30 14:59:56 +00:00
Alain Frisch 44e695fca1 Move directive emitters into a sub-module (64-bit).
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/abstract_intel_emit@15396 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-30 14:54:15 +00:00
Alain Frisch 48ae8d422e Merge DSL32 and DSL64.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/abstract_intel_emit@15394 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-30 14:45:35 +00:00
Alain Frisch 56c045db01 Cleanup.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/abstract_intel_emit@15393 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-30 14:41:41 +00:00
Alain Frisch 15ffda9671 Cleanup.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/abstract_intel_emit@15392 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-30 14:40:09 +00:00
Alain Frisch 180d759cd4 Getting rid of instruction suffixes. Finish, merge INS, INS32, INS64, get rid of duplicates.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/abstract_intel_emit@15391 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-30 14:37:09 +00:00