[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-gcc-list] Re: Bizarre inlining type promotion effect
From: |
Shaun Jackman |
Subject: |
[avr-gcc-list] Re: Bizarre inlining type promotion effect |
Date: |
Mon, 4 Dec 2006 17:00:29 -0700 |
On 12/4/06, Shaun Jackman <address@hidden> wrote:
In the code snippet below, the function mul_8_8 compiles to use
exactly one `mul' instruction on the AVR. The function mul_16_8 calls
mul_8_8 twice. If mul_8_8 is a static inline function and inlined in
...
For comparison, a hand-coded 16x8 multiply function requires 11 instructions.
Cheers,
Shaun
mul_16_8:
mul r25, r22
mov r23, r0
mov r25, r1
mul r24, r22
eor r24, r24
mov r22, r0
add r23, r1
adc r24, r25
eor r25, r25
eor r1, r1
ret