libfirm
12 years agogen_docu: fix missing attributes, show generation time at the end
Matthias Braun [Fri, 11 Nov 2011 11:49:20 +0000 (12:49 +0100)]
gen_docu: fix missing attributes, show generation time at the end

12 years agoa first attempt at a node-documentation tool
Matthias Braun [Thu, 10 Nov 2011 17:40:35 +0000 (18:40 +0100)]
a first attempt at a node-documentation tool

12 years agobe: rework isa_if interface and initialisation
Matthias Braun [Thu, 10 Nov 2011 15:06:58 +0000 (16:06 +0100)]
be: rework isa_if interface and initialisation

This should fix problems with uninitialized backends when
be_get_backend_param() wasn't called also calls be_lower_for_target if
the user hasn't done so yet.

12 years agoremove be_opt_register from public API (ir_init calls it anyway)
Matthias Braun [Thu, 10 Nov 2011 13:56:22 +0000 (14:56 +0100)]
remove be_opt_register from public API (ir_init calls it anyway)

12 years agobe: get rid of arch_irn_classify callback
Matthias Braun [Thu, 10 Nov 2011 12:57:33 +0000 (13:57 +0100)]
be: get rid of arch_irn_classify callback

12 years agoremove unused op_machine, op_machine_op stuff
Matthias Braun [Thu, 10 Nov 2011 12:45:21 +0000 (13:45 +0100)]
remove unused op_machine, op_machine_op stuff

12 years agobe: remove remnants of machine description
Matthias Braun [Thu, 10 Nov 2011 12:35:54 +0000 (13:35 +0100)]
be: remove remnants of machine description

12 years agobe: remove more unnecessary callbacks
Matthias Braun [Thu, 10 Nov 2011 12:07:28 +0000 (13:07 +0100)]
be: remove more unnecessary callbacks

get_backend_irg_list - none of our backends uses it and in the future
                       the backend should drive the compilation and not
                       give hints to a generic driver
reg_class_alignment  - unused

12 years agobe: remove unused reg_class_for_mode callback
Matthias Braun [Thu, 10 Nov 2011 11:50:16 +0000 (12:50 +0100)]
be: remove unused reg_class_for_mode callback

12 years agoremove $Id$, it doesn't work with git anyway
Matthias Braun [Thu, 10 Nov 2011 13:16:58 +0000 (14:16 +0100)]
remove $Id$, it doesn't work with git anyway

12 years agoPrevent computations with tarval_bad.
Sebastian Buchwald [Thu, 10 Nov 2011 09:50:36 +0000 (10:50 +0100)]
Prevent computations with tarval_bad.

This fixes opt/fehler206.c.

12 years agobepeephole: reachability check in can_move_before
Matthias Braun [Wed, 9 Nov 2011 18:22:09 +0000 (19:22 +0100)]
bepeephole: reachability check in can_move_before

before we only tested, if we produce an output that is used as as input
of any schedule node in between. This missed the case where you have
unscheduled utility nodes like Sync in between.

12 years agoheights: use fast access functions for _reachable
Matthias Braun [Wed, 9 Nov 2011 18:21:28 +0000 (19:21 +0100)]
heights: use fast access functions for _reachable

12 years agoirloop: remove get_loop_son, get_loop_node
Matthias Braun [Tue, 8 Nov 2011 12:39:01 +0000 (13:39 +0100)]
irloop: remove get_loop_son, get_loop_node

The interface was really inefficient and shouldn't be used like that.
So simply don't provide functions that make inefficient code convenient.

12 years agoiropt: Don't try to optimize Mux D.
Andreas Seltenreich [Wed, 9 Nov 2011 16:16:34 +0000 (17:16 +0100)]
iropt: Don't try to optimize Mux D.

12 years agoFix setoutfile/irgname debugger commands.
Andreas Seltenreich [Tue, 8 Nov 2011 22:31:15 +0000 (23:31 +0100)]
Fix setoutfile/irgname debugger commands.

12 years agoRemove warning
Andreas Zwinkau [Mon, 7 Nov 2011 13:53:11 +0000 (14:53 +0100)]
Remove warning

