libfirm
12 years agoBugfix: Added special case for x mod 1.
Sebastian Buchwald [Fri, 19 Aug 2011 12:07:11 +0000 (14:07 +0200)]
Bugfix: Added special case for x mod 1.

12 years agoIR export: export mode name as string; mark "the" mode_P mode.
Julian Oppermann [Fri, 19 Aug 2011 11:46:32 +0000 (13:46 +0200)]
IR export: export mode name as string; mark "the" mode_P mode.

12 years agoClarify remove_bads doc
Andreas Zwinkau [Fri, 19 Aug 2011 08:17:01 +0000 (10:17 +0200)]
Clarify remove_bads doc

12 years agoCorrect comment.
Christoph Mallon [Fri, 19 Aug 2011 06:15:04 +0000 (08:15 +0200)]
Correct comment.

12 years agoReduce code duplication.
Christoph Mallon [Fri, 19 Aug 2011 06:14:21 +0000 (08:14 +0200)]
Reduce code duplication.

12 years agoUse new_*_Const(irg, get_mode_$VAL(mode)) instead of new_*_Const_long(irg, mode,...
Christoph Mallon [Fri, 19 Aug 2011 06:08:41 +0000 (08:08 +0200)]
Use new_*_Const(irg, get_mode_$VAL(mode)) instead of new_*_Const_long(irg, mode, $VAL).

12 years agosparc: Set object file format when initializing backend.
Manuel Mohr [Thu, 18 Aug 2011 16:56:55 +0000 (18:56 +0200)]
sparc: Set object file format when initializing backend.

Old version breaks for files which do not contain any functions because
in this case, emit_routine never gets called.

12 years agoFix div by one
Andreas Zwinkau [Thu, 18 Aug 2011 14:56:50 +0000 (16:56 +0200)]
Fix div by one

For k==0 the Div to Shift conversion is wrong.
Instead, we just convert to the left operand of the Div.

12 years agoRefactoring to remove one level of indentation
Andreas Zwinkau [Thu, 18 Aug 2011 14:53:18 +0000 (16:53 +0200)]
Refactoring to remove one level of indentation

12 years agoA comment for better understanding
Andreas Zwinkau [Thu, 18 Aug 2011 14:44:19 +0000 (16:44 +0200)]
A comment for better understanding

12 years agosparc: Added a comment.
Manuel Mohr [Thu, 18 Aug 2011 14:40:52 +0000 (16:40 +0200)]
sparc: Added a comment.

12 years agosparc: Add support for Conds where selector is not a Cmp.
Manuel Mohr [Thu, 18 Aug 2011 14:06:24 +0000 (16:06 +0200)]
sparc: Add support for Conds where selector is not a Cmp.

12 years agocleanup
Andreas Zwinkau [Thu, 18 Aug 2011 13:41:54 +0000 (15:41 +0200)]
cleanup

The variable is overwritten right afterwards

12 years agoDon't try to import cons_flags.
Julian Oppermann [Thu, 18 Aug 2011 12:39:19 +0000 (14:39 +0200)]
Don't try to import cons_flags.

12 years agoFixed opt/fehler196.c.
Sebastian Buchwald [Thu, 18 Aug 2011 12:31:40 +0000 (14:31 +0200)]
Fixed opt/fehler196.c.

12 years agoAllow selecting one past the last parameter to get variadic parameters.
Christoph Mallon [Wed, 17 Aug 2011 19:00:50 +0000 (21:00 +0200)]
Allow selecting one past the last parameter to get variadic parameters.

12 years agoRemove unnecessary assignment, which at worst hides a panic.
Christoph Mallon [Wed, 17 Aug 2011 17:40:37 +0000 (19:40 +0200)]
Remove unnecessary assignment, which at worst hides a panic.

12 years agoFix emission of string initializers.
Christoph Mallon [Wed, 17 Aug 2011 13:44:43 +0000 (15:44 +0200)]
Fix emission of string initializers.

Non-printable characters are emitted as octal sequences, e.g. \0 for 0.
Always pad them to three digits, so they do not accidently join with a following ASCII digit.
E.g. "\0""7" was emitted as "\07", correct is "\0007".

12 years agoFixed local optimization.
Sebastian Buchwald [Wed, 17 Aug 2011 14:33:13 +0000 (16:33 +0200)]
Fixed local optimization.

We have to convert the values the same way the program does.

12 years agoreplace unsupported builtins with library calls
Matthias Braun [Wed, 17 Aug 2011 13:15:38 +0000 (15:15 +0200)]
replace unsupported builtins with library calls

12 years agosparc: fix mode of Ldf Projs
Matthias Braun [Tue, 16 Aug 2011 11:26:19 +0000 (13:26 +0200)]
sparc: fix mode of Ldf Projs

12 years agoadd callback for constructing spill/reload
Matthias Braun [Mon, 15 Aug 2011 16:10:38 +0000 (18:10 +0200)]
add callback for constructing spill/reload

So we are not forced to use the generic be_Spill, be_Reload functions
which don't work correctly with double-width register requirements.
This should really fix sparc float spill/reload this time.

12 years agosimplify copy interface and respect double/aligned reqs
Matthias Braun [Mon, 15 Aug 2011 13:24:55 +0000 (15:24 +0200)]
simplify copy interface and respect double/aligned reqs

12 years agofix warnings reported by cparser
Matthias Braun [Mon, 15 Aug 2011 12:23:40 +0000 (14:23 +0200)]
fix warnings reported by cparser

12 years agoCorrect reg_reqs_equal().
Christoph Mallon [Wed, 17 Aug 2011 07:57:39 +0000 (09:57 +0200)]
Correct reg_reqs_equal().

If req2 was limited and req1 wasn't, then it incorrectly returned true.

12 years agoCorrect typos in comments.
Christoph Mallon [Wed, 17 Aug 2011 07:57:06 +0000 (09:57 +0200)]
Correct typos in comments.

12 years agoCorrect indentation.
Christoph Mallon [Wed, 17 Aug 2011 07:56:36 +0000 (09:56 +0200)]
Correct indentation.

12 years agoAdded soft float support for SPARC backend.
Sebastian Buchwald [Mon, 15 Aug 2011 14:39:21 +0000 (16:39 +0200)]
Added soft float support for SPARC backend.

12 years agoFix C/bitfield4
Andreas Zwinkau [Tue, 16 Aug 2011 12:58:03 +0000 (14:58 +0200)]
Fix C/bitfield4

Load-Store-Opt now shifts constant loads from bitfields accordingly.

12 years agocleanup
Andreas Zwinkau [Tue, 16 Aug 2011 12:29:38 +0000 (14:29 +0200)]
cleanup

12 years agofix missing else
Andreas Zwinkau [Tue, 16 Aug 2011 12:01:35 +0000 (14:01 +0200)]
fix missing else

12 years agoAPI Change: Use graph state instead of parameter
Andreas Zwinkau [Tue, 16 Aug 2011 11:28:18 +0000 (13:28 +0200)]
API Change: Use graph state instead of parameter

The lowering phase had a lower_bitfield parameter.
Instead of passing "true", the (e.g. EDG) frontends now must
set_irg_state(irg, IR_GRAPH_STATE_IMPLICIT_BITFIELD_MASKING).

This is necessary, because not only the lowering phase is affected.
Additionally, the load store optimisation should handle Sels differently.

12 years agocleanup
Andreas Zwinkau [Fri, 12 Aug 2011 10:34:09 +0000 (12:34 +0200)]
cleanup

Removes obsolete debug output and confusing comments

12 years agobig refactoring of arch_XXX functions
Matthias Braun [Mon, 15 Aug 2011 11:41:11 +0000 (13:41 +0200)]
big refactoring of arch_XXX functions

This tries to get the names in a consistent format. We basically have 2
views on register allocation/constraints now:

1) Register Requirements and Assigments are per-instruction. Each
   instruction has requirements on its inputs and outputs, register get
   assigned for outputs of an instruction (assignment is an attribute of
   an instruction, not of the Proj-nodes).
   The internal datastructures model this form!

   The functions here have the form:
     arch_get_irn_register_req_in(node, input_nr)
     arch_get_irn_register_in(node, input_nr)
     arch_get_irn_register_req_out(node, output_nr)
     arch_set_irn_register_out(node, output_nr, register)

