summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2013-11-19caml_backtrace_pos is a 32-bit integer under amd64.Alain Frisch
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14307 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-19Fix PR#6241Jacques Garrigue
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14305 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-19Add proper casts.Alain Frisch
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14304 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-19Perform constant optimizations for integer division and modulus on the C-- ↵Benedikt Meurer
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-18new version of the patch, using module_type option, and allowing unpacking ↵Jacques Garrigue
when no type created git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14302 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-18Fix PR#6240Jacques Garrigue
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/module-alias@14301 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-18Fix PR#6240Jacques Garrigue
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14299 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-16fix computation of positionJacques Garrigue
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/module-alias@14296 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-15also generate module aliases when using includeJacques Garrigue
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/module-alias@14295 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-15Missing include (==> implicit declaration of function 'caml_named_value').Alain Frisch
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14294 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-14Revert "Don't use emit_parts_list for regular operations."Benedikt Meurer
This reverts commit r14292. git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14293 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-14Don't use emit_parts_list for regular operations.Benedikt Meurer
Using emit_parts_list does not make sense for any operation except Ialloc, where we can delay the computation of simple expression until the allocation is done. So we try to avoid using emit_parts_list for regular operations, where the special treatment of non simple expression conflicts with our special instruction selection on arm (and arm64). For example we cannot merge the add and shift operation required for tagging as soon as there is at least one non simple expression involved, even though both Cadd and Clsl do not care at all whether its arguments are simple or not. git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14292 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-13Changelog.Alain Frisch
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14291 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-13Reintegrate raise_variants branch.Alain Frisch
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14289 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-13No need for caml_init_exceptions.Alain Frisch
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/raise_variants@14288 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-13Cleanup.Alain Frisch
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/raise_variants@14287 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-13update for trunkJacques Garrigue
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14286 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-13Fix PR#6235 + keep typing of pattern cases independent in principal modeJacques Garrigue
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14285 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-11[arm] Improve code selection for shifted arithmetic operations.Benedikt Meurer
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14283 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-11expand module aliases and type identifiers in "module type of"Jacques Garrigue
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/module-alias@14282 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-11use new scrape_alias for Env tooJacques Garrigue
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/module-alias@14281 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-11forgot test...Jacques Garrigue
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/module-alias@14280 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-11use a strengthening version of scrape_alias in TypemodJacques Garrigue
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/module-alias@14279 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-10build: make CAMLOPT_BIN default to "no-opt-compiler-available".Wojciech Meyer
(Patch by Adrien Nader!) Jacques Garrigue has reported that the testsuite would try to run with a non-existing opt compiler and that the error wasn't clear. Now, instead of trying to run: -c -I some_dir/ foo.ml anything that tries to run ocamlopt before it's available will run: no-opt-compiler-available -c -I some_dir/ foo.ml which should hopefully be clearer. I'm not yet sure why the testsuite didn't abort earlier, noticing that there was no opt compiler. One possibility is that using "test -e" without argument (which happens if variables are empty and not quoted inside shell scripts) succeeds. This will have to be checked. v2: don't remove the bytecode entry (bad copy-paste) build: make CAMLOPT_BIN default to "no-opt-compiler-available". git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14278 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-10build: always build lex/ and ocamlc with the compiler from boot/.Wojciech Meyer
(Patch by Adrien Nader!) This is a partial revert of revision 14168 which caused issues when bootstrapping the compiler. Since these directories don't take long to build, we can always use a byte-compiled compiler. Bootstrapping and more generally working on the compiler itself does not play nice with trying to use the most recent compiler as soon as possible: imagine you've just modified the compiler but in a way that breaks it at runtime in a non-obvious way; all the files that are subsequently built will have been built with your the compiler you will be debugging. v2: always build tools/ with boot/ocamlc since most executables link against compiler libs. git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14277 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-10myocamlbuild.ml: only build with .opt compilers if they're more recent.Wojciech Meyer
(Patch by Adrien Nader!) The recent change that replaced ocamlcomp*.sh made apparent an old bug where ocamlbuild could use ocamlc.opt even though ocamlc was newer. As far as I understand, Unix is not usable in this file because it can be used for bootstrap. Instead, shell out "test ocamlc.opt -nt ocamlc" in order to check which one to use. This has also made me notice another issue in this file: it was checking that "stdlib.cm*xa*" existed when building with the *byte* compiler. Note that shelling out may have a fairly high build-time cost on Windows. We'll see with the Jenkins results. myocamlbuild.ml: only build with .opt compilers if they're more recent. git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14276 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-08Simplify special logic for array bound error (allocate the exception value ↵Alain Frisch
from Pervasives). git-svn-id: http://caml.inria.fr/svn/ocaml/branches/raise_variants@14275 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-08Fix typos and wording (#6231).Alain Frisch
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14274 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-08PR#6227 continued: problem with preferences between different register classes.Xavier Leroy
(Cherry-picking commit r14272 from 4.01 bugfix branch.) git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14273 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-07Remove use of deprecated features (#6227, patch by johnwhitington).Alain Frisch
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14271 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-06Do not introduce Obj.raw_tag.Alain Frisch
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/raise_variants@14270 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-05#6042: fix msvc64 port.Alain Frisch
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14268 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-05bound checking bug with caml_string_{get,set}{16,32,64}: fix the runtime C codeGabriel Scherer
As notified by Nicolas Trangez, the following program behaves in an unexpected way by returning 0 instead of failing with an out-of-bound exception: external get16 : string -> int -> int = "%caml_string_get16" let test = get16 "" 0 caml_string_get16(str, idx) will access indices (idx) and (idx+1). The bound-checking code is currently implemented as: if (idx < 0 || idx >= caml_string_length(str) - 1) caml_array_bound_error(); This is wrong as caml_string_length returns an mlsize_t which is unsigned, so substracting 1 gets buggy when the size is 0. The test should be written as follow: if (idx < 0 || idx + 1 >= caml_string_length(str)) caml_array_bound_error(); Note 1: we can exploit this bug to make out-of-bound access to a string, but I think get16 examples will run into the padding characters of OCaml strings and behave in a not-too-wrong way. It may also be the case of get32, but get64 will access 7 bytes, so access memory outside the string: # external set64: string -> int -> int -> unit = "%caml_string_get64";; external set64 : string -> int -> int -> unit = "%caml_string_get64" # set64 "" 0 0;; Segmentation fault Note 2: this first commit only fixes the C code in byterun/str.c. Only ocamlc actually uses these functions when the compiler primitive is used ("%caml_string_get16" instead of "caml_string_get16"). ocamlopt generates ocaml code directly, and this part has yet to be fixed in a following commit. git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14267 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-04Improve code generation for subtraction.Benedikt Meurer
Given integer constants x and n: 1. If n + x does not overflow, then (x - c) + n is compiled to (x + n) - c. 2. If n - x does not overflow, then (c - x) + n is compiled to c + (n - x). git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14266 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-04[arm] Fix bug in div/mod by constant.Benedikt Meurer
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14265 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-04Further refactor code generation for multiplication.Benedikt Meurer
Recognize negation by multiplication with -1 and generate subtraction in this case. git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14264 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-04Typo.Alain Frisch
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/raise_variants@14263 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-04#6042: fix Intel syntax.Alain Frisch
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14262 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-04PR#6222: The mls instruction is not available on ARMv6.Benedikt Meurer
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14261 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-02[arm] r12 is destroyed for constants that are not a power of 2.Benedikt Meurer
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14260 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-02[arm] Optimize integer division and modulus by constant.Benedikt Meurer
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14259 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-02Compile multiplication by power of 2 constant to left shift.Benedikt Meurer
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14258 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-01Follow-up to commit r14254: optimization of immediate division and modulus ↵Xavier Leroy
for ARM64. Completely untested. git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14257 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-01Follow-up to commit r14254: optimization of division and modulus by ↵Xavier Leroy
constants for the I386. Untested; CI will find out. git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14256 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-01Follow-up to commit r14254: update destroyed_at_oper and max_register_pressureXavier Leroy
for immediate Idiv and Imod. git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14255 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-01PR#6042: optimize integer division and modulus when divisor is constant.Xavier Leroy
So far, implemented only for amd64. git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14254 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-30PR#6216: inlining of GADT matches generates invalid assemblyXavier Leroy
(reflecting commit r14251 on version/4.01). git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14252 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-30Add test for PR#6216. Not fixed yet.Jacques Garrigue
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14250 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-28Fix PR#6174 (-rectypes case)Jacques Garrigue
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14248 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-28Fix PR#6174 (non -rectypes)Jacques Garrigue
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14246 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02