12 years agoAdd missing external function implementations
Andreas Zwinkau [Mon, 7 Nov 2011 13:49:34 +0000 (14:49 +0100)]
Add missing external function implementations

12 years agoiropt: return after making a new node
Matthias Braun [Mon, 7 Nov 2011 12:52:43 +0000 (13:52 +0100)]
iropt: return after making a new node

12 years agoiropt: make sure we reach the fixpoint
Matthias Braun [Mon, 7 Nov 2011 12:27:15 +0000 (13:27 +0100)]
iropt: make sure we reach the fixpoint

We missed the case where transform_node created a node that
computed_value or equivalent_node would catch

12 years agoonly add new X nodes as tuple preds if CopyB throws an exception
Matthias Braun [Mon, 7 Nov 2011 12:24:49 +0000 (13:24 +0100)]
only add new X nodes as tuple preds if CopyB throws an exception

12 years agofix arch_dep for mul(x,0)
Matthias Braun [Mon, 7 Nov 2011 11:38:05 +0000 (12:38 +0100)]
fix arch_dep for mul(x,0)

12 years agodisallow Conv Is(xx b)
Matthias Braun [Fri, 4 Nov 2011 23:10:55 +0000 (00:10 +0100)]
disallow Conv Is(xx b)

It was a strange feature only inspired by the lazyness of some frontend
developer (=me)

12 years agoSet optimisations moved to transform_node_Mux
Matthias Braun [Sat, 5 Nov 2011 11:13:00 +0000 (12:13 +0100)]
Set optimisations moved to transform_node_Mux

they were in lower_mode_b but just generically apply to all Mux(c, 0, 1)

12 years agoiropt: optimize Cmp(Mux(c, c0, c1), c2)
Matthias Braun [Fri, 4 Nov 2011 21:51:11 +0000 (22:51 +0100)]
iropt: optimize Cmp(Mux(c, c0, c1), c2)

12 years agotarval: allow or/eor/and/andnot on references
Matthias Braun [Fri, 4 Nov 2011 21:42:16 +0000 (22:42 +0100)]
tarval: allow or/eor/and/andnot on references

12 years agolocalopt: x + signbit => x ^ signbit
Matthias Braun [Thu, 3 Nov 2011 22:57:32 +0000 (23:57 +0100)]
localopt: x + signbit => x ^ signbit

12 years agoia32: split peephole opts into 2 passes
Matthias Braun [Fri, 4 Nov 2011 17:41:43 +0000 (18:41 +0100)]
ia32: split peephole opts into 2 passes

Some peephole optimisations enable others, so splitting into multiple
passes makes sense.

12 years agoia32: improve Test peephole optimisation
Matthias Braun [Fri, 4 Nov 2011 17:26:02 +0000 (18:26 +0100)]
ia32: improve Test peephole optimisation

A test can exactly be removed if we are only interested in the sign and
zero flag. Rewrote and refactored code.
Now we don't miss some cases anymore where only sign was requested.

12 years agoia32: sign flag is enough if no overflow
Matthias Braun [Fri, 4 Nov 2011 17:25:20 +0000 (18:25 +0100)]
ia32: sign flag is enough if no overflow

12 years agolocalopt: simple associativity optimisation
Matthias Braun [Fri, 4 Nov 2011 15:22:18 +0000 (16:22 +0100)]
localopt: simple associativity optimisation

Add op(op(x, c0), c1) => op(x, op(c0, c1)) as localopt rule. This is an
very usual and often encountered case so it makes sense to have this
working without explicitely invoking the associativity optimisation phase.

12 years agoiropt: cmp(~x & 1, 0) => !cmp(x & 1, 0)
Matthias Braun [Fri, 4 Nov 2011 14:38:34 +0000 (15:38 +0100)]
iropt: cmp(~x & 1, 0) => !cmp(x & 1, 0)

when bits are flipped for a bittest we can just as well negate the pnc
and don't flip the bits

12 years agoWrap optimize_graph_df in opt_manage framework
Andreas Zwinkau [Fri, 4 Nov 2011 12:58:09 +0000 (13:58 +0100)]
Wrap optimize_graph_df in opt_manage framework

12 years agocfopt can skip jump blocks now
Andreas Zwinkau [Fri, 4 Nov 2011 12:44:34 +0000 (13:44 +0100)]
cfopt can skip jump blocks now

