Bizarre inlining type promotion effect

Shaun Jackman sjackman@gmail.com
Tue Dec 5 00:00:00 GMT 2006


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



More information about the Gcc-bugs mailing list