Commit Graph

423 Commits

Author SHA1 Message Date
florian
84cfa8d9b0 * AVR: for avr1 lds/sts must be converted to in/out as well if possible
git-svn-id: trunk@44138 -
2020-02-09 13:55:25 +00:00
florian
297d6e2c60 * patch by Christo Crause: more avr1 controllers and remove attiny28 from avr25 makefile list, resolves #36686
git-svn-id: trunk@44136 -
2020-02-09 10:51:14 +00:00
florian
a905a074b0 * AVR: decide after compiler if a certain subroutine is suitable for avr1, if not, replace it by sleep and warn
git-svn-id: trunk@44133 -
2020-02-08 22:05:21 +00:00
florian
dea63e3d61 * AVR: attiny28 is an avr1 CPU
git-svn-id: trunk@44132 -
2020-02-08 22:05:21 +00:00
florian
04ad607bb4 * patch by Christo Crause: more AVR controllers, resolves #36683
git-svn-id: trunk@44130 -
2020-02-08 20:43:22 +00:00
florian
5040e31f11 * patch by Christo Crause: add missing atmega-PB controllers, resolves #36667
git-svn-id: trunk@44128 -
2020-02-07 19:48:46 +00:00
florian
e033269deb * patch by Christo Craus to reorder the avr controllers for better overview, resolves #36662
git-svn-id: trunk@44124 -
2020-02-06 21:10:09 +00:00
florian
4fe21a8e1a * patch by Christo Crause: board aliases to onboard controllers, resolves #36659
git-svn-id: trunk@44111 -
2020-02-04 21:14:14 +00:00
florian
640fe9c290 * actually, with lds/sts avrtiny can load addresses up to 191
git-svn-id: trunk@44104 -
2020-02-02 20:41:28 +00:00
florian
36058ca4d4 * based on a patch by Christo Crause: more compiler fixes for avrtiny, resolves #36646
git-svn-id: trunk@44103 -
2020-02-02 20:35:29 +00:00
florian
00214406bc + patch by Christo Crause: Support for attiny10x controllers, resolves #36645
git-svn-id: trunk@44081 -
2020-02-01 15:54:57 +00:00
Jonas Maebe
592df7fa59 * disable cs_opt_regvar on all platforms when compiled for LLVM (LLVM does
that itself, our LLVM code generator can't handle it, and if it did then
    afterwards we would have to spill 90% of those register variables again
    to make them SSA)

git-svn-id: trunk@44062 -
2020-01-29 22:21:07 +00:00
florian
670c61e760 * patch by Christo Crause: support for megaAVR 0 and tinyAVR 0/1, #36616, part 1/3
git-svn-id: trunk@44036 -
2020-01-26 14:35:26 +00:00
florian
d2a059bd02 * patch by Christo Crause: avrtiny26 controller is not subarch avr25 but avr2, resolves #36620
git-svn-id: trunk@44021 -
2020-01-22 20:41:24 +00:00
florian
3ab8830b83 * patch by Christo Crause: Correct subarch for avrtiny series in compiler, resolves #36619
git-svn-id: trunk@44020 -
2020-01-22 20:34:43 +00:00
florian
08c2afb0a4 * AVR: use CP ...,r1 instead of CPI ...,0 to enable all registers being used as first operand
git-svn-id: trunk@44006 -
2020-01-20 21:14:28 +00:00
florian
429130fa34 * AVR: attiny can do post increment operations, so remove code working around this
git-svn-id: trunk@43996 -
2020-01-19 18:04:59 +00:00
florian
bd96765632 * AVR: do not insert jmp if not supported
git-svn-id: trunk@43995 -
2020-01-19 18:04:58 +00:00
florian
2d9cdab264 + AVR: initial support for the avrtiny architecture
git-svn-id: trunk@43987 -
2020-01-19 15:55:24 +00:00
florian
f629fa1bb9 * AVR: tcgavr.normalize_ref must always load the reference into tmpreg
git-svn-id: trunk@43986 -
2020-01-19 15:55:23 +00:00
florian
26eae3672b + AVR: GetDefaultZeroReg and GetDefaultTmpReg
git-svn-id: trunk@43985 -
2020-01-19 15:55:23 +00:00
florian
aaa6ae5770 + AVR: cputype cpu_avrtiny
git-svn-id: trunk@43984 -
2020-01-19 15:55:22 +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
4b4e316af0 * compilation fixed
git-svn-id: trunk@43981 -
2020-01-19 15:55:20 +00:00
Jonas Maebe
1e3f72403e * renamed getintparaloc to getcgtempparaloc
o it can be used for more than integer parameters

