avr-gcc-list
[Top][All Lists]
Advanced

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

RE: [avr-gcc-list] SIGNAL and INTERRUPT overhead


From: Nigel Winterbottom
Subject: RE: [avr-gcc-list] SIGNAL and INTERRUPT overhead
Date: Tue, 23 Aug 2005 16:25:12 +0100

-----Original Message-----

Bernard Fouché wrote

Suppose you have:

f1()
{
  push rA
  push rB
  .. uses rA & rB then does not care of their value until the end of the 
function..
  f2()
  ...
  f2()
  ..
  f2()
  pop rB
  pop rA
}

f2()
{
  push rA
  push rB
  .. uses rA & rB..
  pop rB
  pop rA
}

If f2() is only called from f1(), then it is possible to skip the 
push/pops in f2().
If f2() is called only once in the final .elf then it could have been 
inline'd with
a sure win.

The point is that you don't need anymore "callee-saves" convention when you
don't need to call a function anymore, or if you perfectly know what the 
called
function does, you can optimize (and break!)  the convention locally.

If f1() and f2() are in two different files, the compiler can not know what
to do in a optimal way and has to stick to the convention.

  Bernard


----------------------------------------------------

I've been following tis with mild interrest but am now confused; are we still 
talking about SIGNAL and INTERRUPT functions or more generally. If so then in 
function f1() rA & rB are candidates for temporary storage in clobberable 
registers. i.e. No need to push/pop.

I must have missed something along the way.

Nigel




reply via email to

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