ARM® Compiler toolchain Compiler Reference

Version 4.1


List of Topics

Conventions and Feedback
Introduction
About the ARM compiler
Source language modes
ISO C90
ISO C99
ISO C++
Language extensions and language compliance
Language extensions
Language compliance
The C and C++ libraries
Compiler Command-line Options
‑Aopt
--allow_fpreg_for_nonfpdata, --no_allow_fpreg_for_nonfpdata
--allow_null_this, --no_allow_null_this
‑‑alternative_tokens, --no_alternative_tokens
--anachronisms, --no_anachronisms
--apcs=qualifer...qualifier
‑‑arm
‑‑arm_linux
‑‑arm_linux_config_file=path
‑‑arm_linux_configure
‑‑arm_linux_paths
‑‑arm_only
‑‑asm
--asm_dir=directory_name
‑‑autoinline, --no_autoinline
‑‑bigend
--bitband
‑‑brief_diagnostics, --no_brief_diagnostics
--bss_threshold=num
‑c
‑C
‑‑c90
‑‑c99
‑‑code_gen, --no_code_gen
‑‑compatible=name
--compile_all_input, --no_compile_all_input
--conditionalize, --no_conditionalize
‑‑configure_cpp_headers=path
‑‑configure_extra_includes=paths
‑‑configure_extra_libraries=paths
--configure_gas=path
‑‑configure_gcc=path
--configure_gcc_version=version
‑‑configure_gld=path
‑‑configure_sysroot=path
‑‑cpp
‑‑cpu=list
‑‑cpu=name
‑‑create_pch=filename
‑Dname[(parm-list)][=def]
‑‑data_reorder, --no_data_reorder
‑‑debug, --no_debug
‑‑debug_macros, --no_debug_macros
--default_definition_visibility=visibility
‑‑default_extension=ext
‑‑dep_name, --no_dep_name
‑‑depend=filename
--depend_dir=directory_name
‑‑depend_format=string
--depend_single_line, --no_depend_single_line
--depend_system_headers, --no_depend_system_headers
--depend_target=target
‑‑device=list
‑‑device=name
‑‑diag_error=tag[,tag,...]
‑‑diag_remark=tag[,tag,... ]
‑‑diag_style={arm|ide|gnu}
‑‑diag_suppress=tag[,tag,...]
--diag_suppress=optimizations
‑‑diag_warning=tag[,tag,...]
--diag_warning=optimizations
‑‑dllexport_all, --no_dllexport_all
‑‑dllimport_runtime, --no_dllimport_runtime
‑‑dollar, --no_dollar
‑‑dwarf2
‑‑dwarf3
‑E
--emit_frame_directives, --no_emit_frame_directives
‑‑enum_is_int
‑‑errors=filename
‑‑exceptions, --no_exceptions
‑‑exceptions_unwind, --no_exceptions_unwind
--execstack, --no_execstack
‑‑export_all_vtbl, --no_export_all_vtbl
‑‑export_defs_implicitly, --no_export_defs_implicitly
--extended_initializers, --no_extended_initializers
‑‑feedback=filename
--force_new_nothrow, --no_force_new_nothrow
‑‑forceinline
‑‑fp16_format=format
‑‑fpmode=model
‑‑fpu=list
‑‑fpu=name
‑‑friend_injection, --no_friend_injection
‑g
--global_reg=reg_name[,reg_name,...]
‑‑gnu
--gnu_defaults
--gnu_instrument, --no_gnu_instrument
‑‑gnu_version=version
‑‑guiding_decls, --no_guiding_decls
‑‑help
‑‑hide_all, --no_hide_all
‑Idir[,dir,...]
--ignore_missing_headers
‑‑implicit_include, --no_implicit_include
--implicit_include_searches, --no_implicit_include_searches
--implicit_key_function, --no_implicit_key_function
‑‑implicit_typename, --no_implicit_typename
--import_all_vtbl
‑‑info=totals
‑‑inline, --no_inline
‑‑interface_enums_are_32_bit
‑‑interleave
‑Jdir[,dir,...]
‑‑kandr_include
‑Lopt
--library_interface=lib
--library_type=lib
‑‑licretry
--link_all_input, --no_link_all_input
‑‑list
--list_dir=directory_name
--list_macros
‑‑littleend
‑‑locale=lang_country
--long_long
‑‑loose_implicit_cast
‑‑lower_ropi, --no_lower_ropi
‑‑lower_rwpi, --no_lower_rwpi
‑‑ltcg
‑M
‑‑md
‑‑message_locale=lang_country[.codepage]
‑‑min_array_alignment=opt
--mm
‑‑multibyte_chars, --no_multibyte_chars
‑‑multifile, --no_multifile
--multiply_latency=cycles
--narrow_volatile_bitfields
‑‑nonstd_qualifier_deduction, --no_nonstd_qualifier_deduction
‑o filename
‑Onum
‑‑old_specializations, --no_old_specializations
--old_style_preprocessing
‑Ospace
‑Otime
--output_dir=directory_name
-P
‑‑parse_templates, --no_parse_templates
‑‑pch
‑‑pch_dir=dir
‑‑pch_messages, --no_pch_messages
‑‑pch_verbose, --no_pch_verbose
‑‑pending_instantiations=n
--phony_targets
‑‑pointer_alignment=num
‑‑preinclude=filename
--preprocessed
‑‑profile=filename
--project=filename, --no_project
--reassociate_saturation, --no_reassociate_saturation
--reduce_paths, --no_reduce_paths
--reinitialize_workdir
‑‑relaxed_ref_def, --no_relaxed_ref_def
‑‑remarks
--remove_unneeded_entities, --no_remove_unneeded_entities
‑‑restrict, --no_restrict
‑‑retain=option
‑‑rtti, --no_rtti
--rtti_data, --no_rtti_data
‑S
--shared
‑‑show_cmdline
‑‑signed_bitfields, --unsigned_bitfields
‑‑signed_chars, --unsigned_chars
‑‑split_ldm
‑‑split_sections
‑‑strict, --no_strict
‑‑strict_warnings
‑‑sys_include
‑‑thumb
‑‑translate_g++
‑‑translate_gcc
‑‑translate_gld
‑‑trigraphs, --no_trigraphs
--type_traits_helpers, --no_type_traits_helpers
‑Uname
‑‑unaligned_access, --no_unaligned_access
--use_gas
‑‑use_pch=filename
‑‑using_std, --no_using_std
‑‑vectorize, --no_vectorize
--version_number
‑‑vfe, --no_vfe
‑‑via=filename
--visibility_inlines_hidden
--vla, --no_vla
‑‑vsn
‑W
-Warmcc,option[,option,...]
--wchar, --no_wchar
--wchar16
‑‑wchar32
--whole_program
--workdir=directory
‑‑wrap_diagnostics, --no_wrap_diagnostics
Language Extensions
Preprocessor extensions
#assert
#include_next
#unassert
#warning
C99 language features available in C90
// comments
Subscripting struct
Flexible array members
C99 language features available in C++ and C90
Variadic macros
long long
restrict
Hexadecimal floats
Standard C language extensions
Constant expressions
Array and pointer extensions
Block scope function declarations
Dollar signs in identifiers
Top‑level declarations
Benign redeclarations
External entities
Function prototypes
Standard C++ language extensions
? operator
Declaration of a class member
friend
Read/write constants
Scalar type constants
Specialization of nonmember function templates
Type conversions
Standard C and Standard C++ language extensions
Address of a register variable
Arguments to functions
Anonymous classes, structures and unions
Assembler labels
Empty declaration
Hexadecimal floating‑point constants
Incomplete enums
Integral type extensions
Label definitions
Long float
Nonstatic local variables
Structure, union, enum, and bitfield extensions
GNU extensions to the C and C++ languages
Compiler-specific Features
Keywords and operators
__align
__alignof__
__ALIGNOF__
__asm
__forceinline
__global_reg
__inline
__int64
__INTADDR__
__irq
__packed
__pure
__smc
__softfp
__svc
__svc_indirect
__svc_indirect_r7
__value_in_regs
__weak
__writeonly
__declspec attributes
__declspec(dllexport)
__declspec(dllimport)
__declspec(noinline)
__declspec(noreturn)
__declspec(nothrow)
__declspec(notshared)
__declspec(thread)
Function attributes
__attribute__((alias)) function attribute
__attribute__((always_inline)) function attribute
__attribute__((const)) function attribute
__attribute__((constructor[(priority)])) function attribute
__attribute__((deprecated)) function attribute
__attribute__((destructor[(priority)])) function attribute
__attribute__((format_arg(string-index))) function attribute
__attribute__((malloc)) function attribute
__attribute__((noinline)) function attribute
__attribute__((no_instrument_function)) function attribute
__attribute__((nomerge)) function attribute
__attribute__((nonnull)) function attribute
__attribute__((noreturn)) function attribute
__attribute__((notailcall)) function attribute
__attribute__((pcs("calling_convention")))
__attribute__((pure)) function attribute
__attribute__((section("name"))) function attribute
__attribute__((unused)) function attribute
__attribute__((used)) function attribute
__attribute__((visibility("visibility_type"))) function attribute
__attribute__((weak)) function attribute
__attribute__((weakref("target"))) function attribute
Type attributes
__attribute__((bitband)) type attribute
__attribute__((aligned)) type attribute
__attribute((packed)) type attribute
__attribute__((transparent_union)) type attribute
Variable attributes
__attribute__((alias)) variable attribute
__attribute__((at(address))) variable attribute
__attribute__((aligned)) variable attribute
__attribute__((deprecated)) variable attribute
__attribute__((noinline)) constant variable attribute
__attribute__((packed)) variable attribute
__attribute__((section("name"))) variable attribute
__attribute__((transparent_union)) variable attribute
__attribute__((unused)) variable attribute
__attribute__((used)) variable attribute
__attribute__((visibility("visibility_type"))) variable attribute
__attribute__((weak)) variable attribute
__attribute__((weakref("target"))) variable attribute
__attribute__((zero_init)) variable attribute
Pragmas
#pragma anon_unions, #pragma no_anon_unions
#pragma arm
#pragma arm section [section_type_list]
#pragma diag_default tag[,tag,...]
#pragma diag_error tag[,tag,...]
#pragma diag_remark tag[,tag,...]
#pragma diag_suppress tag[,tag,...]
#pragma diag_warning tag[, tag, ...]
#pragma exceptions_unwind, #pragma no_exceptions_unwind
#pragma GCC system_header
#pragma hdrstop
#pragma import symbol_name
#pragma import(__use_full_stdio)
#pragma import(__use_smaller_memcpy)
#pragma inline, #pragma no_inline
#pragma no_pch
#pragma Onum
#pragma once
#pragma Ospace
#pragma Otime
#pragma pack(n)
#pragma pop
#pragma push
#pragma softfp_linkage, #pragma no_softfp_linkage
#pragma unroll [(n)]
#pragma unroll_completely
#pragma thumb
#pragma weak symbol, #pragma weak symbol1 = symbol2
Instruction intrinsics
__breakpoint intrinsic
__cdp intrinsic
__clrex intrinsic
__clz intrinsic
__current_pc intrinsic
__current_sp intrinsic
__disable_fiq intrinsic
__disable_irq intrinsic
__enable_fiq intrinsic
__enable_irq intrinsic
__fabs intrinsic
__fabsf intrinsic
__force_stores intrinsic
__ldrex intrinsic
__ldrexd intrinsic
__ldrt intrinsic
__memory_changed intrinsic
__nop
__pld intrinsic
__pldw intrinsic
__pli intrinsic
__promise intrinsic
__qadd intrinsic
__qdbl intrinsic
__qsub intrinsic
__rbit intrinsic
__rev intrinsic
__return_address intrinsic
__ror intrinsic
__schedule_barrier intrinsic
__semihost intrinsic
__sev intrinsic
__sqrt intrinsic
__sqrtf intrinsic
__ssat intrinsic
__strex intrinsic
__strexd intrinsic
__strt intrinsic
__swp intrinsic
__usat intrinsic
__wfe intrinsic
__wfi intrinsic
__yield intrinsic
ARMv6 SIMD intrinsics
ETSI basic operations
C55x intrinsics
VFP status intrinsic
__vfp_status intrinsic
Fused Multiply Add (FMA) intrinsics
Named register variables
GNU builtin functions
Compiler predefines
C and C++ Implementation Details
C and C++ implementation details
Character sets and identifiers
Basic data types
Operations on basic data types
Structures, unions, enumerations, and bitfields
C++ implementation details
Using the ::operator new function
Tentative arrays
Old-style C parameters in C++ functions
Anachronisms
Template instantiation
Namespaces
C++ exception handling
Extern inline functions
ARMv6 SIMD Instruction Intrinsics
ARMv6 SIMD intrinsics by prefix
ARMv6 SIMD intrinsics, summary descriptions, byte lanes, side-effects
ARMv6 SIMD intrinsics, compatible processors and architectures
ARMv6 SIMD instruction intrinsics and APSR GE flags
__qadd16 intrinsic
__qadd8 intrinsic
__qasx intrinsic
__qsax intrinsic
__qsub16 intrinsic
__qsub8 intrinsic
__sadd16 intrinsic
__sadd8 intrinsic
__sasx intrinsic
__sel intrinsic
__shadd16 intrinsic
__shadd8 intrinsic
__shasx intrinsic
__shsax intrinsic
__shsub16 intrinsic
__shsub8 intrinsic
__smlad intrinsic
__smladx intrinsic
__smlald intrinsic
__smlaldx intrinsic
__smlsd intrinsic
__smlsdx intrinsic
__smlsld intrinsic
__smlsldx intrinsic
__smuad intrinsic
__smusd intrinsic
__smusdx intrinsic
__smuadx intrinsic
__ssat16 intrinsic
__ssax intrinsic
__ssub16 intrinsic
__ssub8 intrinsic
__sxtab16 intrinsic
__sxtb16 intrinsic
__uadd16 intrinsic
__uadd8 intrinsic
__uasx intrinsic
__uhadd16 intrinsic
__uhadd8 intrinsic
__uhasx intrinsic
__uhsax intrinsic
__uhsub16 intrinsic
__uhsub8 intrinsic
__uqadd16 intrinsic
__uqadd8 intrinsic
__uqasx intrinsic
__uqsax intrinsic
__uqsub16 intrinsic
__uqsub8 intrinsic
__usad8 intrinsic
__usada8 intrinsic
__usax intrinsic
__usat16 intrinsic
__usub16 intrinsic
__usub8 intrinsic
__uxtab16 intrinsic
__uxtb16 intrinsic
Via File Syntax
Overview of via files
Syntax
Summary Table of GNU Language Extensions
Standard C Implementation Definition
Implementation definition
Translation
Environment
Identifiers
Characters
Integers
Floating‑point
Arrays and pointers
Registers
Structures, unions, enumerations, and bitfields
Qualifiers
Expression evaluation
Preprocessing directives
Library functions
Behaviors considered undefined by the ISO C Standard
Standard C++ Implementation Definition
Integral conversion
Calling a pure virtual function
Major features of language support
Standard C++ library implementation definition
C and C++ Compiler Implementation Limits
C++ ISO/IEC standard limits
Limits for integral numbers
Limits for floating‑point numbers
Using NEON Support
Introduction
Vector data types
Summary of NEON intrinsics
Intrinsics
Addition
Multiplication
Subtraction
Comparison
Absolute difference
Max/Min
Pairwise addition
Folding maximum
Folding minimum
Reciprocal/Sqrt
Shifts by signed variable
Shifts by a constant
Shifts with insert
Loads of a single vector or lane
Store a single vector or lane
Loads of an N‑element structure
Extract lanes from a vector and put into a register
Load a single lane of a vector from a literal
Initialize a vector from a literal bit pattern
Set all lanes to same value
Combining vectors
Splitting vectors
Converting vectors
Table look up
Extended table look up intrinsics
Operations with a scalar value
Vector extract
Reverse vector elements (swap endianness)
Other single operand arithmetic
Logical operations
Transposition operations
Vector reinterpret cast operations
Revisions for the Compiler Reference