The preconditions were too tight

12 years agoia32: improve AM-matching for x87-fpu nodes
Matthias Braun [Fri, 4 Nov 2011 12:47:19 +0000 (13:47 +0100)]
ia32: improve AM-matching for x87-fpu nodes

12 years agolower_switch: fix bug in normalisation
Matthias Braun [Thu, 3 Nov 2011 17:43:49 +0000 (18:43 +0100)]
lower_switch: fix bug in normalisation

12 years agoirverify: switch entry modes must match selector
Matthias Braun [Thu, 3 Nov 2011 17:19:10 +0000 (18:19 +0100)]
irverify: switch entry modes must match selector

12 years agosparc: Pass correct argument to lower_alloc.
Manuel Mohr [Thu, 3 Nov 2011 16:54:22 +0000 (17:54 +0100)]
sparc: Pass correct argument to lower_alloc.

12 years agoupdate jinja2 to avoid some annoying warnings
Matthias Braun [Thu, 3 Nov 2011 10:13:41 +0000 (11:13 +0100)]
update jinja2 to avoid some annoying warnings

12 years agoirmode: set some default values for (un)signed_eq of mode_P
Matthias Braun [Thu, 3 Nov 2011 10:13:15 +0000 (11:13 +0100)]
irmode: set some default values for (un)signed_eq of mode_P

12 years agointroduce Switch node
Matthias Braun [Wed, 2 Nov 2011 17:57:20 +0000 (18:57 +0100)]
introduce Switch node

This is the new way of handling switch-jumps. The node contains a table
which maps (ranges of) input values to proj numbers. Compared to a
Cond-node this results in a clean consecutive sequence of Proj numbers
(no searching for a free number for the default_pn anymore) and allows
factoring multiple cases jumping to the same block in a single Proj
(though we still need the optimisation in cfopt for that).

12 years agocritical_edges: set NO_CRITICAL_EDGES graph flag
Matthias Braun [Wed, 2 Nov 2011 15:28:22 +0000 (16:28 +0100)]
critical_edges: set NO_CRITICAL_EDGES graph flag

12 years agogenerate irdump proj-number lookup tables
Matthias Braun [Mon, 31 Oct 2011 13:25:37 +0000 (14:25 +0100)]
generate irdump proj-number lookup tables

12 years agoavoid _ prefix in identifiers, correct coding style
Matthias Braun [Mon, 31 Oct 2011 12:08:13 +0000 (13:08 +0100)]
avoid _ prefix in identifiers, correct coding style

They are reserved in ANSI-C so instead of _XXX we use XXX_ now.

12 years agotv: fix float->int conversion problems
Matthias Braun [Wed, 2 Nov 2011 18:47:47 +0000 (19:47 +0100)]
tv: fix float->int conversion problems

(they were introduced when moving value_classes out of the descriptor)

12 years agocleanup return.c a bit
Matthias Braun [Thu, 27 Oct 2011 12:22:07 +0000 (14:22 +0200)]
cleanup return.c a bit

12 years agoavoid special case of a node input being NULL
Matthias Braun [Wed, 26 Oct 2011 13:16:07 +0000 (15:16 +0200)]
avoid special case of a node input being NULL

12 years agofix missing PTR_TO_INT macros in release mode
Matthias Braun [Wed, 26 Oct 2011 12:18:11 +0000 (14:18 +0200)]
fix missing PTR_TO_INT macros in release mode

12 years agobe: let begnuas call be_dbg_method_begin/end
Matthias Braun [Wed, 26 Oct 2011 11:50:35 +0000 (13:50 +0200)]
be: let begnuas call be_dbg_method_begin/end

12 years agoInitial support for dwarf debug info
Matthias Braun [Fri, 21 Oct 2011 07:46:32 +0000 (09:46 +0200)]
Initial support for dwarf debug info

12 years agolet backends decide wether to use begnuas
Matthias Braun [Tue, 25 Oct 2011 15:40:17 +0000 (17:40 +0200)]
let backends decide wether to use begnuas

This also means that dependent modules like bedbgout should be
initialized by begnuas.

