libfirm
11 years agobeabi: The parameter irn of create_be_return() never is null.
Christoph Mallon [Sat, 24 Nov 2012 11:31:39 +0000 (12:31 +0100)]
beabi: The parameter irn of create_be_return() never is null.

11 years agobeabi: Remove the attribute cls_addr from struct be_abi_call_t.
Christoph Mallon [Sat, 24 Nov 2012 11:12:54 +0000 (12:12 +0100)]
beabi: Remove the attribute cls_addr from struct be_abi_call_t.

It is only used locally.

11 years agobeabi: Remove the unused function be_abi_call_set_call_address_reg_class().
Christoph Mallon [Sat, 24 Nov 2012 11:01:00 +0000 (12:01 +0100)]
beabi: Remove the unused function be_abi_call_set_call_address_reg_class().

11 years agobeabi: Remove the unused attribute between_type from struct be_abi_call_t.
Christoph Mallon [Sat, 24 Nov 2012 10:58:49 +0000 (11:58 +0100)]
beabi: Remove the unused attribute between_type from struct be_abi_call_t.

11 years agobeabi: Remove the global variable be_omit_fp.
Christoph Mallon [Sat, 24 Nov 2012 10:55:13 +0000 (11:55 +0100)]
beabi: Remove the global variable be_omit_fp.

Simply directly use the be_options.

11 years agobeabi: Remove redundant adjustment of try_omit_fp in process_ops_in_block().
Christoph Mallon [Sat, 24 Nov 2012 10:53:02 +0000 (11:53 +0100)]
beabi: Remove redundant adjustment of try_omit_fp in process_ops_in_block().

It was initialised properly by be_abi_call_new().

11 years agobeabi: Always be_abi_call_get_flags() before be_abi_call_set_flags().
Christoph Mallon [Sat, 24 Nov 2012 10:49:18 +0000 (11:49 +0100)]
beabi: Always be_abi_call_get_flags() before be_abi_call_set_flags().

The template and amd64 backends left the omit_fp flag undefined due to allocating an uninitialized be_abi_call_flags_t on the stack.

11 years agobeabi: Turn be_abi_call_flags_t into a struct.
Christoph Mallon [Sat, 24 Nov 2012 10:45:49 +0000 (11:45 +0100)]
beabi: Turn be_abi_call_flags_t into a struct.

Remove the union aspect to interpret the flags as one unsigned int.

11 years agobeabi: Remove the atttribute on_stack from struct be_abi_call_arg_t.
Christoph Mallon [Sat, 24 Nov 2012 10:20:27 +0000 (11:20 +0100)]
beabi: Remove the atttribute on_stack from struct be_abi_call_arg_t.

It is the complement of the atttribute in_reg.

11 years agobeabi: Use the stack alignment, instead of hardcoding 4, to align the frame size.
Christoph Mallon [Sat, 24 Nov 2012 09:51:50 +0000 (10:51 +0100)]
beabi: Use the stack alignment, instead of hardcoding 4, to align the frame size.

11 years agobeabi: Remove the attribute frame_tp from struct lower_frame_sels_env_t.
Christoph Mallon [Sat, 24 Nov 2012 09:51:10 +0000 (10:51 +0100)]
beabi: Remove the attribute frame_tp from struct lower_frame_sels_env_t.

It is only used locally.

11 years agobeabi: Remove the unused attribute static_link_pos from struct lower_frame_sels_env_t.
Christoph Mallon [Sat, 24 Nov 2012 09:44:20 +0000 (10:44 +0100)]
beabi: Remove the unused attribute static_link_pos from struct lower_frame_sels_env_t.

11 years agobearch: Remove the write-only attribute link_class from struct arch_env_t.
Christoph Mallon [Sat, 24 Nov 2012 09:43:38 +0000 (10:43 +0100)]
bearch: Remove the write-only attribute link_class from struct arch_env_t.

11 years agobeabi: Remove the write-only attribute link_class from struct lower_frame_sels_env_t.
Christoph Mallon [Sat, 24 Nov 2012 09:42:28 +0000 (10:42 +0100)]
beabi: Remove the write-only attribute link_class from struct lower_frame_sels_env_t.

11 years agoamd64: Remove struct amd64_irg_data_t.
Christoph Mallon [Sat, 24 Nov 2012 09:08:34 +0000 (10:08 +0100)]
amd64: Remove struct amd64_irg_data_t.

Most attributes were unused.
The only one used (dump) is now directly read from the be_options.

11 years agobemain: init_graph in arch_isa_if_t may now be a null pointer.
Christoph Mallon [Sat, 24 Nov 2012 09:06:09 +0000 (10:06 +0100)]
bemain: init_graph in arch_isa_if_t may now be a null pointer.

Remove empty init_graph functions from arm and sparc backends.

11 years agobestack: Remove pointless local variable.
Christoph Mallon [Sat, 24 Nov 2012 09:05:16 +0000 (10:05 +0100)]
bestack: Remove pointless local variable.

11 years agobestack: Remove the write-only attribute between_size from struct bias_walk.
Christoph Mallon [Sat, 24 Nov 2012 09:04:41 +0000 (10:04 +0100)]
bestack: Remove the write-only attribute between_size from struct bias_walk.

11 years agobeabi: Pass be_abi_irg_t around locally instead of storing it in be_irg_t.
Christoph Mallon [Sat, 24 Nov 2012 09:01:17 +0000 (10:01 +0100)]
beabi: Pass be_abi_irg_t around locally instead of storing it in be_irg_t.

11 years agobeabi: Do not pass an environment to fix_pic_symconsts(), which it does not use.
Christoph Mallon [Sat, 24 Nov 2012 09:03:16 +0000 (10:03 +0100)]
beabi: Do not pass an environment to fix_pic_symconsts(), which it does not use.

11 years agobeabi: Remove the attribute start from struct be_abi_irg_t.
Christoph Mallon [Sat, 24 Nov 2012 08:33:52 +0000 (09:33 +0100)]
beabi: Remove the attribute start from struct be_abi_irg_t.

It is only used in one function.

11 years agobeabi: Remove the unused attribute start_block_bias from struct be_abi_irg_t.
Christoph Mallon [Sat, 24 Nov 2012 08:32:10 +0000 (09:32 +0100)]
beabi: Remove the unused attribute start_block_bias from struct be_abi_irg_t.

11 years agobe: Remove the irg from the birg.
Christoph Mallon [Sat, 24 Nov 2012 07:59:00 +0000 (08:59 +0100)]
be: Remove the irg from the birg.

There was only one user of this information left, which is changed to directly use irgs.

11 years agoarm: Remove the unused function create_const().
Christoph Mallon [Sat, 24 Nov 2012 07:53:03 +0000 (08:53 +0100)]
arm: Remove the unused function create_const().

11 years agoamd64: Remove the unused function create_const().
Christoph Mallon [Sat, 24 Nov 2012 07:52:33 +0000 (08:52 +0100)]
amd64: Remove the unused function create_const().

11 years agoedges: Remove support for private edge data.
Christoph Mallon [Fri, 23 Nov 2012 21:21:22 +0000 (22:21 +0100)]
edges: Remove support for private edge data.

11 years agoedges: Remove unused macros.
Christoph Mallon [Fri, 23 Nov 2012 21:15:47 +0000 (22:15 +0100)]
edges: Remove unused macros.

11 years agotr: Remove if from set_type_size(), which would lead to a silent failure in release...
Christoph Mallon [Sat, 24 Nov 2012 09:58:56 +0000 (10:58 +0100)]
tr: Remove if from set_type_size(), which would lead to a silent failure in release mode.

Now we get a nice crash.

11 years agoCombo: Ensure split by partition for Phi nodes.
Sebastian Buchwald [Fri, 23 Nov 2012 13:02:33 +0000 (14:02 +0100)]
Combo: Ensure split by partition for Phi nodes.

This fixes opt/combo3.c and opt/combo4.c.

11 years agoImproved readability of debug output.
Sebastian Buchwald [Thu, 22 Nov 2012 09:37:28 +0000 (10:37 +0100)]
Improved readability of debug output.

11 years agoDump partitions before adding them to the worklist.
Sebastian Buchwald [Thu, 22 Nov 2012 09:22:53 +0000 (10:22 +0100)]
Dump partitions before adding them to the worklist.