List of Tables

1. Compiling with the --asm option
2. Compatible processor or architecture combinations
3. Supported ARM architectures
4. Compiling with the ---interleave option
5. Compiling with the -o option
6. Compiling without the -o option
7. Behavior of constant value initializers in comparison with ISO Standard C
8. Keyword extensions supported by the ARM compiler
9. __declspec attributes supported by the compiler and their equivalents
10. Function attributes supported by the compiler and their equivalents
11. Type attributes supported by the compiler and their equivalents
12. Variable attributes supported by the compiler and their equivalents
13. Pragmas supported by the compiler
14. Instruction intrinsics supported by the ARM compiler
15. Access widths supported by the __ldrex intrinsic
16. Access widths supported by the __ldrex intrinsic
17. Access widths supported by the __ldrt intrinsic
18. Access widths supported by the __strex intrinsic
19. Access widths supported by the __strexd intrinsic
20. Access widths supported by the __strt intrinsic
21. Access widths supported by the __swp intrinsic
22. ETSI basic operations supported by the ARM compilation tools
23. ETSI status flags exposed in the ARM compilation tools
24. TI C55x intrinsics supported by the compilation tools
25. Modifying the FPSCR flags
26. Named registers available on ARM architecture‑based processors
27. Named registers available on targets with floating-point hardware
28. Predefined macros
29. Thumb architecture versions in relation to ARM architecture versions
30. Builtin variables
31. Character escape codes
32. Size and alignment of data types
33. ARMv6 SIMD intrinsics by prefix
34. ARMv6 SIMD intrinsics, summary descriptions, byte lanes, side-effects
35. ARMv6 SIMD intrinsics, compatible processors and architectures
36. ARMv6 SIMD instruction intrinsics and APSR GE flags
37. Supported GNU extensions
38. Major feature support for language
39. Implementation limits
40. Integer ranges
41. Floating‑point limits
42. Other floating‑point characteristics
43. Vector data types
44. Summary of NEON intrinsics
45. Differences between C update 3 and issue C update 4
46. Differences between issue C update 2 and issue C update 3
47. Differences between issue B and issue C
48. Differences between issue A and issue B

