[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] compiler function prologue/epilogue incorrect?

From: Paulo Marques
Subject: Re: [avr-gcc-list] compiler function prologue/epilogue incorrect?
Date: Tue, 26 Sep 2006 14:44:27 +0100
User-agent: Thunderbird (X11/20060909)

address@hidden wrote:
Hi Paulo

Hi, Craig

OK. The effect of CLI is immediate though so either there is some special
magic for CLI or there might be some other magic associated with SEI and
RETI that produce the extra instruction delay. Hopefully it's CLI that is
special in some way and everyone else gets the 1 instruction delay!

Actually the effect for CLI is the "same": the instruction after the CLI is always executed ;)

However, if there is no CLI, handling the interrupt will take at least two clock cycles because of the pipeline stall.

So I don't think it isn't really special in this sense. For the SEI, the CPU doesn't "predict" that the instruction being executed will turn interrupts on, so it already has the next instruction on the pipeline and it must execute it.

As for the CLI, it just clears the flag, so any interrupt is immediately held until the flag is enabled again. But holding interrupts doesn't affect the pipeline at all, so no extra clocks or tricks are needed.

Paulo Marques
Software Development Department - Grupo PIE, S.A.
Phone: +351 252 290600, Fax: +351 252 290601
Web: www.grupopie.com

"The face of a child can say it all, especially the
mouth part of the face."

reply via email to

[Prev in Thread] Current Thread [Next in Thread]