2) Register Requirements and Assignments are on firm-values. This view
   allows to query/assign requirements and registers at the Proj nodes
   instead of the repsective predecessors.
   This is a convenience interface modeled on top of the other!

   The functions have the form:
     arch_get_irn_register_req(node)
     arch_get_irn_register(node)
     arch_set_irn_register(node, register)

12 years agoremove old type
Matthias Braun [Sun, 14 Aug 2011 12:01:53 +0000 (14:01 +0200)]
remove old type

12 years agosparc: fix spilling+reloading of float values
Matthias Braun [Fri, 12 Aug 2011 12:53:13 +0000 (14:53 +0200)]
sparc: fix spilling+reloading of float values

12 years agoimplement aggregate returns according to sparc ABI
Matthias Braun [Fri, 12 Aug 2011 11:30:22 +0000 (13:30 +0200)]
implement aggregate returns according to sparc ABI

12 years agocustom stack bias code for sparc
Matthias Braun [Thu, 11 Aug 2011 12:35:43 +0000 (14:35 +0200)]
custom stack bias code for sparc

12 years agosparc: fix float calling conventions
Matthias Braun [Thu, 11 Aug 2011 12:36:53 +0000 (14:36 +0200)]
sparc: fix float calling conventions

12 years agosparc: fix mode of fdiv result
Matthias Braun [Thu, 11 Aug 2011 13:32:00 +0000 (15:32 +0200)]
sparc: fix mode of fdiv result