This makes the debug output more readable.

11 years agoFixed some typos.
Sebastian Buchwald [Tue, 20 Nov 2012 07:37:10 +0000 (08:37 +0100)]
Fixed some typos.

11 years agotimer: Enlarge the display space for the time.
Christoph Mallon [Fri, 23 Nov 2012 06:41:08 +0000 (07:41 +0100)]
timer: Enlarge the display space for the time.

11 years agoverifier: Check the result mode of Div and Mod.
Christoph Mallon [Thu, 22 Nov 2012 16:48:54 +0000 (17:48 +0100)]
verifier: Check the result mode of Div and Mod.

11 years agoverifier: Check that Div has a num mode, not a data mode.
Christoph Mallon [Thu, 22 Nov 2012 16:47:59 +0000 (17:47 +0100)]
verifier: Check that Div has a num mode, not a data mode.

11 years agoupdate for release
Matthias Braun [Fri, 16 Nov 2012 18:33:27 +0000 (19:33 +0100)]
update for release

11 years agofix assert: there are initializers with size==0
Matthias Braun [Wed, 21 Nov 2012 16:48:36 +0000 (17:48 +0100)]
fix assert: there are initializers with size==0

11 years agoldstopt: fix for case of non-const global initializer
Matthias Braun [Mon, 19 Nov 2012 16:10:42 +0000 (17:10 +0100)]
ldstopt: fix for case of non-const global initializer

11 years agoia32: fix stupid bug introduced in last commit
Matthias Braun [Fri, 16 Nov 2012 17:38:12 +0000 (18:38 +0100)]
ia32: fix stupid bug introduced in last commit

makereport didn't catch it because it uses -march=native flags by
default which produces code without fucompp.

11 years agoia32_x87: remove the distinction between vfp and fp concepts
Matthias Braun [Thu, 15 Nov 2012 15:03:03 +0000 (16:03 +0100)]
ia32_x87: remove the distinction between vfp and fp concepts

It's really the same stuff just before and after running ia32_x87
simulator, there is no real need to have 2 different things.

11 years agox87: Add a heuristic for fxch-ing one operand in sim_binop(), if both operands die.
Christoph Mallon [Thu, 15 Nov 2012 13:53:15 +0000 (14:53 +0100)]
x87: Add a heuristic for fxch-ing one operand in sim_binop(), if both operands die.

11 years agobedwarf: use be_gas_emit_string to fix escaping issues
Matthias Braun [Thu, 15 Nov 2012 09:29:13 +0000 (10:29 +0100)]
bedwarf: use be_gas_emit_string to fix escaping issues

11 years agobegnuas: simplify, add be_gas_emit_string()
Matthias Braun [Thu, 15 Nov 2012 09:28:04 +0000 (10:28 +0100)]
begnuas: simplify, add be_gas_emit_string()

simplify it by always using .asciz instead of sometimes .string/.ascii.
All new gcc/binutils understand .asciz.

11 years agobedwarf: query backend for pointer size
Matthias Braun [Thu, 15 Nov 2012 08:29:39 +0000 (09:29 +0100)]
bedwarf: query backend for pointer size

Also improve doku of machine_size element in backend_params struct.

11 years agox87: Only use fucompp if one operand happens to be at st(1).
Christoph Mallon [Wed, 14 Nov 2012 11:59:50 +0000 (12:59 +0100)]
x87: Only use fucompp if one operand happens to be at st(1).

Otherwise the extra effort to get the operands to the right position is not worth it.
Further, this avoids the unnecessary effort when we not going to use fucompp in favor of fucomi anyway.

11 years agox87: Enable x87_create_fpop() to remove entries other than just the tos.
Christoph Mallon [Wed, 14 Nov 2012 12:20:22 +0000 (13:20 +0100)]
x87: Enable x87_create_fpop() to remove entries other than just the tos.

11 years agox87: Remove the parameter num from x87_create_fpop().
Christoph Mallon [Wed, 14 Nov 2012 12:15:06 +0000 (13:15 +0100)]
x87: Remove the parameter num from x87_create_fpop().

11 years agox87: Improve sim_binop(): Only use fxch if both operands are not at tos.
Christoph Mallon [Wed, 14 Nov 2012 09:49:41 +0000 (10:49 +0100)]
x87: Improve sim_binop(): Only use fxch if both operands are not at tos.

