This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Bizarre inlining type promotion effect
- From: "Shaun Jackman" <sjackman at gmail dot com>
- To: gcc at gcc dot gnu dot org, avr-gcc-list at nongnu dot org, "GCC Bugs" <gcc-bugs at gcc dot gnu dot org>
- Date: Mon, 4 Dec 2006 17:00:29 -0700
- Subject: Re: Bizarre inlining type promotion effect
- References: <7f45d9390612041500h26e875bei96dc4462e4a05891@mail.gmail.com>
- Reply-to: "Shaun Jackman" <sjackman at gmail dot com>
On 12/4/06, Shaun Jackman <sjackman@gmail.com> 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