avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Add builtins in avr target.


From: Anatoly Sokolov
Subject: Re: [avr-gcc-list] Add builtins in avr target.
Date: Fri, 18 Apr 2008 01:44:02 +0400

Hi.


> 2008/4/17, Wouter van Gulik <address@hidden>:
> 
>>  For a 2 cycles delays an rjmp can be used. Saves an instruction!
> 
> And so on:
> 
> 3 cycles:
>   rjmp .
>   nop
> 

I shall try to replace 'nop' with 'rjmp .' for two cycle delay.  It is 
necessary to check that the linker relaxation pass will not remove the  'rjmp 
.' instruction. Now I do not wish to complicate a code and to optimize 3..6 
cycles delays.

> 
> 7 cycles delay requires four instructions and delay loop is more
> efficient in code size:
> 
>>> If  'delay' is from 3 to 756 then code:
> 
> 7 to 756
> 
>>>   ldi rX, (delay/3)
>>>  1:dec rX
>>>    brne 1b
>>> is generated. 'ldi' instruction can be removed by optimizer.
> 
> and removed ldi instruction execution time (1 cycle) for 7+ cycles
> will produce less relative error than for 3..6 cycles delay
> 

Ok. I shall check it.

Anatoly.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]