git-svn-id: trunk@43781 -
2019-12-24 22:12:25 +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
ae04e5d7f0 * avr: apply LdiOp2Opi optimization also to and and sub
git-svn-id: trunk@43352 -
2019-11-01 18:39:18 +00:00
florian
701848889e * avr: help the compiler with constant loading to avoid ie 200309041
git-svn-id: trunk@43350 -
2019-11-01 18:39:16 +00:00
florian
e8a48be3bc * avr: more precise execution weigth for shift loops
git-svn-id: trunk@43349 -
2019-11-01 18:39:15 +00:00
florian
f61207f1cc * avr directly encodes constant shifts of 64 bit values
git-svn-id: trunk@43348 -
2019-11-01 18:39:15 +00:00
florian
5fc12500f2 * patch by Christo Crause: fix for r43136
git-svn-id: trunk@43169 -
2019-10-12 11:52:06 +00:00
florian
dd2d1bf68b * (modified/re-formatted) patch by Christo Crause: AVR: Optimizing code generation for shift with compile time constant
git-svn-id: trunk@43136 -
2019-10-05 20:48:33 +00:00
florian
4e93a9a6c7 * AVR: patch by Christo Crause: fixes tcgavr.g_concatcopy for data with size>255, resolves #36066
git-svn-id: trunk@42977 -
2019-09-12 20:29:12 +00:00
florian
9e5cbce6be * fix tcgavr.g_flags2reg for sizes > 1 byte
git-svn-id: trunk@42938 -
2019-09-07 20:19:12 +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
Jeppe Johansen
1b698d319f - Fix bug in software overflow checking for longint's.
- AVR: Fix overflow checking for HW multiplications

git-svn-id: trunk@42531 -
2019-07-30 13:42:26 +00:00
Jeppe Johansen
f72342ed0e AVR: Add support for using nostackframe in interrupt routines.
git-svn-id: trunk@42519 -
2019-07-28 16:46:13 +00:00
Jeppe Johansen
91016c97a4 AVR: Add optimizations for sign testing, and a better Abs() implementation.
git-svn-id: trunk@42510 -
2019-07-28 11:16:37 +00:00
Jeppe Johansen
030cf78ac5 - Fix overflow checking for multiplication operations on AVR.
git-svn-id: trunk@42492 -
2019-07-25 13:16:12 +00:00
pierre
828a248287 Systematically include fpcdefs.inc at sart of all units used by compiler
git-svn-id: trunk@42322 -
2019-07-03 13:35:05 +00:00
Jonas Maebe
c262c5dbc9 * synchronised with trunk till r42256
git-svn-id: branches/debug_eh@42257 -
2019-06-20 17:21:34 +00:00
Jeppe Johansen
0d97dc7965 avr: Fixed some inconsistencies.
git-svn-id: trunk@42204 -
2019-06-10 13:35:38 +00:00
Jonas Maebe
faf75095cd * synchronised with trunk till r42189
git-svn-id: branches/debug_eh@42190 -
2019-06-07 18:24:38 +00:00
Jeppe Johansen
aa4961d06e - Add mov optimization for STS instruction.
git-svn-id: trunk@42163 -
2019-06-02 14:55:30 +00:00
Jeppe Johansen
5bdc635f50 Check if the current register was the last in the cgpara, to avoid running over the last register allocated.
git-svn-id: trunk@42159 -
2019-06-02 09:13:19 +00:00
Jeppe Johansen
c867d2b7f6 Generalize skip instruction optimization for both sbix and sbrx.
git-svn-id: trunk@42154 -
2019-06-01 15:20:34 +00:00
Jonas Maebe
3a1fb45315 * synchronised with trunk till r41976
git-svn-id: branches/debug_eh@41977 -
2019-05-02 19:44:41 +00:00
Jeppe Johansen
3ad450c636 avr: Add peephole optimization for in+sbr* bit test sequence.
git-svn-id: trunk@41962 -
2019-04-30 17:00:30 +00:00
Jonas Maebe
2923e484fd * synchronised with trunk till r41907
git-svn-id: branches/debug_eh@41908 -
2019-04-20 18:22:52 +00:00
Jeppe Johansen
12879adc2f - Adds intrinsics to save/restore SREG when disabling interrupts.
- Adds nostackframe to stack frame investigation stubs.

git-svn-id: trunk@41898 -
2019-04-18 18:26:51 +00:00
Jonas Maebe
ac883969a9 * synchronised with trunk till r41423
git-svn-id: branches/debug_eh@41424 -
2019-02-23 17:08:03 +00:00
Jonas Maebe
8b9e90dc7a * keep track of whether a routine has a C-style variadic parameter in the
procoptions even when it's through an array-of-const parameter
  * always call create_varargs_paraloc_info() instead of create_paraloc_info()
    in the former case, even when no varargs parameters are specified (because
    on some platforms even some non-variadic parameters need to be passed
    differently, such as on ARM with gnueabihf)

