AVR [patch] Use LDS for 8 bit references
Original Reporter info from Mantis: ccrause @ccrause
-
Reporter name: Christo Crause
Original Reporter info from Mantis: ccrause @ccrause
- Reporter name: Christo Crause
Description:
Loading an 8 bit reference into a register can be done more compactly when using LDS, rather than LDI + LD, see example below. The check for CPUAVR_16_REGS as per r47612 has been extended to tcg.a_op_ref.
Steps to reproduce:
program test;
var
b: byte;
procedure dummy;
begin
if b > 0 then
b := not(b)
else
inc(b);
end;
begin
dummy;
end.
Additional information:
Compiled with /fpc/3.3.1/compiler/ppcrossavr -n @/fpc/3.3.1/fpc.cfg -O3 -Wpattiny13 test.lpr the generated code size is 138 bytes, compiled with the patch it is 130 bytes.
Mantis conversion info:
- Mantis ID: 38173
- Version: 3.3.1
- Fixed in version: 3.3.1
- Fixed in revision: 47700 (#c0d75c1c)