Commit Graph

215 Commits

Author SHA1 Message Date
Jeppe Johansen
ffe67a93b4 Fix is_calljmp to include call instructions. This was breaking some optimizations previously.
Add debug messages to peephole optimizations and add some extra optimizations.

git-svn-id: trunk@31244 -
2015-07-30 06:29:21 +00:00
Jeppe Johansen
55669f62b1 Added most AVR controllers.
Made absolutevarsym use PUint instead of AWord for its offset to fix range errors.

git-svn-id: trunk@31242 -
2015-07-29 21:01:21 +00:00
florian
d014572b8e * do not use an extra register, if CPC does a comparison with 0,
this was previously "fixed" by the peephole optimizer, but this increased
  register pressure

git-svn-id: trunk@31239 -
2015-07-27 19:49:05 +00:00
florian
df999735f3 * use R1 in comparisons if left=0 instead of loading 0 into (a) register(s)
git-svn-id: trunk@31238 -
2015-07-27 19:49:03 +00:00
florian
cf64e05c6f * use generic mod/div code for avr
git-svn-id: trunk@31194 -
2015-07-05 17:05:43 +00:00
florian
af6ffd751f + generate optimized code for shifts/rotates by constants
git-svn-id: trunk@31170 -
2015-06-28 20:28:51 +00:00
Jonas Maebe
f402b0d7df * changed getpointerdef() into a tpointerdef.getreusable() class method
o allows removing the ugly x86 hacks

git-svn-id: trunk@31144 -
2015-06-22 08:17:49 +00:00
florian
c0dd2047f9 * cosmetics, entries are now properly aligned
git-svn-id: trunk@31039 -
2015-06-13 16:55:36 +00:00
Jeppe Johansen
ab9c8bb569 Fixed startup assembler code for the case where there's no data in .bss and/or in .data.
Fixed _stack_top symbol calculation so it works for all controllers.
Added ATTINY2313 controller.

git-svn-id: trunk@31031 -
2015-06-13 12:30:50 +00:00
Jeppe Johansen
03880c2f74 Added some peephole optimizations, and fixed generic unconditional jump optimizations, for AVR.
Fixed multiplication code generation for AVR controllers without mul instructions.
Added handling of the old interrupt procedure directive such that procedures with that use RETI instead of RET.

git-svn-id: trunk@31030 -
2015-06-13 12:25:11 +00:00
florian
b1147ba1b7 + OpCmp2Op optimization for AVR
git-svn-id: trunk@31013 -
2015-06-09 21:06:37 +00:00
florian
9216e561e2 + make use of sbi/cbi
git-svn-id: trunk@30964 -
2015-05-31 21:11:53 +00:00
florian
a3553a7320 + adds missing ct_atmega168 and ct_atmega368 symbols, thanks to mischi
git-svn-id: trunk@30960 -
2015-05-31 17:59:39 +00:00
florian
cf552b2a0b + ATmeag168/ATmeag368 support
git-svn-id: trunk@30938 -
2015-05-30 18:01:14 +00:00
florian
0cd521fc8b + ATmega48/ATmega88 support
git-svn-id: trunk@30937 -
2015-05-30 17:55:49 +00:00
florian
aadcf9f6bc * do not convert JMP into RJMP in assembler blocks, resolves issue #280208
git-svn-id: trunk@30936 -
2015-05-30 16:17:24 +00:00
florian
d58d7b7838 * fixes breakage of r30930 (+ ATtiny24/ATtiny44/ATtiny84 support)
git-svn-id: trunk@30932 -
2015-05-28 21:15:00 +00:00
florian
0f73675354 + ATtiny24/ATtiny44/ATtiny84 support
git-svn-id: trunk@30930 -
2015-05-28 21:10:39 +00:00
florian
b4fc11fe06 * implemented r30870 for all platforms: pass dyn. array parameters like pointer parameters so typically in a register
git-svn-id: trunk@30878 -
2015-05-17 12:29:28 +00:00
florian
f5edf77a05 + Atmega8 support
git-svn-id: trunk@30768 -
2015-05-02 18:18:00 +00:00
florian
9a5b458d4e * allocate registers properly before icall
* use emit_mov to load registers before icall

git-svn-id: trunk@30758 -
2015-05-02 08:02:17 +00:00
florian
7dd1d6aa77 o fixes handling of iso i/o parameters/program parameters:
* explicit reset is needed
  * variable must be declared again

git-svn-id: trunk@30757 -
2015-05-01 20:58:31 +00:00
florian
d1e48b0f71 * correctly handle parameters on the stack with OS_NO
git-svn-id: trunk@30756 -
2015-05-01 17:14:07 +00:00
florian
d3fbfa225f * fixes ordinal comparisons with constants
git-svn-id: trunk@30751 -
2015-05-01 16:30:21 +00:00
florian
e56d8d1c96 * fix mov rX,...; mov rX,... optimization, hp1 needs to be checked if it is really an instruction, resolves issue #27975
git-svn-id: trunk@30738 -
2015-04-27 20:36:53 +00:00
florian
3282ff0506 + remove dead moves, resolves issue #27842
git-svn-id: trunk@30735 -
2015-04-26 20:13:09 +00:00
florian
5c8d0d87cd o better code generation for avr:
* omit entry/exit code, if no frame pointer is used, partly fixes issue #27842
  * take advantage of adiw/sbiw
  * make more often use of ldd/std

git-svn-id: trunk@30732 -
2015-04-26 19:39:43 +00:00
florian
634a25d9f6 * cosmetics
git-svn-id: trunk@30731 -
2015-04-26 19:35:32 +00:00
florian
652f623983 * mulsu opcode spelling fixed
* handling mulsu in taicpu.spilling_get_operation_type

git-svn-id: trunk@30729 -
2015-04-26 16:08:52 +00:00
florian
40dc34b9d8 * several issues with the avr instruction table fixes, resolves issue #27963
git-svn-id: trunk@30727 -
2015-04-25 21:33:19 +00:00
Jeppe Johansen
2dae6a2dd7 Added predecrement addressing support to the AVR assembler reader
git-svn-id: trunk@30706 -
2015-04-24 17:25:57 +00:00
florian
1969abec77 * improved code generation in a_op_const_reg_internal and a_op_const_reg_reg
git-svn-id: trunk@30662 -
2015-04-19 12:51:53 +00:00
florian
7f1585b99a * do not save registers for subroutines which never return
* do not generate any exit code for subroutines which never return

git-svn-id: trunk@30657 -
2015-04-19 08:11:28 +00:00
florian
987b66636d + optimize LDS/STS into IN/OUT, resolves issue #27884
git-svn-id: trunk@30649 -
2015-04-18 14:43:54 +00:00
florian
9e51283ae0 + initial a_op_const_reg_reg and a_op_reg_reg_reg implementations to generate optimized 16 Bit multiplications on avr
git-svn-id: trunk@30648 -
2015-04-18 13:53:20 +00:00
florian
3e8766290d * implements RegInInstruction and fixes RegModifiedByInstruction for avr
git-svn-id: trunk@30647 -
2015-04-18 13:51:28 +00:00
florian
58c66b4759 * the mul instructions do not modify the operands
git-svn-id: trunk@30633 -
2015-04-17 20:15:10 +00:00
florian
66e97549b9 * replace jmp by rjmp if possible, resolves issue #27885
git-svn-id: trunk@30632 -
2015-04-17 20:14:18 +00:00
florian
e733efbbc2 * proper tavrprocinfo.calc_stackframe_size
git-svn-id: trunk@30597 -
2015-04-14 20:48:13 +00:00
florian
cf58a7ad60 * cosmetics
git-svn-id: trunk@30595 -
2015-04-14 20:47:26 +00:00
florian
b84657980d * make OS_INT/OS_SINT 8 Bit on avr, should work better on avr, resolves #27840
git-svn-id: trunk@30593 -
2015-04-14 18:51:21 +00:00
florian
e559b9e3d6 + tavrshlshrnode.second_integer, does not convert the right operand to a bigger type, resolves #27841
git-svn-id: trunk@30579 -
2015-04-13 20:57:37 +00:00
florian
8b7a449cf1 * clear r1 after 8 Bit multiplication, resolves #27838
git-svn-id: trunk@30578 -
2015-04-13 20:15:30 +00:00
florian
4d01271944 * due to avr's harvard architecture, loads of code labels need to use the gs(...) macro
git-svn-id: trunk@30559 -
2015-04-12 20:29:13 +00:00
florian
1f20a52c85 * fix typo in comparison with constant code
git-svn-id: trunk@30556 -
2015-04-12 15:42:40 +00:00
florian
bd803769b8 * fix compilation
git-svn-id: trunk@30554 -
2015-04-12 14:58:41 +00:00
florian
9559dabe51 * function result is in r24:r25
git-svn-id: trunk@30549 -
2015-04-11 21:25:05 +00:00
florian
e34bd746ed * patch by Jeppe Johanse to take care of the fact that push is post-decrement on avr
git-svn-id: trunk@30548 -
2015-04-11 20:59:27 +00:00
florian
1ef7e36f3c * some fixes for handling parameters passed on the stack
git-svn-id: trunk@30545 -
2015-04-11 13:56:21 +00:00
florian
276d97f653 * generate better code for comparisons with constants
git-svn-id: trunk@30543 -
2015-04-11 13:52:29 +00:00