git-svn-id: trunk@41420 -
2019-02-23 15:42:45 +00:00
Jonas Maebe
b3a8543a56 * synchronised with trunk till r40942
git-svn-id: branches/debug_eh@40943 -
2019-01-20 17:37:07 +00:00
florian
94d7a02fae * modified patch by Gareth Moreton to pool TmpUsedRegs in the assembler optimizers, resolves #34679
git-svn-id: trunk@40938 -
2019-01-20 14:16:38 +00:00
florian
8fceba4493 * properly allocate parameter registers for constants on avr, resolves #33932
git-svn-id: trunk@40848 -
2019-01-12 13:28:09 +00:00
Jonas Maebe
11511e13d5 * synchronised with trunk till r40723
git-svn-id: branches/debug_eh@40724 -
2019-01-01 13:22:17 +00:00
florian
917de001d6 * patch (slighly modified) by Christo Crause to write 16 bit registers on avr in hi/lo order, resolves #34721
git-svn-id: trunk@40678 -
2018-12-27 21:41:36 +00:00
Jonas Maebe
9630eb7ce9 * synchronised with trunk till r40466
git-svn-id: branches/debug_eh@40467 -
2018-12-04 19:54:31 +00:00
Jonas Maebe
122d0d36d6 + volatile() expression that marks an expression as volatile
* disable matching volatile references in the assembler optimisers, so they
    can't be removed (more conservative than needed, but better than removing
    too many)
   o the CSE optimiser will ignore them by default, because they're an unknown
     inline node for it
  * also removed no longer used fpc_in_move_x and fpc_in_fillchar_x inline node
    identifiers from rtl/inc/innr.inc, and placed fpc_in_unaligned_x at the
    right place

git-svn-id: trunk@40465 -
2018-12-04 19:53:20 +00:00
Jonas Maebe
4cd6f59bc3 * changed create_hlcodegen into a procvar, so that we don't have to insert
hlcgllvm in the uses clause of every unit that calls create_hlcodegen
   o prevents dependency cycles that can cause llvm codegen units to init
     before the cpu variants, which is bad since the llvm versions have to
     override the cpu variants in their init code (+ added checks in the
     init code that they are in fact initialised later)

git-svn-id: branches/debug_eh@40410 -
2018-11-29 21:31:15 +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
florian
9b0ff05ee8 - get rid of MaxOps, it is redundant with max_operands
* MatchOpType with three operands is only available of max_operands>2