12 years agofinalize debug stuff before arch_env_done which frees be_emitter
Matthias Braun [Tue, 25 Oct 2011 15:10:17 +0000 (17:10 +0200)]
finalize debug stuff before arch_env_done which frees be_emitter

12 years agoir_mode: simplify interface, improve float-mode handling
Matthias Braun [Tue, 25 Oct 2011 12:47:25 +0000 (14:47 +0200)]
ir_mode: simplify interface, improve float-mode handling

The main change here is splitting new_ir_mode into new_int_mode,
new_reference_mode and new_float_mode. You can now specify
mantissa+exponent size in new_float_mode. This also changes:

- x86 80bit-FP mode is NOT a ieee754 don't put "ieee754" into functions
  names that can also handle x86 80bit fps
- Move ieee_descriptor_t from tarval module into ir_mode struct
  (and rename to float_descriptor_t)
- Introduce mode_Q which represents binary128 from ieee754
- You can ask float modes for mantissa/exponent sizes now
- Fix endianess when emitting big float values in begnuas
- A bunch of long double fixes in ia32: the mode there has 10bytes
  (80bit) but the variables typically are 12 or 16 byte big
- This fixes some problems of sparc binary128 handling

12 years agoia32: fix float_const_store for modes with 10bytes
Matthias Braun [Tue, 25 Oct 2011 10:45:55 +0000 (12:45 +0200)]
ia32: fix float_const_store for modes with 10bytes

12 years agoheights: fix usage of uninitialized memory
Matthias Braun [Mon, 24 Oct 2011 16:29:55 +0000 (18:29 +0200)]
heights: fix usage of uninitialized memory

12 years agoremove old+nonworking setting of ieee754 immediate precision
Matthias Braun [Mon, 24 Oct 2011 12:21:15 +0000 (14:21 +0200)]
remove old+nonworking setting of ieee754 immediate precision

12 years agoavoid usage of identifiers with _ prefix
Matthias Braun [Mon, 24 Oct 2011 12:17:24 +0000 (14:17 +0200)]
avoid usage of identifiers with _ prefix

12 years agoirmode: remove support for vector mode
Matthias Braun [Mon, 24 Oct 2011 09:12:27 +0000 (11:12 +0200)]
irmode: remove support for vector mode

There were no users and no tarval support anyway.

12 years agomove floatingpoint number state out of ieee_descriptor_t
Matthias Braun [Mon, 24 Oct 2011 09:00:27 +0000 (11:00 +0200)]
move floatingpoint number state out of ieee_descriptor_t

12 years agoremove old+broken ieee754 tests
Matthias Braun [Mon, 24 Oct 2011 08:42:01 +0000 (10:42 +0200)]
remove old+broken ieee754 tests

12 years agoiropt: Or/Eor/Add are sometimes equivalent
Matthias Braun [Fri, 21 Oct 2011 12:40:51 +0000 (14:40 +0200)]
iropt: Or/Eor/Add are sometimes equivalent

If vrp can prove that both operand of an Or/Eor/Add never a bit set in
common then we can match them as each of these opcodes.

12 years agoremove a bunch of comments marking end of blocks
Matthias Braun [Fri, 21 Oct 2011 10:51:31 +0000 (12:51 +0200)]
remove a bunch of comments marking end of blocks

They're adding more noise than they provide gain in readability. They
also make extra work to keep up to date.

12 years agoLet normalize_n_returns cope with Bads
Andreas Zwinkau [Thu, 27 Oct 2011 10:56:30 +0000 (12:56 +0200)]
Let normalize_n_returns cope with Bads

Fixes opt/fehler204 again.

12 years agotailrec requires many Returns
Andreas Zwinkau [Thu, 27 Oct 2011 08:21:17 +0000 (10:21 +0200)]
tailrec requires many Returns

Extend opt_manage framework with MANY_RETURNS condition.

Since normalize_n_returns might introduce unreachable code,
the order should be handled in the framework instead of the
optimization.

Fix opt/gap test.

12 years agoDump alert, backspace and vertical tab in string initializers, too.
Christoph Mallon [Thu, 27 Oct 2011 06:36:43 +0000 (08:36 +0200)]
Dump alert, backspace and vertical tab in string initializers, too.