Proprietary Notice

Words and logos marked with ™ or ® are registered trademarks or trademarks of ARM in the EU and other countries, except as otherwise stated below in this proprietary notice. Other brands and names mentioned herein may be the trademarks of their respective owners.

Neither the whole nor any part of the information contained in, or the product described in, this document may be adapted or reproduced in any material form except with the prior written permission of the copyright holder.

The product described in this document is subject to continuous developments and improvements. All particulars of the product and its use contained in this document are given by ARM in good faith. However, all warranties implied or expressed, including but not limited to implied warranties of merchantability, or fitness for purpose, are excluded.

This document is intended only to assist the reader in the use of the product. ARM shall not be liable for any loss or damage arising from the use of any information in this document, or any error or omission in such information, or any incorrect use of the product.

Where the term ARM is used it means “ARM or any of its subsidiaries as appropriate”.

Some material in this document is based on IEEE 754 - 1985 IEEE Standard for Binary Floating-Point Arithmetic. The IEEE disclaims any responsibility or liability resulting from the placement and use in the described manner.

Confidentiality Status

This document is Non-Confidential. The right to use, copy and disclose this document may be subject to license restrictions in accordance with the terms of the agreement entered into by ARM and the party that ARM delivered this document to.

Product Status

The information in this document is final, that is for a developed product.

Revision History
Revision A28 May 2010ARM Compiler toolchain v4.1 Release
Revision B30 September 2010Update 1 for ARM Compiler toolchain v4.1
Revision C28 January 2011Update 2 for ARM Compiler toolchain v4.1 Patch 3
Revision C30 April 2011Update 3 for ARM Compiler toolchain v4.1 Patch 4
Revision C29 July 2011Update 4 for ARM Compiler toolchain v4.1 Patch 5
Copyright © 2010-2011 ARM. All rights reserved.ARM DUI 0491C
Non-ConfidentialID080411