Commit Graph

225 Commits

Author SHA1 Message Date
Jeppe Johansen
5ec4d38231 Add support for ram-less AVR chips and simultanously optimize flash/ram size the initfinal calling sequence.
git-svn-id: trunk@32448 -
2015-11-22 00:37:10 +00:00
Jeppe Johansen
baae6ec169 Fix incorrect AVR optimization.
git-svn-id: trunk@32441 -
2015-11-21 16:53:56 +00:00
Jonas Maebe
fa3b0ca312 * support marking defs created via the getreusable*() class methods as
"don't free even if not registered"; use for defs that may not be written
    to a ppu file, but that must nevertheless survive the compilation of the
    current module
  * mark all defs created for para locations as "don't free even if not
    registered", because we don't discard and recalculate all para locations
    after a module has been compiled (since that's not needed)
   o solves issues if the paralocations for a routine in the interface of
     unit A are calculated while the implementation of unit B gets
     compiled, and a new reusable type is allocated at that point which
     is not used anywhere else (after r32160)

git-svn-id: trunk@32235 -
2015-11-04 20:46:18 +00:00
Jeppe Johansen
14020b044c Fix bug in gen_load_cgpara_loc for 64bit registers on 8bit architectures.
Added a workaround in a_load_const_reg to allow compilation for AVR.

git-svn-id: trunk@32090 -
2015-10-18 11:36:58 +00:00
Jeppe Johansen
1a285a7d24 Fixed an off-by-one error in a_load_const_cgpara which caused some problems.
Added some minor CG optimizations.

git-svn-id: trunk@32088 -
2015-10-18 11:03:57 +00:00
Jeppe Johansen
7fc3ed2644 Fix a broken OpCp2Op optimization. It needed the added NR_DEFAULTFLAGS allocation to not break subsequent optimizations.
Updated the code for a_load_const_cgpara in case it needed stack parameters. This was completely broken before. Now it should allow things to compile at least.

git-svn-id: trunk@32086 -
2015-10-17 23:29:15 +00:00
Jonas Maebe
991e1f49bd * store a pointer to the used tasminfo record in every assembler writer, so
that we can use assembler writers with different conventions from the
    currently set target_asm (e.g. an x86 assembler writer for inline assembly
    in LLVM IR)

git-svn-id: trunk@31628 -
2015-09-12 23:32:13 +00:00
Jonas Maebe
b3d0197f98 * factored out the output file handling (mostly writing data) from the
external assembler writer, so we can reuse the archtecture-specific
    writers to write inline assembly in LLVM IR files

git-svn-id: trunk@31625 -
2015-09-12 23:32:01 +00:00
Jeppe Johansen
3cb9be73bc Moved tcontrollerdatatype out into cpuinfo.
Added cputype and fputype info to tcontrollerdatatype arrays.

git-svn-id: trunk@31574 -
2015-09-07 20:36:54 +00:00
Jonas Maebe
10b2ea3b1b * use handle_locjump() instead of local inlined version
git-svn-id: trunk@31430 -
2015-08-27 18:28:52 +00:00
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