11 years agox87: Simplify the case when both operands are dead in sim_binop().
Christoph Mallon [Wed, 14 Nov 2012 09:45:21 +0000 (10:45 +0100)]
x87: Simplify the case when both operands are dead in sim_binop().

11 years agox87: Fix harmless typo in sim_binop().
Christoph Mallon [Wed, 14 Nov 2012 09:33:20 +0000 (10:33 +0100)]
x87: Fix harmless typo in sim_binop().

The last parameter of x87_create_fpush() is used for debugging only.

11 years agox87: Simplify x87 code generation.
Christoph Mallon [Tue, 13 Nov 2012 09:01:42 +0000 (10:01 +0100)]
x87: Simplify x87 code generation.

Do not store up to three registers for an instruction.
Instead only store the explicit register operand and whether the operands are permuted and/or the result is to be placed in the explicit register operand or st0.

11 years agox87: Simplify sim_Fucom().
Christoph Mallon [Wed, 14 Nov 2012 11:30:22 +0000 (12:30 +0100)]
x87: Simplify sim_Fucom().

Whether the operands are permuted can be deduced by testing op1_idx != 0.

11 years agox87: Simplify selecting the instruction and popping the operands in sim_Fucom().
Christoph Mallon [Wed, 14 Nov 2012 12:05:13 +0000 (13:05 +0100)]
x87: Simplify selecting the instruction and popping the operands in sim_Fucom().

11 years agox87: Do not set x87 attributes, which are not used.
Christoph Mallon [Tue, 13 Nov 2012 09:28:36 +0000 (10:28 +0100)]
x87: Do not set x87 attributes, which are not used.

11 years agoLet be_foreach_definition() declare the value variable.
Christoph Mallon [Tue, 13 Nov 2012 09:12:55 +0000 (10:12 +0100)]
Let be_foreach_definition() declare the value variable.

11 years agoRemove the very thin wrapper function arch_register_get_class().
Christoph Mallon [Tue, 13 Nov 2012 08:46:59 +0000 (09:46 +0100)]
Remove the very thin wrapper function arch_register_get_class().

11 years agoRemove the very thin wrapper function arch_register_get_index().
Christoph Mallon [Tue, 13 Nov 2012 08:39:30 +0000 (09:39 +0100)]
Remove the very thin wrapper function arch_register_get_index().

11 years agoRemove the very thin wrapper function arch_register_get_name().
Christoph Mallon [Tue, 13 Nov 2012 08:27:30 +0000 (09:27 +0100)]
Remove the very thin wrapper function arch_register_get_name().

11 years agojumpthreading: when copying kept nodes keep the copies
Matthias Braun [Mon, 12 Nov 2012 16:16:54 +0000 (17:16 +0100)]
jumpthreading: when copying kept nodes keep the copies

11 years agomake jumpthreading debug message less confusing
Matthias Braun [Mon, 12 Nov 2012 16:17:28 +0000 (17:17 +0100)]
make jumpthreading debug message less confusing

11 years agoonly create jmp/bad when replacing exception throwing loads
Matthias Braun [Mon, 12 Nov 2012 13:44:43 +0000 (14:44 +0100)]
only create jmp/bad when replacing exception throwing loads

11 years agoMakefile: cleanup, add -fomit-frame-pointer to optimize
Matthias Braun [Mon, 12 Nov 2012 13:14:10 +0000 (14:14 +0100)]
Makefile: cleanup, add -fomit-frame-pointer to optimize

11 years agoadd coverage build variant to Makefile
Matthias Braun [Sat, 10 Nov 2012 17:03:10 +0000 (18:03 +0100)]
add coverage build variant to Makefile

11 years agoMerge the (single) pop and non-pop variants of x87 compare operations.
Christoph Mallon [Sun, 11 Nov 2012 10:44:24 +0000 (11:44 +0100)]
Merge the (single) pop and non-pop variants of x87 compare operations.

Let a flag and the emitter handle printing the pop variant.

11 years agoMerge the pop and non-pop variants of x87 store operations.
Christoph Mallon [Sun, 11 Nov 2012 10:14:39 +0000 (11:14 +0100)]
Merge the pop and non-pop variants of x87 store operations.

