aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Update for release 3.6v3.6Xavier Leroy2019-09-171-2/+3
|
* Revise the "bench" entries of the test suiteXavier Leroy2019-09-175-12/+110
| | | | | | | | Initially, the "bench" entries of the test suite used a "xtime" utility developed in-house and not publically available. This commit adds a version of "xtime" written in OCaml (tools/xtime.ml) and updates the "bench" entries of the test/*/Makefile to use it.
* Updates in preparation for release 3.6Xavier Leroy2019-09-162-1/+63
|
* -dclight output: use nicer names for temporary variablesXavier Leroy2019-09-161-2/+11
| | | | | | | | | | | | | | | | | | | | | The temporary variables introduced by SimplLocals reuse the same integer identifiers as the local variables they come from. This commit ensures that these variables are printed as "$var", where "var" is the original variable name, instead of "$NNN" as before. The "$NNN" form is retained for temporary variables that do not correspond to a source-level local variable, such as the temporary variables introduced by SimplExpr. This commit should make no difference for "ccomp -dclight", because the Clight that is printed is the Clight version 1 produced by SimplExpr, where every temporary is fresh and does not correspond to a source-level local variable. This commit does change the output of "clightgen -dclight", because the Clight that is printed is the Clight version 2 produced by SimplLocals. The printed Clight is much more legible thanks to the more meaningful temporary variable names.
* clightgen -dclight: print function parameters correctlyXavier Leroy2019-09-163-16/+35
| | | | | | | | | | | | | The Clight output of clightgen is Clight version 2, after SimplLocals conversion, where function parameters are temporary variables, not variables. This commit makes sure the function parameters are printed as temporary variables and not as variables. In passing, it generalizes the Clight pretty-printer so that it can print both Clight version 1 and Clight version 2. Closes: #314
* Reworked json export.Bernhard Schommer2019-09-125-78/+91
| | | | | | | | | | | | | | The json export prints formatted json, which takes a lot of additional time, however the result is only consumed by other tools and not meant for human reading. This commit implements several small changes in order to speedup the json export: * Removal of usage of the Format Module * Replacing `fprintf` calls by calls to function that print directly, such as `output_string`, etc. * Replacing list of all instruction names by a set of all instructions
* Asmgenproof1: useless unfolding in proof scripts causing "omega" to failXavier Leroy2019-09-111-3/+3
| | | | "omega" fails in Coq 8.7, but not in 8.8 and later.
* Merge pull request #313 from AbsInt/aarch64Xavier Leroy2019-09-1163-167/+15898
|\ | | | | | | Support target architecture AArch64 (ARMv8 in 64-bit mode)
| * AArch64: wrong expected type for arguments of Cmaskl{zero,notzero}xavier.leroy2019-08-312-4/+4
| | | | | | | | | | | | | | | | The argument is of type Tlong, not Tint. This caused spurious errors in RTLtyping. Also: in AArch64/PrintOp.ml, print Cmaskl{zero,notzero} with "&l" to distinguish them from Cmask{zero,notzero}.
| * Offset out of range for ldp/stp instructionsxavier.leroy2019-08-231-1/+3
| | | | | | | | These instructions are generated by __builtin_memcpy.
| * Fix compile for architectures other than AArch64 (#192)Bernhard Schommer2019-08-176-16/+16
| | | | | | Some changes were not correctly propagated to all architectures.
| * Test for the compilation of floating-point literalsXavier Leroy2019-08-083-1/+562
| | | | | | | | With special emphasis on the use of the AArch64 fmov #imm instruction.
| * AArch64 portXavier Leroy2019-08-0848-87/+14874
| | | | | | | | | | This commit adds a back-end for the AArch64 architecture, namely ARMv8 in 64-bit mode.
| * Relax lemma Val.zero_ext_and and add Val.zero_ext_andlXavier Leroy2019-08-071-2/+10
| |
| * Factor out endianness determination between testsXavier Leroy2019-08-074-30/+14
| |
| * ndfun: add support for guards on patternsXavier Leroy2019-08-071-5/+16
| | | | | | | | | | | | Syntax is "pat ?? bexpr => action". The whole case is selected only when "pat" matches and then "bexpr" evaluates to "true".
| * More lemmas about powers of 2Xavier Leroy2019-08-071-0/+14
| |
| * Errors: fixed a loop in tactic MonadInvXavier Leroy2019-08-071-1/+1
| |
| * Asmgenproof0: add predicate exec_straight0Xavier Leroy2019-08-071-0/+26
| | | | | | | | | | | | | | | | | | | | This is a variant of exec_straight where it is allowed to take zero steps. In other words, exec_straight0 is the "star" relation, while exec_straight is the "plus" relation. In the end we need "plus" relations in simulation diagrams, to show the absence of stuttering. But the "star" relation exec_straight0 is useful to reason about code fragments that are always preceded or followed by at least one instruction.
| * Values: add functions for zero- and sign-extension of 64-bit integersXavier Leroy2019-08-071-0/+12
| |
| * Added Int.same_if_eqXavier Leroy2019-08-071-0/+5
| | | | | | | | Should simplify reasoning over Boolean equalities.
| * Properties of combinations of shifts and zero-/sign-extensionXavier Leroy2019-08-071-0/+249
| |
| * Define integer sign extension for zero bitsXavier Leroy2019-08-072-42/+57
| | | | | | | | Just ensure sign_ext 0 x = zero. This simplifies some statements and proofs.
| * Zbits.v: add bit extraction and bit insertionXavier Leroy2019-08-071-0/+57
| |
| * x86: wrong expansion of __builtin_fmadd et alXavier Leroy2019-08-071-13/+19
| | | | | | | | | | | | | | | | | | | | | | | | There was a misunderstanding on the asm syntax for 3-operand instructions such as vfmadd132: when the Intel manual reads vfmadd132 res, arg2, arg3 the corresponding GNU asm syntax is vfmadd132 arg3, arg2, res but not vfmadd132 arg2, arg3, res Closes: #188
| * Add support for Coq 8.10Xavier Leroy2019-08-071-2/+2
| |
| * Coq 8.10 compatibility: (temporarily) silence new warningXavier Leroy2019-08-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The "undeclared-scope" warning fires when we use a "notation" scope before having declared it. This is a good thing, except that the "Declare Scope" vernacular that declares a scope was introduced in Coq 8.10 and is not available in earlier versions. Hence there is no way to avoid triggering the warning yet remain compatible with pre-8.10 Coq versions. This commit silences the warning. It will have to revisited when Coq 8.10 is the oldest version of Coq we support in CompCert.
| * Coq 8.10 compatibility: tweak Argument commandXavier Leroy2019-08-071-1/+1
| |
| * Coq 8.10 compatibility: make explicit the "core" hint databaseXavier Leroy2019-08-078-23/+22
| | | | | | | | | | "Hint Resolve foo." becomes "Hint Resolve foo : core", or "Local Hint Resolve foo : core".
| * Simplify invocation of Emacs + Proof GeneralXavier Leroy2019-08-071-17/+3
| | | | | | | | PG now uses the _Coqproject file and finds relevant paths there.
* | Compatibility for OCaml 4.08.1Bernhard Schommer2019-09-052-5/+5
| |
* | Update man page.Bernhard Schommer2019-09-021-1/+1
| | | | | | | | Unused-variables is disabled by default.
* | Allow Long as const result for ppc64 variant.Bernhard Schommer2019-08-132-0/+3
| | | | | | | | Since the ppc64 has 64 bit registers it is okay to have a 64 bit constant result.
* | bswap builtins: give semantics to them, support bswap64 on all targetsBernhard Schommer2019-08-126-7/+51
| | | | | | | | | | | | | | | | | | | | | | | | * Added semantic for byte swap builtins The `__builtin_bswap`, `__builtin_bswap16`, `__builtin_bswap32`, `__builtin_bswap64` builtin function are now standard builtin functions with a defined semantics. The semantics is given in terms of the decode/encode functions used for the memory model. * Added bswap64 expansion to PowerPC 32 bits. * Added bswap64 expansion for ARM.
* | x86: wrong expansion of __builtin_fmadd et alXavier Leroy2019-08-061-13/+19
| | | | | | | | | | | | | | | | | | | | | | | | There was a misunderstanding on the asm syntax for 3-operand instructions such as vfmadd132: when the Intel manual reads vfmadd132 res, arg2, arg3 the corresponding GNU asm syntax is vfmadd132 arg3, arg2, res but not vfmadd132 arg2, arg3, res Closes: #188
* | Add support for Coq 8.10Xavier Leroy2019-08-051-2/+2
| |
* | Coq 8.10 compatibility: (temporarily) silence new warningXavier Leroy2019-08-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The "undeclared-scope" warning fires when we use a "notation" scope before having declared it. This is a good thing, except that the "Declare Scope" vernacular that declares a scope was introduced in Coq 8.10 and is not available in earlier versions. Hence there is no way to avoid triggering the warning yet remain compatible with pre-8.10 Coq versions. This commit silences the warning. It will have to revisited when Coq 8.10 is the oldest version of Coq we support in CompCert.
* | Coq 8.10 compatibility: tweak Argument commandXavier Leroy2019-08-051-1/+1
| |
* | Coq 8.10 compatibility: make explicit the "core" hint databaseXavier Leroy2019-08-058-23/+22
| | | | | | | | | | "Hint Resolve foo." becomes "Hint Resolve foo : core", or "Local Hint Resolve foo : core".
* | Simplify invocation of Emacs + Proof GeneralXavier Leroy2019-08-051-17/+3
|/ | | | PG now uses the _Coqproject file and finds relevant paths there.
* Another way to derive floatofintu from floatofintXavier Leroy2019-07-171-0/+41
| | | | | It supports a branch-free implementation of floatofintu. Not used yet in any of the ports.
* x86_64: branchless implementation of floatofintu and intuoffloatXavier Leroy2019-07-172-14/+29
| | | | | | | The implementation uses float <-> signed 64-bit integer conversion instructions, and is both efficient and branchless. Based on a suggestion by RĂ©mi Hutin.
* When testing builtin functions, prevent constant propagationXavier Leroy2019-07-174-28/+31
| | | | | | | | | | Now that some builtin functions have known semantics, constant propagation can happen in this test. This defeats the purpose, which is to check that the correct processor instructions are generated. To prevent this constant propagation, we move the initialized variables to global scope. Since they are not "const", their values are not known to the optimizer.
* Make __builtin_sel available from C source codeXavier Leroy2019-07-177-32/+195
| | | | | It is type-checked like a conditional expression then translated to a call to the known builtin function.
* Improve CSE for known built-in functionsXavier Leroy2019-07-172-7/+14
| | | | Known built-in functions are guaranteed not to change memory.
* Perform constant propagation for known built-in functionsXavier Leroy2019-07-174-16/+168
| | | | | | | When an external function is a known built-in function and it is applied to compile-time integer or FP constants, we can use the known semantics of the builtin to compute the result at compile-time.
* Give formal semantics to some built-in functions and run-time functionsXavier Leroy2019-07-1720-187/+1154
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds mechanisms to - recognize certain built-in and run-time functions by name and signature; - associate semantics to these functions, as a partial function from list of values to values; - interpret external calls to these functions according to this semantics (pure function from values to values, memory unchanged, no observable events in the trace); - external calls to unknown built-in and run-time functions remain interpreted as generating observable events and possibly changing memory, like before. The description of the built-ins is split into a target-independent part (in common/Builtins0.v) and a target-specific part (in $ARCH/Builtins1.v). Instruction selection uses the new mechanism in order to - recognize some built-in functions and turn them into operations of the target processor. Currently, this is done for __builtin_sel and __builtin_fabs; more to come. - remove the axioms about int64 helper functions from the standard library. More precisely, the behavior of these functions is still axiomatized, but now it is specified using the more general machinery introduced in this commit, rather than ad-hoc axioms in backend/SplitLongproof. The only built-ins currently described are __builtin_fsqrt (for all platforms) and __builtin_fmin / __builtin_fmax (for x86). More built-ins will be added later.
* Remove the cparser/Builtins moduleXavier Leroy2019-07-1719-104/+82
| | | | | | | | | Move its definitions to modules C (the type `builtins`) and Env (the operations that deal with the initial environment). Reasons for the refactoring: 1- The name "Builtins" will soon be reused for a Coq module 2- `Env.initial()` makes more sense than `Builtins.environment()`.
* Add floating-point square root and fused multiply-addXavier Leroy2019-07-176-3/+76
| | | | | | | | We just lift the corresponding functions from Flocq and add the computation of NaN payloads. NaN payloads for FMA are described in the ARM and RISC-V specifications, and were determined experimentally for x86 and for Power.
* Add FMA (fused multiply-add)Xavier Leroy2019-07-171-0/+121
| | | | | Cherry-pick of the following commit on upstream Flocq: https://gitlab.inria.fr/flocq/flocq/commit/28cc6ee3a278878f3df002aab64a6b93e9412d34