12 years agoDump special characters in string intializers properly, e.g. tab as \t.
Christoph Mallon [Thu, 27 Oct 2011 06:24:16 +0000 (08:24 +0200)]
Dump special characters in string intializers properly, e.g. tab as \t.

Newer yComp (>= 1.3.14) can handle backslashes in strings.

12 years agoFix lower_mode_b aka x86code/fehler136
Andreas Zwinkau [Wed, 26 Oct 2011 14:36:41 +0000 (16:36 +0200)]
Fix lower_mode_b aka x86code/fehler136

12 years agoAdd remove_tuples function
Andreas Zwinkau [Wed, 26 Oct 2011 14:14:15 +0000 (16:14 +0200)]
Add remove_tuples function

12 years agoCompile git revision into libfirm
Andreas Zwinkau [Wed, 26 Oct 2011 13:51:51 +0000 (15:51 +0200)]
Compile git revision into libfirm

12 years agoUse opt_manage framework for tailrec
Andreas Zwinkau [Wed, 26 Oct 2011 08:48:29 +0000 (10:48 +0200)]
Use opt_manage framework for tailrec

Fixes test opt/fehler204

12 years agoDump array initialisers, which contain only bytes in the printable range, as strings...
Christoph Mallon [Mon, 19 Sep 2011 06:30:33 +0000 (08:30 +0200)]
Dump array initialisers, which contain only bytes in the printable range, as strings instead of separate byte initialisers.

Eg.
[0] = 0x62
[1] = 0x6C
[2] = 0x61
[3] = 0x00]
becomes
[0...3] = "bla<NUL>"

TODO: Fix yComp, so it does not choke on backslashes.

12 years agoRemove ia32_l_Setcc and remove set creation callback from ir_lower_mode_b().
Christoph Mallon [Wed, 21 Sep 2011 12:12:42 +0000 (14:12 +0200)]
Remove ia32_l_Setcc and remove set creation callback from ir_lower_mode_b().

It is just an unnecessary node, which the middleend does not understand and therefore cannot optimize.

12 years agosimply use long long
Matthias Braun [Thu, 20 Oct 2011 17:12:53 +0000 (19:12 +0200)]
simply use long long

Most of the world can handle C99 now, and the important rest (=msvc) can
handle long long as an extension.

12 years agoremove unnecessary libcore bits
Matthias Braun [Thu, 20 Oct 2011 17:08:00 +0000 (19:08 +0200)]
remove unnecessary libcore bits

12 years agoremove is_Global/get_GlobalEntity
Matthias Braun [Thu, 20 Oct 2011 16:32:37 +0000 (18:32 +0200)]
remove is_Global/get_GlobalEntity

They have been unnecessary aliases for is_SymConst_addr_ent() and
get_SymConst_entity().

12 years agoconsolidate utility macros in util.h
Matthias Braun [Thu, 20 Oct 2011 16:16:35 +0000 (18:16 +0200)]
consolidate utility macros in util.h

12 years agoirmode: remove support for exotic arithmetics
Matthias Braun [Thu, 20 Oct 2011 16:01:28 +0000 (18:01 +0200)]
irmode: remove support for exotic arithmetics

12 years agotarvals are unique no need to use tarval_cmp for equality checks
Matthias Braun [Thu, 20 Oct 2011 15:57:22 +0000 (17:57 +0200)]
tarvals are unique no need to use tarval_cmp for equality checks

12 years agouse a hook to dump vrp info instead of polluting irdump.c
Matthias Braun [Thu, 20 Oct 2011 14:45:38 +0000 (16:45 +0200)]
use a hook to dump vrp info instead of polluting irdump.c

12 years agoassert that no hook_entry is registered twice
Matthias Braun [Thu, 20 Oct 2011 14:26:30 +0000 (16:26 +0200)]
assert that no hook_entry is registered twice

12 years agorename ir_phase to ir_nodemap and simplify interface
Matthias Braun [Wed, 19 Oct 2011 17:41:18 +0000 (19:41 +0200)]
rename ir_phase to ir_nodemap and simplify interface

The new interface uses no complicated callbacks anymore, but is a simple
ir_node* -> void* nodemap. Adapted all users of ir_phase for this.

