ARM Technical Support Knowledge Articles

COMMAND LINE GLOBAL REGISTER OPTIMIZATION

Applies to: C51 C Compiler

Answer


Information in this article applies to:


QUESTION

How is the REGFILE directive used on the command line to achieve global register optimization? The manual does not seem to describe this in detail.

ANSWER

  1. Compile your source file and invoke the linker with the REGFILE directive. For example:
    BL51 FOO.OBJ, BAR.OBJ TO FOOBAR PRINT(FOOBAR.M51) REGFILE(FOOBAR.REG)
    
  2. Look at the end of the linker map file (.m51). If you see something like the following, then you must rebuild your project as described in steps 3 and 4:
    RE-TRANSLATION LIST FOR OPTIMAL REGISTER MASKS
    
    
    MESSAGE                         MODULE
       INFORMATION
    --------------------------------------
    
    ** RE-TRANSLATION SUGGESTED **  FOO.OBJ (FOO)
       REG MASK (@000000) IS TOO PESSIMISTIC FOR FUNCTION '_TOUPPER'
    
  3. Recompile the source files required, using the compiler REGFILE directive. In the example above, FOO.C compiles to produce FOO.OBJ, so only FOO.C needs to be recompiled. When using the directive, specify the .REG file generated by the linker in step 2.
    C51 FOO.C REGFILE(FOOBAR.REG)
    
  4. Relink and repeat step 2 until retranslation is no longer suggested.

MORE INFORMATION

SEE ALSO

Article last edited on: 2005-07-15 12:46:04

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential