Re: Telling inline asm that input register is clobbered?
Georg-Johann Lay <[email protected]>
| Newsgroups | gmane.comp.hardware.avr.gcc |
|---|---|
| Message-ID | <[email protected]> |
Paul Sokolovsky wrote:
> Hello,
>
> I'd like to reimplement __builtin_avr_delay_cycles() function in inline
> assembly. The reason is that __builtin_avr_delay_cycles() has
> too-early operand checking, so for example
>
> static __attribute__((__always_inline__)) my_delay(int cycles)
> {
> __builtin_avr_delay_cycles(cycles);
> }
Would you supply a test case?
> Will still complain that __builtin_avr_delay_cycles(cycles) is not
> constant even for cases like my_delay(10).
Also consider to make the function inline and to make 'cycles' const.
Johann