Commit Graph

236 Commits

Author SHA1 Message Date
Jonas Maebe
74a49b5f91 * restructured the the TExternalAssembler constructors so that the
hack for the Jasmin descendent is no longer needed

git-svn-id: trunk@34852 -
2016-11-09 19:51:20 +00:00
pierre
89c1b68b14 * Delete regvars unit.
This unit was empty unless OLDREGVARS macro was set,
    but this does not compile and no change has been made since 2011.

  * Remove regvars from all _USES clauses.

git-svn-id: trunk@34808 -
2016-11-06 14:01:39 +00:00
Jonas Maebe
0afbe85aab * various memory reference alignment fixes
git-svn-id: trunk@34544 -
2016-09-20 21:43:19 +00:00
Jonas Maebe
aa1be3276f - removed default value of _typ parameter of TAsmData.(Weak)RefAsmSymbol():
it was AT_NONE, which is invalid and should never be used
  * explicitly pass the correct value for all calls to those methods elsewhere
    in the compiler

git-svn-id: trunk@34250 -
2016-08-05 07:09:16 +00:00
Jonas Maebe
a0efde8167 * automatically generate necessary indirect symbols when a new assembler
symbol is defined
   o removed all places where AB_INDIRECT symbols were explicitly generated
   o only generate AB_INDIRECT symbols for AT_DATA on systems_indirect_var_imports
   o for some symbols an indirect symbol is always required (because they are
     dereferenced by code in RTL units) -> use new AT_DATA_FORCEINDIRECT type

git-svn-id: trunk@34165 -
2016-07-20 20:53:03 +00:00
Jonas Maebe
1cb8c0d00c * specify the def of assembler level symbols defined via
tasmdata.DefineAsmSymbol() and all routines that call it
   o will be used to automatically generate AB_INDIRECT sybols when
     necessary

git-svn-id: trunk@34164 -
2016-07-20 20:52:59 +00:00
florian
b2f15e2736 * first check for ait_instruction before checking opcode
git-svn-id: trunk@33693 -
2016-05-16 13:10:20 +00:00
florian
56b6cedcf4 * increase ram size of the avrsim controller target
git-svn-id: trunk@33066 -
2016-02-07 11:17:55 +00:00
Jonas Maebe
110a5642c0 - removed ait_weak/tai_weak, and replaced it with the previously existing
asd_weak_reference/asd_weak_definition directives

git-svn-id: trunk@32879 -
2016-01-07 22:05:38 +00:00
florian
bd20c5a66b * set a proper sram base for the avrsim controller type
git-svn-id: trunk@32647 -
2015-12-12 22:37:41 +00:00
Jeppe Johansen
159c28eca8 Fix AVR comparison with zero.
git-svn-id: trunk@32589 -
2015-12-05 15:25:33 +00:00
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