Login

Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

ARM websites use two types of cookie: (1) those that enable the site to function and perform as required; and (2) analytical cookies which anonymously track visitors only while using the site. If you are not happy with this use of these cookies please review our Privacy Policy to learn how they can be disabled. By disabling cookies some features of the site will not work.

ARM Community: Global variable alignment - ARM Community

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Global variable alignment Rate Topic: -----

#1 User is offline   jms 

  • Member
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 13-January 11

Posted 13 January 2011 - 07:38 AM

Hi,

I am working with RealView Compilation Tools v2.1. I need to align a static global variable on a 16-byte boundary. In the 'Compiler and Libraries Guide' document, section 3.1.3, the __align(n) keyword is explained. It is not clear to me if n=16 is allowed for a static global variable. I have tried it and it appears to be working, but I would like to confirm it.

Best Regards,
Miguel
0

#2 User is offline   jms 

  • Member
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 13-January 11

Posted 17 January 2011 - 01:19 PM

Hi,

I have not received any answers, can someone help me on this?

Regards,
Miguel
0

#3 User is offline   isogen74 

  • Super Contributor
  • PipPipPipPip
  • Group: Members
  • Posts: 1097
  • Joined: 20-March 07

Posted 17 January 2011 - 05:33 PM

For RVCT 2.1 it is only specified to work for alignments of 1,2,4, or 8 - it is unclear what happens for alignments larger than this, although I suspect it is not guaranteed to do anything predictably.

FYI - in newer tool releases (RVCT4.1) it will work for the following alignments of n:

  • For local variables, n can take the values 1, 2, 4, or 8.
  • For global variables, n can take any value up to 0x80000000 in powers of 2.

When optimizing software, consider that the quickest code to run is the bit you removed from the call path.
0

#4 User is offline   jms 

  • Member
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 13-January 11

Posted 19 January 2011 - 02:28 PM

Hi,

The point is that RVCT 2.1 says: 'You can specify a power of two for the alignment boundary, however eight is the maximum for auto variables'. As I understand, an 'auto' variable is the same as a 'local' variable, so it is not clear to me what is the limitation for global variables.

Regards,
Miguel

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic