Commit Graph

45 Commits

Author SHA1 Message Date
florian
aec49340a3 * patch by Christo Crause, resolves #38961, fixes the following formatting and spelling problems in the AVR compiler files:
- Change spelling of AM_PREDRECEMENT to AM_PREDECREMENT
    - Fix multiline comment style to use {}
    - Fix indenting of code in method tcgavr.g_concatcopy

git-svn-id: trunk@49474 -
2021-06-04 20:16:25 +00:00
florian
022a9b210f + AVR: avr_des intrinsic
git-svn-id: trunk@49353 -
2021-05-13 09:26:53 +00:00
florian
37a3b542e6 * avr: patch by Christo Crause: replace findreg_by_gasname with gas_regname_table, resolves #37131
git-svn-id: trunk@45509 -
2020-05-26 19:52:19 +00:00
florian
26eae3672b + AVR: GetDefaultZeroReg and GetDefaultTmpReg
git-svn-id: trunk@43985 -
2020-01-19 15:55:23 +00:00
florian
96a4cda03b * AVR: fixes pushing and handling of stack passed parameters
git-svn-id: trunk@43983 -
2020-01-19 15:55:21 +00:00
florian
e1e8986462 * patch by J. Gareth Moreton, issue #36271, part 3: support for the other architectures
git-svn-id: trunk@43441 -
2019-11-10 16:11:40 +00:00
florian
69786ffe73 somehow committing went wrong, second part of last commit:
+ AArch64: support for vX.8b/vX.16b register names
+ support for more than 256 registers in the register dat files
- removed totherregisterset
+ AArch64: use vmov to load immediates if possible
+ AArch64: use eor to clear mm registers

git-svn-id: trunk@42917 -
2019-09-03 21:07:33 +00:00
Jonas Maebe
bfc7c58a69 * synchronised with trunk till r40348
git-svn-id: branches/debug_eh@40349 -
2018-11-18 12:01:50 +00:00
florian
42e54c1ad5 * max_operands needs only to be 2 on avr
git-svn-id: trunk@40197 -
2018-11-03 10:39:58 +00:00
Jonas Maebe
8555ec1438 + fpc_eh_return_data_regno() intrinsic to get the return register numbers
for the Dwarf EH exception handler result

git-svn-id: branches/debug_eh@40070 -
2018-10-28 18:16:38 +00:00
pierre
92acd38f40 Fix for bug report #34380
git-svn-id: trunk@39986 -
2018-10-18 20:21:54 +00:00
nickysn
518cdf9674 * replaced the saved_XXX_registers arrays with virtual methods inside
tcpuparamanager, very similar to the existing get_volatile_registers_XXX. The
  new methods are called get_saved_registers_XXX, where XXX is the register
  type ("int", "address", "fpu" or "mm")

git-svn-id: trunk@38794 -
2018-04-19 21:22:16 +00:00
nickysn
ddba821561 * GetNextReg(), used by 16-bit and 8-bit code generators (i8086 and avr) moved
from cpubase unit to a method in the tcg class. The reason for doing that is
  that this is now a standard part of the 16-bit and 8-bit code generators and
  moving to the tcg class allows doing extra checks (not done yet, but for
  example, in the future, we can keep track of whether there was an extra
  register allocated with getintregister and halt with an internalerror in case
  GetNextReg() is called for registers, which weren't allocated as a part of a
  sequence, therefore catching a certain class of 8-bit and 16-bit code
  generator bugs at compile time, instead of generating wrong code).
- removed GetLastReg() from avr's cpubase unit, because it isn't used for
  anything. It might be added to the tcg class, in case it's ever needed, but
  for now I've left it out.
* GetOffsetReg() and GetOffsetReg64() were also moved to the tcg unit.

git-svn-id: trunk@37180 -
2017-09-11 14:53:06 +00:00
nickysn
1476b5168d + added F_PL and F_MI to TResFlags for avr. This allows generating the BRPL and
BRMI instructions via a_jmp_cond

git-svn-id: trunk@36866 -
2017-08-09 15:14:33 +00:00
florian
c86bac021b + xch instruction for avr
git-svn-id: trunk@34919 -
2016-11-19 19:21:09 +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
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
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
2b9c0ef3b4 - jmp_instructions shouldn't include call/ret instructions
git-svn-id: trunk@30442 -
2015-04-05 19:11:40 +00:00
Jeppe Johansen
e33550b67d Added support for X,Y,and Z register aliases plus low/high forms, and post-incrementation in AVR assembler reader.
Cleaned up parameter and funcretloc information generation in AVR paramanger, and made it closer to GCC's calling convention.
Fixed a number of codegenerator bugs generating invalid or broken instructions: CP operands were swapped, a number of instructions had immediate operands, and stack frame epilogue wasn't complete.
Added a bunch of peephole optimizations that clears the generated code up a lot.

git-svn-id: trunk@26925 -
2014-03-02 15:37:24 +00:00
svenbarth
c48d572996 Implement support for saving and restoring address registers.
cgobj.pas, tcg:
  * g_save_registers: add the amount of used address registers to size as well
  * g_save_registers: save all used address registers
  * g_restore_registers: restore all stored address registers
m68k/cpubase.pas:
  * rename saved_standard_address_registers to saved_address_registers
all other platform's cpubase.{inc,pas} (except alpha, ia64 and vis which are not up to date):
  * add a saved_address_registers variable with one entry of RS_INVALID

At least a "make fullcycle" did complete.

