Keil Logo Arm Logo

Technical Support

On-Line Manuals

Compiler User Guide

Conventions and Feedback Overview of the Compiler Getting Started with the Compiler Compiler Features Compiler intrinsics Performance benefits of compiler intrinsics ARM assembler instruction intrinsics supported by Generic intrinsics supported by the compiler Compiler intrinsics for controlling IRQ and FIQ in Compiler intrinsics for inserting optimization bar Compiler intrinsics for inserting native instructi Compiler intrinsics for Digital Signal Processing European Telecommunications Standards Institute (E Compiler support for European Telecommunications S Overflow and carry status flags for C and C++ code Texas Instruments (TI) C55x intrinsics for optimiz Compiler support for accessing registers using nam Pragmas recognized by the compiler Compiler and processor support for bit-banding Compiler type attribute, __attribute__((bitband)) --bitband compiler command-line option How the compiler handles bit-band objects placed o Compiler support for thread-local storage Compiler eight-byte alignment features Using compiler and linker support for symbol versi PreCompiled Header (PCH) files Automatic PreCompiled Header (PCH) file processing PreCompiled Header (PCH) file processing and the h PreCompiled Header (PCH) file creation requirement Compilation with multiple PreCompiled Header (PCH) Obsolete PreCompiled Header (PCH) files Manually specifying the filename and location of a Selectively applying PreCompiled Header (PCH) file Suppressing PreCompiled Header (PCH) file processi Message output during PreCompiled Header (PCH) pro Performance issues with PreCompiled Header (PCH) f Default compiler options that are affected by opti Compiler Coding Practices Compiler Diagnostic Messages Using the Inline and Embedded Assemblers of the AR

Compiler User Guide

--bitband compiler command-line option

--bitband compiler command-line option

The --bitband command-line option bit-bands all non const global structure objects.

When --bitband is applied to foo.c in Example 9, the write to value.i is bit-banded. That is, the value 0x00000001 is written to the bit-band alias word that value.i maps to in the bit-band region.

Accesses to value.j and value.k are not bit-banded.

Example 9. Using the --bitband command-line option

/* foo.c */

typedef struct {
  int i : 1;
  int j : 2;
  int k : 3;
} BB;

BB value __attribute__((at(0x20000040))); // Placed object

void update_value(void)
{
  value.i = 1;
  value.j = 0;
}

/* end of foo.c */

armcc supports the bit-banding of objects accessed through absolute addresses. When --bitband is applied to foo.c in Example 10, the access to rts is bit-banded.

Example 10. Bit-banding of objects accessed through absolute addresses

/* foo.c */

typedef struct {
  int rts : 1;
  int cts : 1;
  unsigned int data;
} uart;

#define com2 (*((volatile uart *)0x20002000))
void put_com2(int n)
{
  com2.rts = 1;
  com2.data = n;
}

/* end of foo.c */

Show/hideSee also

Concepts
Reference
Other information
  • Technical Reference Manual for your processor.

Copyright © 2007-2008, 2011-2012 ARM. All rights reserved.ARM DUI 0375D
Non-ConfidentialID062912

Keil logo

Arm logo
Important information

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