Re: Warning on migrating to ATMega8515 - eeprom problem

From: jetmarc (jetmarc_at_hotmail.com)
Date: 11/03/04


Date: 3 Nov 2004 04:31:53 -0800


> r10 is normally not used anyway by the IAR compiler.

Caution! Unless you specifically instruct the compiler to not use r10,
it DOES use it. An r10 is a must-preserve register, so even when you
dont inline assembler but call externally linked assembler code, you
must not scratch r10.

The compiler can be configured to not touch registers r15 and below. To
keep clear r10, you effectively have to forbid usage of r10-r15. Note
that you also have to recompile the runtime library (clib/dlib), because
the precompiled versions that come with the installation binary are
compiled for full register usage.

Reserving R10-R15 wont result in lots of speed reduction. Much code
compiles well without actually needing r10. Thats probably why you
concluded that r10 is not used. However, if you compile complex code
that can take advantage of many registers, r10 will be used. Try for
example a cryptographic algorithm or other large function with lots
of autovars and only few function calls. Set optimization to 9 and
see yourself.

Marc



Relevant Pages

  • Re: [PATCH 0/9] x86-64 put current in r10
    ... > Your patch breaks all out-of-tree amd64 assembler code used in kernel. ... > register is one of those registers that does not need to be preserved across ... > assembler code using r10 in kernel must be rewritten. ...
    (Linux-Kernel)
  • Re: pxa270 resume from sleep (mainstone II)
    ... after PreInit, it will check r10, r10 contains PSSR+RCSR ... RCSR in the lower half and PSSR in the upper half ... > how can I see the RCSR register? ...
    (microsoft.public.windowsce.platbuilder)
  • Re: [PATCH 0/9] x86-64 put current in r10
    ... Your patch breaks all out-of-tree amd64 assembler code used in kernel. ... register is one of those registers that does not need to be preserved across ... assembler code using r10 in kernel must be rewritten. ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • [PATCH 1/9] x86-64 dont use r10 in AES
    ... In preparation for using r10 as current on x86-64, ... must be changed to use a different register for its temporary. ... Use r12 ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)