Commit Graph

59 Commits

Author SHA1 Message Date
ccrause
dd858f37aa Ensure register to be eliminated is de-allocated before applying optimization LdsMov2Lds. 2024-03-24 13:54:31 +00:00
ccrause
248082347f AVR optimization LdsMov2Lds 2023-12-02 18:22:35 +00:00
ccrause
f83a8f0f8f Only perform OpCp2Op optimization when the first Op is ANDI and comparison is against 0. 2023-03-09 18:19:20 +02:00
florian
46b52d92d3 + AVR: helpers take care of ADIW 2022-05-01 22:42:57 +02:00
florian
33eef1f9b1 * AVR: moved MovMov2Movw optimization into pass2 as it might prevent other optimizations 2022-04-25 22:18:37 +02:00
florian
9695dba4d9 * AVR: fix TCpuAsmOptimizer.InstructionLoadsFromReg for MOVW
* simplify code for MovMov2Movw optimization
2022-04-24 22:42:09 +02:00
florian
c43d8e4adf * indention fixed
git-svn-id: trunk@49379 -
2021-05-18 19:13:49 +00:00
florian
430b2fd791 * AVR: second part of assembler optimizer rework
git-svn-id: trunk@49378 -
2021-05-18 19:13:13 +00:00
florian
6f1d965dac * first part of AVR assembler optimizer reword
git-svn-id: trunk@49377 -
2021-05-17 20:02:12 +00:00
florian
9bfc731bb6 + AVR: MovOp2Op 2 optimization
git-svn-id: trunk@49350 -
2021-05-12 19:20:10 +00:00
florian
05cf47f995 * AVR: fixed TCpuAsmOptimizer.RegLoadedWithNewValue
git-svn-id: trunk@49126 -
2021-04-06 11:49:48 +00:00
yury
64c586b86d * Removed/ifdefed lots of unused variables.
git-svn-id: trunk@48384 -
2021-01-24 12:24:01 +00:00
florian
3482121831 * patch by Christo Crause: Fix missed optimization opportunities, resolves #38285
git-svn-id: trunk@47925 -
2020-12-31 15:33:39 +00:00
florian
e47f44234c * AVR: MovMov2Mov 2 optimization
git-svn-id: trunk@47035 -
2020-10-02 20:13:17 +00:00
florian
a084c8829f * patch by J. Gareth Moreton: refactor RemoveCurrentP
git-svn-id: trunk@45142 -
2020-04-27 19:27:16 +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
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
26eae3672b + AVR: GetDefaultZeroReg and GetDefaultTmpReg
git-svn-id: trunk@43985 -
2020-01-19 15:55:23 +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
Jeppe Johansen
aa4961d06e - Add mov optimization for STS instruction.
git-svn-id: trunk@42163 -
2019-06-02 14:55:30 +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
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
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
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
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
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
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
5b16a84de1 + RCallReg2RJmp optimization
git-svn-id: trunk@38318 -
2018-02-22 20:19:03 +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
366360d36c * LdiMov/Cp2Ldi/Cpi may not be performed if reg0=reg1
* cleanup of MovOp2Op
* fixed MovMov2Mov

git-svn-id: trunk@37607 -
2017-11-19 18:05:19 +00:00
florian
ad01f059e8 * after a LdiMov/Cp2Ldi/Cpi optimization, the compiler should not continue to optimize this instruction because then reg. alloc info is wrong
git-svn-id: trunk@37604 -
2017-11-19 18:05:14 +00:00
florian
4a43d992f5 * unified usage of MatchOpType
* fixed generic MatchOpType

git-svn-id: trunk@36145 -
2017-05-07 16:18:33 +00:00
florian
39b7f1bffe * do not write assembler optimizer debug output in avr assembler files
git-svn-id: trunk@36063 -
2017-05-02 19:50:37 +00:00
florian
8e7101a65a * proper naming of the optimziation in the DebugMsg
git-svn-id: trunk@34957 -
2016-11-24 18:28:48 +00:00
florian
e33b2920dc + CallReg2Jmp optimization
git-svn-id: trunk@34937 -
2016-11-20 18:00:27 +00:00
florian
e49a826837 + PushPushPopPop2MovMov optimization
git-svn-id: trunk@34934 -
2016-11-20 16:03:49 +00:00
florian
0520d246d0 * changed LdiCp2Cpi into LdiMov/Cp2Ldi/Cpi and improved it
git-svn-id: trunk@34920 -
2016-11-19 19:22:47 +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
Jeppe Johansen
baae6ec169 Fix incorrect AVR optimization.
git-svn-id: trunk@32441 -
2015-11-21 16:53:56 +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
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
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
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