git-svn-id: trunk@25664 -
2013-10-05 21:43:42 +00:00
florian
d1b2a7732a + GetOffsetReg64
git-svn-id: trunk@22837 -
2012-10-23 20:16:13 +00:00
masta
e327b4581c Use TRegNameTable instead of array[tregisterindex] of string[10]
TRegNameTable is defined in compiler/rgbase.pas and is an array of
strings, limited to the maximum length of the used register names.

r22792 added a long register name but did not scale the string-size
enough, resulting in the compiler built breaking for arm.

git-svn-id: trunk@22817 -
2012-10-22 10:23:21 +00:00
Jeppe Johansen
0087661fb5 Added FPv4_d16 FPU instructions, and a few extra registers
git-svn-id: branches/laksen/arm-embedded@22596 -
2012-10-08 20:04:14 +00:00
florian
4dee21c60e + NR_DEFAULTFLAGS and RS_DEFAULTFLAGS for all CPUs with flags added
git-svn-id: trunk@22181 -
2012-08-22 19:38:27 +00:00
Jonas Maebe
708a2532fc * consistently define empty saved_mm_registers arrays as containing a single
RS_INVALID superregister (instead of sometimes RS_NO and sometimes
    RS_INVALID)
  * check for RS_INVALID in tcg.g_save_registers() and ignore such entries

git-svn-id: trunk@21622 -
2012-06-15 18:24:25 +00:00
Jonas Maebe
85a3fd3357 + ossinttype/osuinttype defs that correspond to OS_SINT/OS_INT for use in
the high level code generator

git-svn-id: trunk@21279 -
2012-05-12 16:03:15 +00:00
Jonas Maebe
ac43eb9b70 + generic implementation of ReplaceForbiddenAsmSymbolChars() instead
of the AVR-specific ifdef'ed variant
   o since the only special character we use in mangled names on all platforms
     is $, added a new field to tasminfo called "dollarsign" that holds the
     character $'s should be replaced with (if it doesn't have to be replaced,
     leave it at $)

git-svn-id: trunk@20801 -
2012-04-11 18:01:57 +00:00
florian
f1f0cb033a * move ReplaceForbiddenChars to cpubase of avr so it can be used in dbgstabs as well
* tried to fix dbgstabs so that it doesn't emit illegal chars using ReplaceForbiddenChars, however, dbgstabs accesses symbol names quite often, so this failed

git-svn-id: trunk@18972 -
2011-09-04 19:36:43 +00:00
florian
ff5f311b34 - removed no more used constants
git-svn-id: trunk@18199 -
2011-08-13 20:54:01 +00:00
pierre
37b98917e0 * Handle invalid register correctly
git-svn-id: trunk@17894 -
2011-07-01 11:52:37 +00:00
florian
8d960cb608 + implementation of shifting operations for avr
* handle shl/shr operand size correctly

git-svn-id: branches/avr@17109 -
2011-03-09 19:48:01 +00:00
florian
86f587b02f + added more avr instructions
git-svn-id: branches/avr@17050 -
2011-02-27 21:12:19 +00:00
florian
b870a6eff5 * started to fix parameter passing
* fixed entry/exit code generation

git-svn-id: branches/avr@17041 -
2011-02-27 21:05:53 +00:00
florian
dc0638c4d2 * corrected volatile registers for avr
git-svn-id: branches/avr@17039 -
2011-02-27 21:03:28 +00:00
florian
ef699b1864 + avr flag and condition handling
git-svn-id: trunk@17016 -
2011-02-26 20:15:03 +00:00
florian
db2600d40b + first primitive concatcopy implementation
+ implemented op_const_reg and load_const_reg
+ implemented op_reg_reg
* set register info values correctly

git-svn-id: trunk@17014 -
2011-02-26 20:13:19 +00:00
florian
fd97ce0109 * removed some arm overlefts
git-svn-id: trunk@17010 -
2011-02-26 20:09:21 +00:00
florian
26ce3cef00 * compilation fixes
* completed a_load_ref_reg
+ implemented procedure entry/exit code generation
+ implemented a_load_reg_ref

git-svn-id: trunk@17009 -
2011-02-26 20:08:23 +00:00
florian
8b245369e1 + implemented normalize_ref
git-svn-id: trunk@17008 -
2011-02-26 20:03:39 +00:00
florian
4cfc5693c5 * fix compilation for avr
* some ideas for avr register management
+ initial implementation of a_load_reg_reg

git-svn-id: trunk@17007 -
2011-02-26 20:02:45 +00:00
Jonas Maebe
34c985cfa6 * added register type parameter to cgsize2subreg(), as the subreg can
depend on that (and correct a number of cases where this was wrong)
  * set the correct subreg type for xmm x86_64 parameter registers
    (resolved mantis #14067)

git-svn-id: trunk@13410 -
2009-07-19 13:57:23 +00:00
yury
491f0fa1d8 * Replaced all user defined warnings by TODO comments to reduce compiler noise.
git-svn-id: trunk@11443 -
2008-07-23 11:00:03 +00:00
florian
0e13d07a31 + more avr code
git-svn-id: trunk@10207 -
2008-02-04 19:50:22 +00:00
florian
bc73f9021c Merged revisions 5891-10167,10169-10180 via svnmerge from
http://svn.freepascal.org/svn/fpc/branches/avr

........
  r5891 | florian | 2007-01-11 17:30:12 +0100 (Do, 11 Jan 2007) | 2 lines
  
  + some initial work
........
  r10170 | florian | 2008-02-03 11:02:04 +0100 (So, 03 Feb 2008) | 2 lines
  
  * continued to work on avr port
........
  r10180 | florian | 2008-02-03 15:29:30 +0100 (So, 03 Feb 2008) | 2 lines
  
  + a lot of skeleton code for avr added
........

git-svn-id: trunk@10186 -
2008-02-03 17:21:52 +00:00