12 years agosparc: fix wrong incsp in omit-fp mode
Matthias Braun [Tue, 9 Aug 2011 07:59:45 +0000 (09:59 +0200)]
sparc: fix wrong incsp in omit-fp mode

12 years agofix names of some dumped vcg files
Matthias Braun [Tue, 9 Aug 2011 07:54:25 +0000 (09:54 +0200)]
fix names of some dumped vcg files

12 years agosparc: floatingpoint flags producing nodes have 1 cycle delay, add an ad-hoc fix...
Matthias Braun [Mon, 8 Aug 2011 15:03:04 +0000 (17:03 +0200)]
sparc: floatingpoint flags producing nodes have 1 cycle delay, add an ad-hoc fix for that

12 years agofix sparc fneg instruction emitter
Matthias Braun [Mon, 8 Aug 2011 15:01:54 +0000 (17:01 +0200)]
fix sparc fneg instruction emitter

12 years agoavoid generic names like flags in generator
Matthias Braun [Wed, 27 Jul 2011 10:53:10 +0000 (12:53 +0200)]
avoid generic names like flags in generator

12 years agoImplement double-register support for prefalloc with an ILP method
Matthias Braun [Fri, 15 Jul 2011 12:10:41 +0000 (14:10 +0200)]
Implement double-register support for prefalloc with an ILP method

12 years agouse 'default' ilp solver if nothing specified
Matthias Braun [Mon, 25 Jul 2011 13:52:20 +0000 (15:52 +0200)]
use 'default' ilp solver if nothing specified

12 years agolpp: only read solution in gurobi solver if one was found
Matthias Braun [Fri, 15 Jul 2011 12:10:05 +0000 (14:10 +0200)]
lpp: only read solution in gurobi solver if one was found