git-svn-id: trunk@40190 -
2018-11-02 21:32:29 +00:00
pierre
0abc978cc4 Change RemoveCurrentP parameter type to tai, because GetNextInstruction does not always return a taicpu, adapt code in avr/aoptcpu unit
git-svn-id: trunk@40120 -
2018-10-31 23:15:22 +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
Jonas Maebe
0b246f3dbd * converted Boolean8 to an internal type, and mapped Boolean to the
new internal pasbool1(type) (part of mantis #34411)
   o apply the _Bool x86-64 parameter passing rules only to pasbool1

git-svn-id: trunk@39949 -
2018-10-16 21:14:18 +00:00
Jonas Maebe
d69ad8fa41 * removed temppos field again from parameter locations: they're not allocated
by the temp manager of the current procedure

git-svn-id: trunk@38858 -
2018-04-27 19:18:55 +00:00
Jonas Maebe
4686f61002 * keep track of the temp position separately from the offset in references,
so that they can still be freed after the reference has been changed
    (e.g. in case of array indexing or record field accesses) (mantis #33628)

git-svn-id: trunk@38814 -
2018-04-22 17:03:16 +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
florian
b9417cc51e * missing skiplabel added, resolves #33423
git-svn-id: trunk@38520 -
2018-03-13 18:45:32 +00:00
florian
a66016026b * handle bitpacked booleans more efficiently
git-svn-id: trunk@38509 -
2018-03-12 22:05:34 +00:00
florian
11ef1d17c2 * fix register allocation for MovOp2Op and PushPushPopPop2MovMov
* fix MovOp2Op for ST/STS
* fix register book keeping for MovMov2Movw

git-svn-id: trunk@38492 -
2018-03-10 21:53:55 +00:00
florian
9fc0f28ae4 * handle movw in TCpuAsmOptimizer.RegInInstruction
git-svn-id: trunk@38491 -
2018-03-10 21:53:54 +00:00
florian
ee252d0ecd + allocate real registers properly in tcgavr
git-svn-id: trunk@38490 -
2018-03-10 21:53:52 +00:00
florian
61660375ce + AVR PeepHoleOptPass1Cpu makes use of TAOptObj.RemoveCurrentP to track register usage properly
git-svn-id: trunk@38489 -
2018-03-10 21:53:50 +00:00
florian
63ffb02b34 + Mov2Nop
git-svn-id: trunk@38487 -
2018-03-10 21:53:46 +00:00
florian
93a0cef65d * improved OpCp2Op
git-svn-id: trunk@38486 -
2018-03-10 21:53:45 +00:00
florian
52cb8fbb98 + AddAdc2Add
+ SubSbc2Sub

git-svn-id: trunk@38485 -
2018-03-10 21:53:43 +00:00
florian
3a81ccf48b * simplify tcgavr.a_op_reg_reg_internal
git-svn-id: trunk@38484 -
2018-03-10 21:53:41 +00:00
florian
23722a2f95 * correctly negate 8 bit values on avr, resolves #33322
git-svn-id: trunk@38407 -
2018-03-04 16:28:52 +00:00
florian
62df4a4083 * patch by Christo Crause: more descriptive error message when BRxx destination out of reach
git-svn-id: trunk@38340 -
2018-02-25 15:31:17 +00:00
florian
5b16a84de1 + RCallReg2RJmp optimization
git-svn-id: trunk@38318 -
2018-02-22 20:19:03 +00:00
florian
d0dd3bd74e * patch by Christo Crause to support ~ in att assembler
* allow -128 to 255 as a constant for instructions taking a byte sized constants (this is also what GNU As accepts), resolves #32039

git-svn-id: trunk@38316 -
2018-02-22 20:14:56 +00:00
florian
90051fd7d2 * better suitable error message for out of range constants
git-svn-id: trunk@38290 -
2018-02-19 21:19:08 +00:00
florian
4cb9ad7e01 * patch (indention adapted) by Christo Crause to check avr inline assembler, resolves also #32261
git-svn-id: trunk@38286 -
2018-02-18 21:58:04 +00:00
florian
055a49b202 * patch by Christo Crause: the subarch type for atmega 8, 8A, 16 & 32 was incorrect. Atmega8A was also listed under the wrong subarch type in the makefile, also fixed.
* atmega8a needs to use rjmp now

git-svn-id: trunk@38282 -
2018-02-18 10:54:59 +00:00
florian
cd41312a8f * fixes not(<qwordbool>) on arm
* fixes not(<(q/l)wordbool>) on avr

git-svn-id: trunk@38263 -
2018-02-16 22:38:35 +00:00
florian
311bcd4c08 * do not destroy flags while clearing R1, resolves #33170
git-svn-id: trunk@38241 -
2018-02-14 19:28:33 +00:00
florian
291ee4b562 * clear r1 (and save/restore) in interrupt routines on avr
+ generate no entry/exit code except ret for empty subroutines

git-svn-id: trunk@38233 -
2018-02-13 17:47:23 +00:00
florian
6b5a514148 * based on a patch by Christo Crause: in finalizeavrcode, ignore assembler breq statements taking an absolute value, resolves #32109
git-svn-id: trunk@38089 -
2018-01-31 18:38:33 +00:00
florian
0662b611ca * patch by Christo Crause: prevent that the compiler converts breq into jmp in inline assembler blocks, resolves #32949
git-svn-id: trunk@38088 -
2018-01-31 18:34:42 +00:00
florian
10516f21f8 * patch by Christo Crause to resolve #33098: AVR - LDS assembler instruction with absolute address gives compiler error
git-svn-id: trunk@38082 -
2018-01-30 20:22:42 +00:00
florian
796eb542be * LDD/STD need always an offset, resolves #33086
git-svn-id: trunk@38072 -
2018-01-28 21:06:13 +00:00
Jonas Maebe
1b66995754 * factored out check to determine whether a variable can be subscripted in
inline assembly, and fixed check after r35959 (mantis #32318)
   o can also subscript parameters passed by value on the stack
   o can also subscript local variables, the parameters passed by reference
     that are subsequently copied into a local

git-svn-id: trunk@37886 -
2018-01-01 14:29:21 +00:00
Jeppe Johansen
a7d3d2d298 Fixed internal error in case inline assembler constants are used.
git-svn-id: trunk@37859 -
2017-12-29 11:50:36 +00:00
Jeppe Johansen
4a169e6b1a Changed subarch of at90pwm161
git-svn-id: trunk@37858 -
2017-12-29 11:30:35 +00:00
florian
0f51cf8546 * avr: correctly write references to nil, resolves #32821
git-svn-id: trunk@37838 -
2017-12-28 10:32:16 +00:00
florian
46ab35edb3 * apply MovOpMov2Op also to inc and dec
* made core more readable

git-svn-id: trunk@37624 -
2017-11-26 15:28:44 +00:00
florian
cb087279d6 * do not generate an andi if the constant is 255
git-svn-id: trunk@37608 -
2017-11-19 18:05:21 +00:00