static inline void delay_4cy(unsigned int cy) { __asm__ __volatile__ ( "loop%=:" "\n\t" " subs %[cnt],#1" "\n\t" " bne loop%=" "\n\t" : [cnt]"+r"(cy) // output: +r means input+output : // input: : "cc" // clobbers: ); }
When buld with -flto -mcpu=cortex-m1 -mthumb -msoft-float -Os
get error:
C:\...\ccsln0ZZ.s: Assembler messages: C:\...\ccsln0ZZ.s:2701: Error: instruction not supported in Thumb16 mode -- `subs r3,#1' lto-wrapper.exe: fatal error: arm-none-eabi-gcc returned 1 exit status
static inline void delay_4cy(unsigned int cy)
"loop% =:" "\n\t"
{
__asm__ __volatile__
(
" subs %[cnt],#1" "\n\t"
" bne loop%=" "\n\t"
: [cnt]"+r"(cy) // output: +r means input+output
: // input:
: "cc" // clobbers:
);
}
When buld with -flto -mcpu=cortex-m1 -mthumb -msoft-float -Os
get error:
C:\...\ccsln0ZZ.s: Assembler messages: ccsln0ZZ. s:2701: Error: instruction not supported in Thumb16 mode -- `subs r3,#1'
C:\...\
lto-wrapper.exe: fatal error: arm-none-eabi-gcc returned 1 exit status