12 years agobelive: use sparse hashmap for block->data mapping
Matthias Braun [Wed, 19 Oct 2011 15:13:06 +0000 (17:13 +0200)]
belive: use sparse hashmap for block->data mapping

12 years agocfopt: use a hashmap for sparse block->data mapping
Matthias Braun [Wed, 19 Oct 2011 15:12:18 +0000 (17:12 +0200)]
cfopt: use a hashmap for sparse block->data mapping

12 years agorename irnodemap to irnodehashmap
Matthias Braun [Wed, 19 Oct 2011 11:00:08 +0000 (13:00 +0200)]
rename irnodemap to irnodehashmap

12 years agoiropt: add (a|b) & ~b => a & ~b rule
Matthias Braun [Wed, 19 Oct 2011 09:05:31 +0000 (11:05 +0200)]
iropt: add (a|b) & ~b => a & ~b rule

12 years agoia32: change ShrD/ShlD patterns to match Add instead of Or
Matthias Braun [Wed, 19 Oct 2011 09:05:10 +0000 (11:05 +0200)]
ia32: change ShrD/ShlD patterns to match Add instead of Or

12 years agonormalise Or/Eor => Add where possible
Matthias Braun [Wed, 19 Oct 2011 09:04:34 +0000 (11:04 +0200)]
normalise Or/Eor => Add where possible

12 years agocast ctype functions input to unsigned char
Matthias Braun [Thu, 20 Oct 2011 12:26:36 +0000 (14:26 +0200)]
cast ctype functions input to unsigned char

From the manpage: If c is not an unsigned char value, or EOF, the
behavior of these functions is undefined.
(So putting char into them directly is wrong)

12 years agomake fltcalc.c more portable (and msvc independent)
Matthias Braun [Thu, 20 Oct 2011 11:43:16 +0000 (13:43 +0200)]
make fltcalc.c more portable (and msvc independent)

12 years agorename some constants to avoid clashes with system headers
Matthias Braun [Thu, 20 Oct 2011 10:26:48 +0000 (12:26 +0200)]
rename some constants to avoid clashes with system headers

12 years agoadd a Doxyfile for people without firm-build
Matthias Braun [Wed, 19 Oct 2011 20:03:53 +0000 (22:03 +0200)]
add a Doxyfile for people without firm-build

12 years agogenerate_emitter.pl depends on generate_emitter_new.pl
Matthias Braun [Wed, 19 Oct 2011 19:36:57 +0000 (21:36 +0200)]
generate_emitter.pl depends on generate_emitter_new.pl

12 years agofix perl warning
Matthias Braun [Wed, 19 Oct 2011 19:36:44 +0000 (21:36 +0200)]
fix perl warning

12 years agowe (also) build a shared lib for which some architecture require PIC code
Matthias Braun [Wed, 19 Oct 2011 19:34:14 +0000 (21:34 +0200)]
we (also) build a shared lib for which some architecture require PIC code

12 years agosparc: emit extra-indentation for delay slots
Matthias Braun [Mon, 17 Oct 2011 16:23:43 +0000 (18:23 +0200)]
sparc: emit extra-indentation for delay slots

12 years agosparc: implement more fold-into-restore peephole optimizations
Matthias Braun [Mon, 17 Oct 2011 13:40:00 +0000 (15:40 +0200)]
sparc: implement more fold-into-restore peephole optimizations

12 years agobe: factor out can_move_to function from sparc_emitter
Matthias Braun [Mon, 17 Oct 2011 13:39:28 +0000 (15:39 +0200)]
be: factor out can_move_to function from sparc_emitter

12 years agobepeephole: use global register indices
Matthias Braun [Mon, 17 Oct 2011 10:56:19 +0000 (12:56 +0200)]
bepeephole: use global register indices

This simplifies the code and should make it slightly faster

12 years agosparc: use AddCC, SubCC, MulCC
Matthias Braun [Fri, 14 Oct 2011 14:48:51 +0000 (16:48 +0200)]
sparc: use AddCC, SubCC, MulCC

12 years agogenerate nicer emitter code
Matthias Braun [Fri, 14 Oct 2011 14:48:27 +0000 (16:48 +0200)]
generate nicer emitter code