12 years agolpp: call the constraint types lpp_{less|greater}_equal because they are a {less...
Matthias Braun [Fri, 15 Jul 2011 12:01:30 +0000 (14:01 +0200)]
lpp: call the constraint types lpp_{less|greater}_equal because they are a {less|greater} equal operation

12 years agoconsistently give all lpp functions an lpp_ prefix
Matthias Braun [Fri, 15 Jul 2011 11:38:03 +0000 (13:38 +0200)]
consistently give all lpp functions an lpp_ prefix

12 years agolpp: use inline functions instead of macros
Matthias Braun [Fri, 15 Jul 2011 11:36:08 +0000 (13:36 +0200)]
lpp: use inline functions instead of macros

12 years agolpp: add firm copyright header, some cleanups
Matthias Braun [Thu, 14 Jul 2011 11:48:00 +0000 (13:48 +0200)]
lpp: add firm copyright header, some cleanups

12 years agofix cparser warnings in beprefalloc
Matthias Braun [Wed, 15 Jun 2011 11:35:38 +0000 (13:35 +0200)]
fix cparser warnings in beprefalloc

12 years agoprefalloc will respect alignment when initially assigning registers
Matthias Braun [Fri, 17 Sep 2010 11:37:03 +0000 (13:37 +0200)]
prefalloc will respect alignment when initially assigning registers

12 years agodo not sign_extend too early in tarval_convert_to
Matthias Braun [Fri, 12 Aug 2011 16:31:48 +0000 (18:31 +0200)]
do not sign_extend too early in tarval_convert_to

12 years agosimplify/remove unnecessary complicated copy-pasta code
Matthias Braun [Thu, 11 Aug 2011 11:59:17 +0000 (13:59 +0200)]
simplify/remove unnecessary complicated copy-pasta code

12 years agomerge after_ra and finish phase, and move stack_bias fixing into backends
Matthias Braun [Thu, 11 Aug 2011 11:46:15 +0000 (13:46 +0200)]
merge after_ra and finish phase, and move stack_bias fixing into backends

12 years agoAdded soft float support for IA32 backend.
Sebastian Buchwald [Thu, 11 Aug 2011 13:26:39 +0000 (15:26 +0200)]
Added soft float support for IA32 backend.

12 years agoImplemented floating point lowering to Calls into a soft float library.
Sebastian Buchwald [Thu, 11 Aug 2011 12:18:48 +0000 (14:18 +0200)]
Implemented floating point lowering to Calls into a soft float library.

12 years agoFix size_t related warnings
Andreas Zwinkau [Fri, 12 Aug 2011 09:02:16 +0000 (11:02 +0200)]
Fix size_t related warnings

12 years agoInliner must not inline parameter entities
Andreas Zwinkau [Fri, 12 Aug 2011 08:17:57 +0000 (10:17 +0200)]
Inliner must not inline parameter entities

This reverts commit a63fa62c9468f8af3fa6b16001912de9c9c472af.

While the inliner could do this right,
the fix for now is to not inline such functions.

12 years agoInliner must clear parameter flag of entities
Andreas Zwinkau [Thu, 11 Aug 2011 14:12:31 +0000 (16:12 +0200)]
Inliner must clear parameter flag of entities

12 years agoalso change mode_P when setting a new modeP_data
Matthias Braun [Wed, 10 Aug 2011 08:57:32 +0000 (10:57 +0200)]
also change mode_P when setting a new modeP_data

12 years agolet backends specify the complete long double type
Matthias Braun [Tue, 9 Aug 2011 08:48:13 +0000 (10:48 +0200)]
let backends specify the complete long double type

12 years agoallow setting primitive type size so we can model things like 'long double' size...
Matthias Braun [Wed, 10 Aug 2011 07:58:24 +0000 (09:58 +0200)]
allow setting primitive type size so we can model things like 'long double' size 16 with mode_E

12 years agoDirectly create Start/Return node in sparc backend
Matthias Braun [Mon, 8 Aug 2011 14:50:56 +0000 (16:50 +0200)]
Directly create Start/Return node in sparc backend

Since we have no complicated barrier/prolog stuff in the transform phase
anymore we can move away from beabihelper now and create the nodes
directly which will be necessary when modeling special constraints like
wide aligned registers.

12 years agofactor out code for address of register param taken
Matthias Braun [Fri, 5 Aug 2011 13:33:28 +0000 (15:33 +0200)]
factor out code for address of register param taken

So sparc can handle this case now.

12 years agomaintain method types variadicity,properties,calling convention when modifying them
Matthias Braun [Fri, 5 Aug 2011 09:06:45 +0000 (11:06 +0200)]
maintain method types variadicity,properties,calling convention when modifying them

12 years agorework taking of parameter addresses
Matthias Braun [Fri, 5 Aug 2011 08:58:44 +0000 (10:58 +0200)]
rework taking of parameter addresses

Use a special kind of entity on the frame type instead of a value_type
struct inside a method type. This makes replacement of function types
slightly easier (it's still a complex operation though) and handling in
the backend a bit more consistent since it's more or less a normal stack
access (with special offsets).

12 years agosimplify/rework lower_calls interface and code
Matthias Braun [Fri, 5 Aug 2011 08:22:30 +0000 (10:22 +0200)]
simplify/rework lower_calls interface and code

This was done by removing unnecessary options/options that only
allowed marginal tweakings to improve performance while at the same time
making the interface cumbersome.

12 years agoa few cleanups in scalar replacement code
Matthias Braun [Thu, 4 Aug 2011 17:17:52 +0000 (19:17 +0200)]
a few cleanups in scalar replacement code

12 years agoremove (broken+unused) support for right_to_left parameter passing
Matthias Braun [Thu, 4 Aug 2011 11:33:57 +0000 (13:33 +0200)]
remove (broken+unused) support for right_to_left parameter passing

12 years agocall hook_new_entity after copying entity so the firm debugger can catch it
Matthias Braun [Thu, 4 Aug 2011 08:49:53 +0000 (10:49 +0200)]
call hook_new_entity after copying entity so the firm debugger can catch it

12 years agosplit irg and irp resources, add IRP_RESOURCE_TYPE_LINK
Matthias Braun [Thu, 4 Aug 2011 07:57:52 +0000 (09:57 +0200)]
split irg and irp resources, add IRP_RESOURCE_TYPE_LINK

12 years agoia32_Minus64Bit needs no contraint copies.
Christoph Mallon [Fri, 29 Jul 2011 08:55:54 +0000 (10:55 +0200)]
ia32_Minus64Bit needs no contraint copies.

Its emitter handles this.

12 years agolowering: fix i_mapper for new exception attributes
Matthias Braun [Thu, 28 Jul 2011 11:03:05 +0000 (13:03 +0200)]
lowering: fix i_mapper for new exception attributes

12 years agofix sparc Call transform rule off-by-one error
Matthias Braun [Thu, 28 Jul 2011 10:41:21 +0000 (12:41 +0200)]
fix sparc Call transform rule off-by-one error

12 years agoWe need a mode_T node for Projs.
Sebastian Buchwald [Thu, 28 Jul 2011 09:15:31 +0000 (11:15 +0200)]
We need a mode_T node for Projs.

12 years agoRemove unnecessary explicit array length spcification.
Christoph Mallon [Wed, 27 Jul 2011 16:25:16 +0000 (18:25 +0200)]
Remove unnecessary explicit array length spcification.

12 years agoActually assert on mode M, as the comment says. We already know it's a Phi.
Christoph Mallon [Wed, 27 Jul 2011 16:24:37 +0000 (18:24 +0200)]
Actually assert on mode M, as the comment says.  We already know it's a Phi.

12 years agoCorrect the NOT+ADC transformation.
Christoph Mallon [Wed, 27 Jul 2011 16:08:48 +0000 (18:08 +0200)]
Correct the NOT+ADC transformation.

12 years agoRemove unused enum entries.
Christoph Mallon [Wed, 27 Jul 2011 16:04:50 +0000 (18:04 +0200)]
Remove unused enum entries.

12 years agoSimplify usage of LC_OPT_ENT_STR(): The length of the buffer is determined in the...
Christoph Mallon [Wed, 27 Jul 2011 16:04:14 +0000 (18:04 +0200)]
Simplify usage of LC_OPT_ENT_STR(): The length of the buffer is determined in the macro, not passed as parameter.

12 years agoGenerate a warning, when LC_OPT_ENT_* macros are used with the wrong type.
Christoph Mallon [Wed, 27 Jul 2011 15:02:00 +0000 (17:02 +0200)]
Generate a warning, when LC_OPT_ENT_* macros are used with the wrong type.

12 years agoTest lower_perm_opt like an enum, not a bitset.
Christoph Mallon [Wed, 27 Jul 2011 14:59:14 +0000 (16:59 +0200)]
Test lower_perm_opt like an enum, not a bitset.

12 years agoCorrect wrong usage of LC_OPT machinery.
Christoph Mallon [Wed, 27 Jul 2011 14:57:36 +0000 (16:57 +0200)]
Correct wrong usage of LC_OPT machinery.

12 years agoCorrect type inconsistency in LC_OPT machinery.
Christoph Mallon [Wed, 27 Jul 2011 14:56:25 +0000 (16:56 +0200)]
Correct type inconsistency in LC_OPT machinery.

12 years agofix statev messing up column-name/value relation in sqlite3
Matthias Braun [Wed, 27 Jul 2011 13:41:58 +0000 (15:41 +0200)]
fix statev messing up column-name/value relation in sqlite3

12 years agofix double free in regex stuff
Matthias Braun [Wed, 27 Jul 2011 13:39:27 +0000 (15:39 +0200)]
fix double free in regex stuff

12 years agoEliminate warning and use static assert.
Christoph Mallon [Wed, 27 Jul 2011 08:31:23 +0000 (10:31 +0200)]
Eliminate warning and use static assert.

12 years agoExtend the NOT+ADC-trick (sic) for SUB to SBB.
Christoph Mallon [Wed, 27 Jul 2011 07:39:45 +0000 (09:39 +0200)]
Extend the NOT+ADC-trick (sic) for SUB to SBB.

This should fix 403.gcc.
A SBB with AM could not fulfill its should_be_same contraint, so the AM gets split from the SBB.
The Load of the AM gets assigned the out register of the SBB, which violates the !in_r5 constraint of the SBB.
Therefore it's necessary to turn the SBB into NOT+ADC.

12 years agoCorrect inaccurate comment: The only corner case of wrong CF in NEG+ADD as replacemen...
Christoph Mallon [Wed, 27 Jul 2011 07:33:58 +0000 (09:33 +0200)]
Correct inaccurate comment: The only corner case of wrong CF in NEG+ADD as replacement for SUB is if both operands are zero.

12 years agoAdded local opt Phi(Pin,...,Pin) -> Pin(Phi(...)).
Sebastian Buchwald [Tue, 26 Jul 2011 12:05:24 +0000 (14:05 +0200)]
Added local opt Phi(Pin,...,Pin) -> Pin(Phi(...)).

This fixes opt/fehler194.c.

12 years agoSet ls_mode for created ia32_Test node.
Sebastian Buchwald [Tue, 19 Jul 2011 14:26:54 +0000 (16:26 +0200)]
Set ls_mode for created ia32_Test node.

12 years agoFixed opt/fehler193.c.
Sebastian Buchwald [Tue, 19 Jul 2011 12:34:02 +0000 (14:34 +0200)]
Fixed opt/fehler193.c.

12 years agoAdded commutative optimization variants.
Sebastian Buchwald [Tue, 19 Jul 2011 09:01:10 +0000 (11:01 +0200)]
Added commutative optimization variants.

12 years agoFixed opt/fehler192.c.
Sebastian Buchwald [Tue, 19 Jul 2011 08:48:51 +0000 (10:48 +0200)]
Fixed opt/fehler192.c.

12 years agoPrevent optimization in case of an Eor, too.
Sebastian Buchwald [Fri, 15 Jul 2011 12:04:30 +0000 (14:04 +0200)]
Prevent optimization in case of an Eor, too.

12 years agoQuick fix for opt/fehler191.c.
Sebastian Buchwald [Fri, 15 Jul 2011 09:26:28 +0000 (11:26 +0200)]
Quick fix for opt/fehler191.c.

This also fixes 176.gcc and 300.twolf.

12 years agoFixed typo.
Sebastian Buchwald [Fri, 15 Jul 2011 09:25:58 +0000 (11:25 +0200)]
Fixed typo.