Let a flag and the emitter handle printing the pop variant.

11 years agoMerge the pop and non-pop variants of x87 binary operations.
Christoph Mallon [Sun, 11 Nov 2012 09:47:21 +0000 (10:47 +0100)]
Merge the pop and non-pop variants of x87 binary operations.

Let a flag and the emitter handle printing the pop variant.

11 years agoMerge the r and non-r variants of fdiv and fsub.
Christoph Mallon [Sun, 11 Nov 2012 09:07:05 +0000 (10:07 +0100)]
Merge the r and non-r variants of fdiv and fsub.

Let the emitter handle printing the r by checking the assigned registers.

11 years agoRemove unnecessary tests.
Christoph Mallon [Sat, 10 Nov 2012 20:00:45 +0000 (21:00 +0100)]
Remove unnecessary tests.

out cannot be null.

11 years agoPanic when asked to simulate a vfprem.
Christoph Mallon [Sun, 11 Nov 2012 09:13:23 +0000 (10:13 +0100)]
Panic when asked to simulate a vfprem.

Simulating it as normal binop does only work in one special case.
It lacks the reverse form and selecting the second operand register.
So in many cases invalid code was generated silently.

11 years agoCorrect some off-by-one errors in ia32_emitf().
Christoph Mallon [Sat, 10 Nov 2012 19:58:33 +0000 (20:58 +0100)]
Correct some off-by-one errors in ia32_emitf().

11 years agoImplement binary emitter for ia32 bt.
Christoph Mallon [Sun, 11 Nov 2012 22:17:00 +0000 (23:17 +0100)]
Implement binary emitter for ia32 bt.

11 years agoFake a binary emitter for ia32 asm.
Christoph Mallon [Sun, 11 Nov 2012 22:06:41 +0000 (23:06 +0100)]
Fake a binary emitter for ia32 asm.

11 years agoImplement binary emitter for ia32 fisttp.
Christoph Mallon [Sun, 11 Nov 2012 21:51:02 +0000 (22:51 +0100)]
Implement binary emitter for ia32 fisttp.

11 years agoImplement binary emitter for ia32 popcnt.
Christoph Mallon [Sun, 11 Nov 2012 21:47:12 +0000 (22:47 +0100)]
Implement binary emitter for ia32 popcnt.

11 years agoImplement binary emitter for ia32 bswap.
Christoph Mallon [Sun, 11 Nov 2012 21:46:53 +0000 (22:46 +0100)]
Implement binary emitter for ia32 bswap.

11 years agoImplement binary emitter for ia32 sbb0.
Christoph Mallon [Sun, 11 Nov 2012 21:46:26 +0000 (22:46 +0100)]
Implement binary emitter for ia32 sbb0.

11 years agoImplement binary emitter for ia32 ffreep.
Christoph Mallon [Sun, 11 Nov 2012 21:45:14 +0000 (22:45 +0100)]
Implement binary emitter for ia32 ffreep.

11 years agoFactorise code for binary emitters of ia32 fp operation with fp register.
Christoph Mallon [Sun, 11 Nov 2012 21:44:03 +0000 (22:44 +0100)]
Factorise code for binary emitters of ia32 fp operation with fp register.

11 years agoSimply emit nothing for ia32 Unknown.
Christoph Mallon [Sun, 11 Nov 2012 21:42:49 +0000 (22:42 +0100)]
Simply emit nothing for ia32 Unknown.

11 years agoImplement binary emitters for ia32 bsf and bsr.
Christoph Mallon [Sun, 11 Nov 2012 21:41:58 +0000 (22:41 +0100)]
Implement binary emitters for ia32 bsf and bsr.

11 years agoFactorise code of binary emitters for ia32 unops with 0F prefix.
Christoph Mallon [Sun, 11 Nov 2012 21:34:58 +0000 (22:34 +0100)]
Factorise code of binary emitters for ia32 unops with 0F prefix.

11 years agoCorrect bemit_${OP}() and bemit_${OP}mem().
Christoph Mallon [Sun, 11 Nov 2012 21:32:43 +0000 (22:32 +0100)]
Correct bemit_${OP}() and bemit_${OP}mem().

