aboutsummaryrefslogtreecommitdiffstats
path: root/backend/PrintAsmaux.ml
Commit message (Collapse)AuthorAgeFilesLines
* Added options -fcommon and -fno-common (#164)Bernhard Schommer2019-05-101-0/+8
| | | | | | | | | | The option -fcommon controls whether uninitialized global variables are placed in the COMMON section. If the option is given in the negated form, -fno-common, variables are not placed in the COMMON section. They are placed in the same sections as gcc does. If the variables are not placed in the COMMON section merging of tentative definitions is inhibited and multiple definitions lead to a linker error, as it does for gcc.
* Change to AbsInt version string.Bernhard Schommer2019-05-101-1/+1
| | | | | The AbsInt build number no longer contains "release", so it must be printed additionally.
* Expand the responsefiles earlierBernhard Schommer2019-05-101-2/+2
| | | | | | | | | * Move the expansion of response files to module Commandline, during the initialization of `Commandline.argv`. This way we're sure it's done exactly once. * Make `Commandline.argv` a `string array` instead of a `string array ref`. We no longer need to update it after initialization! * Improve reporting of errors during expansion of response files.
* Reactivated and improved ais annotations.Bernhard Schommer2018-03-061-12/+0
| | | | | | | | | | | | | | | | | | The ais annotations are now handled in a separate file shared between all architectures. Also two different variants of replacements are supported, %e which expands to ais expressions and %l which also expands to an ais expression but is guaranted to be usable as l-value in the ais annotation. Otherwise the new warning is Wrong_is_parameter is generated. Also an error message is generated if floating point variables are used in ais annotations since a3 does not support them at the moment. Additionally an error message is generated for plain volatile variables used, since they will enforce a volatile load and result in the value being passed to the annotation instead of the address as other global variables.
* Remove no longer used function. Bug 22525Bernhard Schommer2017-11-101-1/+0
|
* Removed no longer used function. Bug 22525Bernhard Schommer2017-11-091-1/+0
|
* Fix jumptable issue.Bernhard Schommer2017-11-081-2/+5
| | | | | | Instead of using reset_constants use reset_literals which avoids emptying the jumptables. Bug 22525
* Simplifiy handling of constant emmitting.Bernhard Schommer2017-11-081-6/+21
| | | | | | Instead of just storing the constants in a list, they are now stored in a hashtable. This avoids printing of duplicates. Bug 22525
* Remove superfluous function.Bernhard Schommer2017-11-061-1/+0
| | | | | The new_label function is alway equal to PrintAsmaux.new_label. Bug 22472
* Also quote \a.Bernhard Schommer2017-10-261-0/+2
| | | | | | This allows for an easier replacement of the binary address and avoids that the user specifies his own binary addresses. Bug 22468
* New support for inserting ais-annotations.Bernhard Schommer2017-10-191-0/+10
| | | | | | | | | | | | The ais annotations can be inserted via the new ais variants of the builtin annotation. They mainly differe in that they have an address format specifier '%addr' which will be replaced by the adress in the binary. The implementation simply prints a label for the builtin call alongside a the text of the annotation as comment and inserts the annotation together as acii string in a separate section 'ais_annotations' and replaces the usages of the address format specifiers by the address of the label of the builtin call.
* Print_annot should produce a string.Bernhard Schommer2017-07-191-26/+25
|
* Extend builtin arguments with a pointer addition operatorXavier Leroy2017-07-061-0/+4
| | | | | | This extension enables more addressing modes to be encoded as builtin arguments and used in conjunction with volatile memory accesses. Current status: x86 port only, the only new addressing mode handled is reg + offset.
* Hybrid 64bit/32bit PowerPC portBernhard Schommer2017-05-031-0/+1
| | | | | | | | | | | | | This commit adds code generation for 64bit PowerPC architectures which execute 32bit applications. The main difference to the normal 32bit PowerPC port is that it uses the available 64bit instructions instead of using the runtime library functions. However pointers are still 32bit and the 32bit calling convention is used. In order to use this port the target architecture must be either in Server execution mode or if in Embedded execution mode the high order 32 bits of GPRs must be implemented in 32-bit mode. Furthermore the operating system must preserve the high order 32 bits of GPRs.
* RISC-V port and assorted changesXavier Leroy2017-04-281-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commits adds code generation for the RISC-V architecture, both in 32- and 64-bit modes. The generated code was lightly tested using the simulator and cross-binutils from https://riscv.org/software-tools/ This port required the following additional changes: - Integers: More properties about shrx - SelectOp: now provides smart constructors for mulhs and mulhu - SelectDiv, 32-bit integer division and modulus: implement constant propagation, use the new smart constructors mulhs and mulhu. - Runtime library: if no asm implementation is provided, run the reference C implementation through CompCert. Since CompCert rejects the definitions of names of special functions such as __i64_shl, the reference implementation now uses "i64_" names, e.g. "i64_shl", and a renaming "i64_ -> __i64_" is performed over the generated assembly file, before assembling and building the runtime library. - test/: add SIMU make variable to run tests through a simulator - test/regression/alignas.c: make sure _Alignas and _Alignof are not #define'd by C headers commit da14495c01cf4f66a928c2feff5c53f09bde837f Author: Xavier Leroy <xavier.leroy@inria.fr> Date: Thu Apr 13 17:36:10 2017 +0200 RISC-V port, continued Now working on Asmgen. commit 36f36eb3a5abfbb8805960443d087b6a83e86005 Author: Xavier Leroy <xavier.leroy@inria.fr> Date: Wed Apr 12 17:26:39 2017 +0200 RISC-V port, first steps This port is based on Prashanth Mundkur's experimental RV32 port and brings it up to date with CompCert, and adds 64-bit support (RV64). Work in progress.
* Use 64 bit address in debug information.Bernhard Schommer2016-11-101-0/+1
| | | | | Address constants need to be 64bit also in the debug information. Bug 20335
* Support for 64-bit architectures: generic supportXavier Leroy2016-10-011-0/+3
| | | | | | | | | | | - Introduce Archi.ptr64 parameter. - Define module Ptrofs of integers as wide as a pointer (64 if Archi.ptr64, 32 otherwise). - Use Ptrofs.int as the offset type for Vptr values and anywhere pointer offsets are manipulated. - Modify Val operations that handle pointers (e.g. Val.add, Val.sub, Val.cmpu) so that in 64-bit pointer mode it is the "long" operation (e.g. Val.addl, Val.subl, Val.cmplu) that handles pointers. - Update the memory model accordingly. - Modify C operations that handle pointers (e.g. addition, subtraction, comparisons) accordingly. - Make it possible to turn off the splitting of 64-bit integers into pairs of 32-bit integers. - Update the compiler front-end and back-end accordingly.
* Code cleanup.Bernhard Schommer2016-03-101-1/+0
| | | | | | Removed some unused variables, functions etc. and resolved some problems which occur if all warnings except 3,4,9 and 29 are active. Bug 18394.
* Print cfi_sections only if cfi is supported.Bernhard Schommer2015-12-151-0/+6
| | | | | | On older version of the binutils the cfi directives are not always supported so we only print cfi_sections if the corresponding .ini setting is set to true.
* Updated PR by removing whitespaces. Bug 17450.Bernhard Schommer2015-10-201-7/+7
|
* First try of debug information for gcc.Bernhard Schommer2015-10-021-66/+0
|
* Cleanup of now no longer needed functions.Bernhard Schommer2015-10-011-5/+0
|
* Removed newline in version string and add buildnr and tag if existing toBernhard Schommer2015-09-301-1/+1
| | | | Producer as well as target system.
* Add the version string to the printed asm.Bernhard Schommer2015-09-301-1/+6
|
* Added printing the reference address for the LocRef and started refactoring oldBernhard Schommer2015-09-271-4/+0
| | | | | | | | Debuging code. The old functions to store the symbol for the Global variables and retrive this is no longer needed since the atom is stored in DebugInformation. Also the Debug.Abbrev module is no longer needed.
* Merge branch 'debugscopes' into debug_locationsBernhard Schommer2015-09-231-5/+3
|\ | | | | | | | | Conflicts: cparser/Unblock.ml
| * Continuing experiment: track the scopes of local variables via __builtin_debugXavier Leroy2015-09-211-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | As observed by B. Schommer, it is not enough to track scopes for every source line, as blocks can occur on a single line (think macros). Hence: - Revert debug annotations of kind 1 to contain only line number info. Generate them only when the line number changes. - Use debug annotations of kind 6 to record the list of active scopes (as BA_int integer arguments to __builtin_annot). Generate them before every nontrivial statement, even if on the same line as others. - Remove the generation of "variable x is declared in scope N" debug annotations. This can be tracked separately and more efficiently.
* | Record the scope structure during unblocking.Bernhard Schommer2015-09-221-0/+1
| | | | | | | | | | | | Instead of creating separate annotations for the local variables we call the Debug.add_lvar_scope and we construct a mapping from function id + scope id to scope information.
* | Merge branch 'debugscopes' into debug_locationsBernhard Schommer2015-09-211-0/+5
|\| | | | | | | | | | | Conflicts: debug/CtoDwarf.ml debug/DwarfPrinter.ml
| * Experiment: track the scopes of local variables via __builtin_debug.Xavier Leroy2015-09-201-0/+5
| | | | | | | | | | | | | | | | | | | | | | C2C: the code that insert debug builtins with the line numbers is now in Unblock. Handle calls to __builtin_debug. Unblock: generate __builtin_debug(1) for line numbers, carrying the list of active scopes as extra arguments. Generate __builtin_debug(6) for local variable declarations, carrying the corresponding scope number as extra argument. Constprop: avoid duplicating debug arguments that are constants already. PrintAsmaux: show this extra debug info as comments.
* | First version with computation of dwarf info from debug info.Bernhard Schommer2015-09-171-6/+0
| | | | | | | | | | Introduced a new dwarf generation from the information collected in the DebugInformation and removed the old CtODwarf translation.
* | Revert "Startet implementation of new Debug interface."Bernhard Schommer2015-09-101-0/+71
| | | | | | | | This reverts commit 861292a6c5e58b4f78bef207c717b801b3fc1fed.
* | Startet implementation of new Debug interface.Bernhard Schommer2015-09-061-71/+0
| | | | | | | | | | | | Added a new file debug/Debug.ml which will be the interface between for generating and printing the debuging information. Currently it contains only the code for the line directived.
* | XBernhard Schommer2015-09-061-25/+61
|\| | | | | | | Merge branch 'master' into debug_locations
| * Track the locations of local variables using EF_debug annotations.Xavier Leroy2015-08-231-8/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | SimplLocals: - record locations of stack-allocated variables with annotations (of kind 5) at the beginning of the function; - mark every assignment to non-stack-allocated variables with an annotation of kind 2. Debugvar: (new pass!) - perform availability analysis for debug annotations of kind 2 - insert "start of live range" and "end of live range" annotations (kind 3 and 4) to delimit intervals of PCs where the location of a local variable is known.
| * Renaming {BA,BR}_longofwords -> {BA,BR}_splitlong.Xavier Leroy2015-08-221-13/+18
| | | | | | | | | | | | | | | | Use EF_debug instead of EF_annot for line number annotations. Introduce PrintAsmaux.print_debug_info (very incomplete). powerpc/Asmexpand: revise expand_memcpy_small.
| * Simplify the handling of extended inline asm, taking advantage of the new, ↵Xavier Leroy2015-08-211-5/+24
| | | | | | | | structured builtin arguments and results.
| * Refactoring of builtins and annotations in the back-end.Xavier Leroy2015-08-211-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before, the back-end languages had distinct instructions - Iannot for annotations, taking structured expressions (annot_arg) as arguments, and producing no results' - Ibuiltin for other builtins, using simple pseudoregs/locations/registers as arguments and results. This branch enriches Ibuiltin instructions so that they take structured expressions (builtin_arg and builtin_res) as arguments and results. This way, - Annotations fit the general pattern of builtin functions, so Iannot instructions are removed. - EF_vload_global and EF_vstore_global become useless, as the same optimization can be achieved by EF_vload/vstore taking a structured argument of the "address of global" kind. - Better code can be generated for builtin_memcpy between stack locations, or volatile accesses to stack locations. Finally, this commit also introduces a new kind of external function, EF_debug, which is like EF_annot but produces no observable events. It will be used later to transport debug info through the back-end, without preventing optimizations.
* | Added symbol functions for printing of the location for global variables.Bernhard Schommer2015-08-211-0/+3
|/
* Removed the version from the compcert.ini file and add it again in a ↵Bernhard Schommer2015-07-011-1/+1
| | | | separate file.
* Merged PrintAnnot into PrintAsmaux.Bernhard Schommer2015-05-141-0/+160
|
* Started implementing the printing functions for the debug info. Added a ↵Bernhard Schommer2015-03-161-0/+5
| | | | global target dependend option to activate the printing only for targets wher it works.
* Started integrating the debug printing in the common backend_printer.Bernhard Schommer2015-03-111-0/+3
|
* Removed unused sel_target, changed cygwin symbol names and changed the ↵Bernhard Schommer2015-02-191-0/+1
| | | | default function aligment to be target dependent.
* Added an elf prefix to all common elf functions in PrintAsmaux.Bernhard Schommer2015-02-181-13/+11
|
* Changed print_fun/var_info to be functions instead of booleans.Bernhard Schommer2015-02-181-2/+2
|
* Changed arm backend to the common backend printer.Bernhard Schommer2015-02-091-1/+1
|
* Changed the ia32 backend to the new Printer.Bernhard Schommer2015-02-061-0/+5
|
* Changed the ASM printer of the powerpc to the generalized backend.Bernhard Schommer2015-02-051-2/+4
|
* Moved more common functions into a seperate file.Bernhard Schommer2015-02-041-2/+46
|