11 years agoUse edges_reroute_except() instead of edges_reroute() + set_irn_n().
Christoph Mallon [Sat, 10 Nov 2012 15:43:27 +0000 (16:43 +0100)]
Use edges_reroute_except() instead of edges_reroute() + set_irn_n().

11 years agoClaim that AMD family 12h, 14h and 15h are K10.
Christoph Mallon [Sat, 10 Nov 2012 14:48:06 +0000 (15:48 +0100)]
Claim that AMD family 12h, 14h and 15h are K10.

11 years agoFix calculation of x86 CPU family.
Christoph Mallon [Sat, 10 Nov 2012 14:26:17 +0000 (15:26 +0100)]
Fix calculation of x86 CPU family.

It is just the sum of family and extended family.

11 years agoconvopt: also perform convopt for float nodes
Matthias Braun [Fri, 9 Nov 2012 17:27:44 +0000 (18:27 +0100)]
convopt: also perform convopt for float nodes

11 years agoia32: allow Minus, Phi in any float mode
Matthias Braun [Fri, 9 Nov 2012 17:27:28 +0000 (18:27 +0100)]
ia32: allow Minus, Phi in any float mode

11 years agoia32: we can skip float downconvs before stores
Matthias Braun [Fri, 9 Nov 2012 16:40:44 +0000 (17:40 +0100)]
ia32: we can skip float downconvs before stores

11 years agoRemove further keep-edge hacks for endless loops.
Christoph Mallon [Thu, 8 Nov 2012 15:26:00 +0000 (16:26 +0100)]
Remove further keep-edge hacks for endless loops.

11 years agoRemove the unused function get_irn_pred_pos().
Christoph Mallon [Sat, 4 Aug 2012 07:30:15 +0000 (09:30 +0200)]
Remove the unused function get_irn_pred_pos().

11 years agoRemove keep-edge hacks for endless loop.
Christoph Mallon [Thu, 8 Nov 2012 07:21:09 +0000 (08:21 +0100)]
Remove keep-edge hacks for endless loop.

It is the job of the frontend to keep loops.
These hacks here only worked for some, but not all cases.
In particular a more clever SSA-construction algorithm might not place redundant PhiMs, which would render memory before memory-less loops unkept.

11 years agoSimplify code generator and generated code using C99.
Christoph Mallon [Wed, 7 Nov 2012 07:14:35 +0000 (08:14 +0100)]
Simplify code generator and generated code using C99.

11 years agoRemove redundant assert().
Christoph Mallon [Wed, 7 Nov 2012 06:58:20 +0000 (07:58 +0100)]
Remove redundant assert().

get_irn_op_() checks the same.

11 years agoFix typos in comments.
Christoph Mallon [Wed, 7 Nov 2012 06:57:38 +0000 (07:57 +0100)]
Fix typos in comments.

11 years agoInline x87_set_tos() into its only caller.
Christoph Mallon [Mon, 5 Nov 2012 13:50:18 +0000 (14:50 +0100)]
Inline x87_set_tos() into its only caller.

11 years agoRemove cruft from sim_Copy().
Christoph Mallon [Sun, 4 Nov 2012 19:35:36 +0000 (20:35 +0100)]
Remove cruft from sim_Copy().

11 years agoRemove redundant assert.
Christoph Mallon [Sun, 4 Nov 2012 14:37:16 +0000 (15:37 +0100)]
Remove redundant assert.

sched_add_after() checks this, too.

11 years agoRemove the unused return value from x87_create_fxch().
Christoph Mallon [Sat, 3 Nov 2012 19:01:38 +0000 (20:01 +0100)]
Remove the unused return value from x87_create_fxch().

11 years agoGet rid of x87_push_dbl() by passing an usable register to x87_create_fpush().
Christoph Mallon [Sat, 3 Nov 2012 13:53:34 +0000 (14:53 +0100)]
Get rid of x87_push_dbl() by passing an usable register to x87_create_fpush().

11 years agoDo not add a Proj to the schedule.
Christoph Mallon [Sat, 3 Nov 2012 12:43:01 +0000 (13:43 +0100)]
Do not add a Proj to the schedule.

I wonder, how long this code was not executed.