ARM® Compiler armcc User Guide

Version 5.05

Table of Contents

About this book
Using this book
Typographic conventions
Other information
1 Overview of the Compiler
1.1 The compiler
1.2 Source language modes of the compiler
1.3 Language extensions
1.4 Language compliance
1.5 The C and C++ libraries
2 Getting Started with the Compiler
2.1 Compiler command-line syntax
2.2 Compiler command-line options listed by group
2.3 Default compiler behavior
2.4 Order of compiler command-line options
2.5 Using stdin to input source code to the compiler
2.6 Directing output to stdout
2.7 Filename suffixes recognized by the compiler
2.8 Compiler output files
2.9 Factors influencing how the compiler searches for header files
2.10 Compiler command-line options and search paths
2.11 Compiler search rules and the current place
2.12 The ARMCC5INC environment variable
2.13 Code compatibility between separately compiled and assembled modules
2.14 Using GCC fallback when building applications
2.15 Linker feedback during compilation
2.16 Unused function code
2.17 Minimizing code size by eliminating unused functions during compilation
2.18 Compilation build time
2.19 Minimizing compilation build time
2.20 Minimizing compilation build time with a single armcc invocation
2.21 Effect of --multifile on compilation build time
2.22 Minimizing compilation build time with parallel make
2.23 Compilation build time and operating system choice
3 Using the NEON Vectorizing Compiler
3.1 NEON technology
3.2 The NEON unit
3.3 Methods of writing code for NEON
3.4 Generating NEON instructions from C or C++ code
3.5 NEON C extensions
3.6 Automatic vectorization
3.7 Data references within a vectorizable loop
3.8 Stride patterns and data accesses
3.9 Factors affecting NEON vectorization performance
3.10 NEON vectorization performance goals
3.11 Recommended loop structure for vectorization
3.12 Data dependency conflicts when vectorizing code
3.13 Carry-around scalar variables and vectorization
3.14 Reduction of a vector to a scalar
3.15 Vectorization on loops containing pointers
3.16 Nonvectorization on loops containing pointers and indirect addressing
3.17 Nonvectorization on conditional loop exits
3.18 Vectorizable loop iteration counts
3.19 Indicating loop iteration counts to the compiler with __promise(expr)
3.20 Grouping structure accesses for vectorization
3.21 Vectorization and struct member lengths
3.22 Nonvectorization of function calls to non-inline functions from within loops
3.23 Conditional statements and efficient vectorization
3.24 Vectorization diagnostics to tune code for improved performance
3.25 Vectorizable code example
3.26 DSP vectorizable code example
3.27 What can limit or prevent automatic vectorization
4 Compiler Features
4.1 Compiler intrinsics
4.2 Performance benefits of compiler intrinsics
4.3 ARM assembler instruction intrinsics
4.4 Generic intrinsics
4.5 Compiler intrinsics for controlling IRQ and FIQ interrupts
4.6 Compiler intrinsics for inserting optimization barriers
4.7 Compiler intrinsics for inserting native instructions
4.8 Compiler intrinsics for Digital Signal Processing (DSP)
4.9 Compiler support for European Telecommunications Standards Institute (ETSI) basic operations
4.10 Overflow and carry status flags for C and C++ code
4.11 Texas Instruments (TI) C55x intrinsics for optimizing C code
4.12 NEON intrinsics provided by the compiler
4.13 Using NEON intrinsics
4.14 Compiler support for accessing registers using named register variables
4.15 Pragmas recognized by the compiler
4.16 Compiler and processor support for bit-banding
4.17 Compiler type attribute, __attribute__((bitband))
4.18 --bitband compiler command-line option
4.19 How the compiler handles bit-band objects placed outside bit-band regions
4.20 Compiler support for thread-local storage
4.21 Compiler support for literal pools
4.22 Compiler eight-byte alignment features
4.23 Using compiler and linker support for symbol versions
4.24 Precompiled Header (PCH) files
4.25 Automatic Precompiled Header (PCH) file processing
4.26 Precompiled Header (PCH) file processing and the header stop point
4.27 Precompiled Header (PCH) file creation requirements
4.28 Compilation with multiple Precompiled Header (PCH) files
4.29 Obsolete Precompiled Header (PCH) files
4.30 Manually specifying the filename and location of a Precompiled Header (PCH) file
4.31 Selectively applying Precompiled Header (PCH) file processing
4.32 Suppressing Precompiled Header (PCH) file processing
4.33 Message output during Precompiled Header (PCH) processing
4.34 Performance issues with Precompiled Header (PCH) files
4.35 Default compiler options that are affected by optimization level
5 Compiler Coding Practices
5.1 The compiler as an optimizing compiler
5.2 Compiler optimization for code size versus speed
5.3 Compiler optimization levels and the debug view
5.4 Selecting the target processor at compile time
5.5 Enabling NEON and FPU for bare-metal
5.6 Optimization of loop termination in C code
5.7 Loop unrolling in C code
5.8 Compiler optimization and the volatile keyword
5.9 Code metrics
5.10 Code metrics for measurement of code size and data size
5.11 Stack use in C and C++
5.12 Benefits of reducing debug information in objects and libraries
5.13 Methods of reducing debug information in objects and libraries
5.14 Guarding against multiple inclusion of header files
5.15 Methods of minimizing function parameter passing overhead
5.16 Returning structures from functions through registers
5.17 Functions that return the same result when called with the same arguments
5.18 Comparison of pure and impure functions
5.19 Recommendation of postfix syntax when qualifying functions with ARM function modifiers
5.20 Inline functions
5.21 Compiler decisions on function inlining
5.22 Automatic function inlining and static functions
5.23 Inline functions and removal of unused out-of-line functions at link time
5.24 Automatic function inlining and multifile compilation
5.25 Restriction on overriding compiler decisions about function inlining
5.26 Compiler modes and inline functions
5.27 Inline functions in C++ and C90 mode
5.28 Inline functions in C99 mode
5.29 Inline functions and debugging
5.30 Types of data alignment
5.31 Advantages of natural data alignment
5.32 Compiler storage of data objects by natural byte alignment
5.33 Relevance of natural data alignment at compile time
5.34 Unaligned data access in C and C++ code
5.35 The __packed qualifier and unaligned data access in C and C++ code
5.36 Unaligned fields in structures
5.37 Performance penalty associated with marking whole structures as packed
5.38 Unaligned pointers in C and C++ code
5.39 Unaligned Load Register (LDR) instructions generated by the compiler
5.40 Comparisons of an unpacked struct, a __packed struct, and a struct with individually __packed fields, and of a __packed struct and a #pragma packed struct
5.41 Compiler support for floating-point arithmetic
5.42 Default selection of hardware or software floating-point support
5.43 Example of hardware and software support differences for floating-point arithmetic
5.44 Vector Floating-Point (VFP) architectures
5.45 Limitations on hardware handling of floating-point arithmetic
5.46 Implementation of Vector Floating-Point (VFP) support code
5.47 Compiler and library support for half-precision floating-point numbers
5.48 Half-precision floating-point number format
5.49 Compiler support for floating-point computations and linkage
5.50 Types of floating-point linkage
5.51 Compiler options for floating-point linkage and computations
5.52 Floating-point linkage and computational requirements of compiler options
5.53 Processors and their implicit Floating-Point Units (FPUs)
5.54 Integer division-by-zero errors in C code
5.55 Software floating-point division-by-zero errors in C code
5.56 About trapping software floating-point division-by-zero errors
5.57 Identification of software floating-point division-by-zero errors
5.58 Software floating-point division-by-zero debugging
5.59 New language features of C99
5.60 New library features of C99
5.61 // comments in C99 and C90
5.62 Compound literals in C99
5.63 Designated initializers in C99
5.64 Hexadecimal floating-point numbers in C99
5.65 Flexible array members in C99
5.66 __func__ predefined identifier in C99
5.67 inline functions in C99
5.68 long long data type in C99 and C90
5.69 Macros with a variable number of arguments in C99
5.70 Mixed declarations and statements in C99
5.71 New block scopes for selection and iteration statements in C99
5.72 _Pragma preprocessing operator in C99
5.73 Restricted pointers in C99
5.74 Additional <math.h> library functions in C99
5.75 Complex numbers in C99
5.76 Boolean type and <stdbool.h> in C99
5.77 Extended integer types and functions in <inttypes.h> and <stdint.h> in C99
5.78 <fenv.h> floating-point environment access in C99
5.79 <stdio.h> snprintf family of functions in C99
5.80 <tgmath.h> type-generic math macros in C99
5.81 <wchar.h> wide character I/O functions in C99
5.82 How to prevent uninitialized data from being initialized to zero
6 Compiler Diagnostic Messages
6.1 Severity of compiler diagnostic messages
6.2 Options that change the severity of compiler diagnostic messages
6.3 Controlling compiler diagnostic messages with pragmas
6.4 Prefix letters in compiler diagnostic messages
6.5 Compiler exit status codes and termination messages
6.6 Compiler data flow warnings
7 Using the Inline and Embedded Assemblers of the ARM Compiler
7.1 Compiler support for inline assembly language
7.2 Inline assembler support in the compiler
7.3 Restrictions on inline assembler support in the compiler
7.4 Inline assembly language syntax with the __asm keyword in C and C++
7.5 Inline assembly language syntax with the asm keyword in C++
7.6 Inline assembler rules for compiler keywords __asm and asm
7.7 Restrictions on inline assembly operations in C and C++ code
7.8 Inline assembler register restrictions in C and C++ code
7.9 Inline assembler processor mode restrictions in C and C++ code
7.10 Inline assembler Thumb instruction set restrictions in C and C++ code
7.11 Inline assembler Vector Floating-Point (VFP) restrictions in C and C++ code
7.12 Inline assembler instruction restrictions in C and C++ code
7.13 Miscellaneous inline assembler restrictions in C and C++ code
7.14 Inline assembler and register access in C and C++ code
7.15 Inline assembler and the # constant expression specifier in C and C++ code
7.16 Inline assembler and instruction expansion in C and C++ code
7.17 Expansion of inline assembler instructions that use constants
7.18 Expansion of inline assembler load and store instructions
7.19 Inline assembler effect on processor condition flags in C and C++ code
7.20 Inline assembler expression operands in C and C++ code
7.21 Inline assembler register list operands in C and C++ code
7.22 Inline assembler intermediate operands in C and C++ code
7.23 Inline assembler function calls and branches in C and C++ code
7.24 Inline assembler branches and labels in C and C++ code
7.25 Inline assembler and virtual registers
7.26 Embedded assembler support in the compiler
7.27 Embedded assembler syntax in C and C++
7.28 Effect of compiler ARM and Thumb states on embedded assembler
7.29 Restrictions on embedded assembly language functions in C and C++ code
7.30 Compiler generation of embedded assembly language functions
7.31 Access to C and C++ compile-time constant expressions from embedded assembler
7.32 Differences between expressions in embedded assembler and C or C++
7.33 Manual overload resolution in embedded assembler
7.34 __offsetof_base keyword for related base classes in embedded assembler
7.35 Compiler-supported keywords for calling class member functions in embedded assembler
7.36 __mcall_is_virtual(D, f)
7.37 __mcall_is_in_vbase(D, f)
7.38 __mcall_offsetof_vbase(D, f)
7.39 __mcall_this_offset(D, f)
7.40 __vcall_offsetof_vfunc(D, f)
7.41 Calling nonstatic member functions in embedded assembler
7.42 Calling a nonvirtual member function
7.43 Calling a virtual member function
7.44 Accessing sp (r13), lr (r14), and pc (r15)
7.45 Differences in compiler support for inline and embedded assembly code
8 Compiler Command-line Options
8.1 -Aopt
8.2 --allow_fpreg_for_nonfpdata, --no_allow_fpreg_for_nonfpdata
8.3 --allow_null_this, --no_allow_null_this
8.4 --alternative_tokens, --no_alternative_tokens
8.5 --anachronisms, --no_anachronisms
8.6 --apcs=qualifier...qualifier
8.7 --arm
8.8 --arm_linux
8.9 --arm_linux_config_file=path
8.10 --arm_linux_configure
8.11 --arm_linux_paths
8.12 --arm_only
8.13 --asm
8.14 --asm_dir=directory_name
8.15 --autoinline, --no_autoinline
8.16 --bigend
8.17 --bitband
8.18 --branch_tables, --no_branch_tables
8.19 --brief_diagnostics, --no_brief_diagnostics
8.20 --bss_threshold=num
8.21 -c
8.22 -C
8.23 --c90
8.24 --c99
8.25 --code_gen, --no_code_gen
8.26 --compatible=name
8.27 --compile_all_input, --no_compile_all_input
8.28 --conditionalize, --no_conditionalize
8.29 --configure_cpp_headers=path
8.30 --configure_extra_includes=paths
8.31 --configure_extra_libraries=paths
8.32 --configure_gas=path
8.33 --configure_gcc=path
8.34 --configure_gcc_version=version
8.35 --configure_gld=path
8.36 --configure_sysroot=path
8.37 --cpp
8.38 --cpp11
8.39 --cpp_compat
8.40 --cpu=list
8.41 --cpu=name compiler option
8.42 --create_pch=filename
8.43 -Dname[(parm-list)][=def]
8.44 --data_reorder, --no_data_reorder
8.45 --debug, --no_debug
8.46 --debug_macros, --no_debug_macros
8.47 --default_definition_visibility=visibility
8.48 --default_extension=ext
8.49 --dep_name, --no_dep_name
8.50 --depend=filename
8.51 --depend_dir=directory_name
8.52 --depend_format=string
8.53 --depend_single_line, --no_depend_single_line
8.54 --depend_system_headers, --no_depend_system_headers
8.55 --depend_target=target
8.56 --device=name
8.57 --diag_error=tag[,tag,...]
8.58 --diag_remark=tag[,tag,...]
8.59 --diag_style=arm|ide|gnu compiler option
8.60 --diag_suppress=tag[,tag,...]
8.61 --diag_suppress=optimizations
8.62 --diag_warning=tag[,tag,...]
8.63 --diag_warning=optimizations
8.64 --dllexport_all, --no_dllexport_all
8.65 --dllimport_runtime, --no_dllimport_runtime
8.66 --dollar, --no_dollar
8.67 --dwarf2
8.68 --dwarf3
8.69 -E
8.70 --echo
8.71 --emit_frame_directives, --no_emit_frame_directives
8.72 --enum_is_int
8.73 --errors=filename
8.74 --exceptions, --no_exceptions
8.75 --exceptions_unwind, --no_exceptions_unwind
8.76 --execstack, --no_execstack
8.77 --execute_only
8.78 --export_all_vtbl, --no_export_all_vtbl
8.79 --export_defs_implicitly, --no_export_defs_implicitly
8.80 --extended_initializers, --no_extended_initializers
8.81 --feedback=filename
8.82 --float_literal_pools, --no_float_literal_pools
8.83 --force_new_nothrow, --no_force_new_nothrow
8.84 --forceinline
8.85 --fp16_format=format
8.86 --fpmode=model
8.87 --fpu=list
8.88 --fpu=name compiler option
8.89 --friend_injection, --no_friend_injection
8.90 -g
8.91 --global_reg=reg_name[,reg_name,...]
8.92 --gnu
8.93 --gnu_defaults
8.94 --gnu_instrument, --no_gnu_instrument
8.95 --gnu_version=version
8.96 --guiding_decls, --no_guiding_decls
8.97 --help
8.98 --hide_all, --no_hide_all
8.99 -Idir[,dir,...]
8.100 --ignore_missing_headers
8.101 --implicit_include, --no_implicit_include
8.102 --implicit_include_searches, --no_implicit_include_searches
8.103 --implicit_key_function, --no_implicit_key_function
8.104 --implicit_typename, --no_implicit_typename
8.105 --import_all_vtbl
8.106 --info=totals
8.107 --inline, --no_inline
8.108 --integer_literal_pools, --no_integer_literal_pools
8.109 --interface_enums_are_32_bit
8.110 --interleave
8.111 -Jdir[,dir,...]
8.112 --kandr_include
8.113 -Lopt
8.114 --library_interface=lib
8.115 --library_type=lib
8.116 --licretry
8.117 --link_all_input, --no_link_all_input
8.118 --list
8.119 --list_dir=directory_name
8.120 --list_macros
8.121 --littleend
8.122 --locale=lang_country
8.123 --long_long
8.124 --loop_optimization_level=opt
8.125 --loose_implicit_cast
8.126 --lower_ropi, --no_lower_ropi
8.127 --lower_rwpi, --no_lower_rwpi
8.128 -M
8.129 --md
8.130 --message_locale=lang_country[.codepage]
8.131 --min_array_alignment=opt
8.132 --mm
8.133 --multibyte_chars, --no_multibyte_chars
8.134 --multifile, --no_multifile
8.135 --multiply_latency=cycles
8.136 --narrow_volatile_bitfields
8.137 --nonstd_qualifier_deduction, --no_nonstd_qualifier_deduction
8.138 -o filename
8.139 -Onum
8.140 --old_specializations, --no_old_specializations
8.141 --old_style_preprocessing
8.142 -Ospace
8.143 -Otime
8.144 --output_dir=directory_name
8.145 -P
8.146 --parse_templates, --no_parse_templates
8.147 --pch
8.148 --pch_dir=dir
8.149 --pch_messages, --no_pch_messages
8.150 --pch_verbose, --no_pch_verbose
8.151 --pending_instantiations=n
8.152 --phony_targets
8.153 --pointer_alignment=num
8.154 --preinclude=filename
8.155 --preprocess_assembly
8.156 --preprocessed
8.157 --protect_stack, --no_protect_stack
8.158 --reassociate_saturation, --no_reassociate_saturation
8.159 --reduce_paths, --no_reduce_paths
8.160 --relaxed_ref_def, --no_relaxed_ref_def
8.161 --remarks
8.162 --remove_unneeded_entities, --no_remove_unneeded_entities
8.163 --restrict, --no_restrict
8.164 --retain=option
8.165 --rtti, --no_rtti
8.166 --rtti_data, --no_rtti_data
8.167 -S
8.168 --share_inlineable_strings, --no_share_inlineable_strings
8.169 --shared
8.170 --show_cmdline
8.171 --signed_bitfields, --unsigned_bitfields
8.172 --signed_chars, --unsigned_chars
8.173 --split_ldm
8.174 --split_sections
8.175 --strict, --no_strict
8.176 --strict_warnings
8.177 --string_literal_pools, --no_string_literal_pools
8.178 --sys_include
8.179 --thumb
8.180 --translate_g++
8.181 --translate_gcc
8.182 --translate_gld
8.183 --trigraphs, --no_trigraphs
8.184 --type_traits_helpers, --no_type_traits_helpers
8.185 -Uname
8.186 --unaligned_access, --no_unaligned_access
8.187 --use_frame_pointer, --no_use_frame_pointer
8.188 --use_gas
8.189 --use_pch=filename
8.190 --using_std, --no_using_std
8.191 --vectorize, --no_vectorize
8.192 --version_number
8.193 --vfe, --no_vfe
8.194 --via=filename
8.195 --visibility_inlines_hidden
8.196 --vla, --no_vla
8.197 --vsn
8.198 -W
8.199 -Warmcc,option[,option,...]
8.200 -Warmcc,--gcc_fallback
8.201 --wchar, --no_wchar
8.202 --wchar16
8.203 --wchar32
8.204 --whole_program
8.205 --wrap_diagnostics, --no_wrap_diagnostics
9 Language Extensions
9.1 Preprocessor extensions
9.2 #assert
9.3 #include_next
9.4 #unassert
9.5 #warning
9.6 C99 language features available in C90
9.7 // comments
9.8 Subscripting struct
9.9 Flexible array members
9.10 C99 language features available in C++ and C90
9.11 Variadic macros
9.12 long long
9.13 restrict
9.14 Hexadecimal floats
9.15 Standard C language extensions
9.16 Constant expressions
9.17 Array and pointer extensions
9.18 Block scope function declarations
9.19 Dollar signs in identifiers
9.20 Top-level declarations
9.21 Benign redeclarations
9.22 External entities
9.23 Function prototypes
9.24 Standard C++ language extensions
9.25 ? operator
9.26 Declaration of a class member
9.27 friend
9.28 Read/write constants
9.29 Scalar type constants
9.30 Specialization of nonmember function templates
9.31 Type conversions
9.32 Standard C and Standard C++ language extensions
9.33 Address of a register variable
9.34 Arguments to functions
9.35 Anonymous classes, structures and unions
9.36 Assembler labels
9.37 Empty declaration
9.38 Hexadecimal floating-point constants
9.39 Incomplete enums
9.40 Integral type extensions
9.41 Label definitions
9.42 Long float
9.43 Nonstatic local variables
9.44 Structure, union, enum, and bitfield extensions
9.45 GNU extensions to the C and C++ languages
10 Compiler-specific Features
10.1 Keywords and operators
10.2 __align
10.3 __ALIGNOF__
10.4 __alignof__
10.5 __asm
10.6 __forceinline
10.7 __global_reg
10.8 __inline
10.9 __int64
10.10 __INTADDR__
10.11 __irq
10.12 __packed
10.13 __pure
10.14 __smc
10.15 __softfp
10.16 __svc
10.17 __svc_indirect
10.18 __svc_indirect_r7
10.19 __value_in_regs
10.20 __weak
10.21 __writeonly
10.22 __declspec attributes
10.23 __declspec(dllexport)
10.24 __declspec(dllimport)
10.25 __declspec(noinline)
10.26 __declspec(noreturn)
10.27 __declspec(nothrow)
10.28 __declspec(notshared)
10.29 __declspec(thread)
10.30 Function attributes
10.31 __attribute__((alias)) function attribute
10.32 __attribute__((always_inline)) function attribute
10.33 __attribute__((const)) function attribute
10.34 __attribute__((constructor[(priority)])) function attribute
10.35 __attribute__((deprecated)) function attribute
10.36 __attribute__((destructor[(priority)])) function attribute
10.37 __attribute__((format_arg(string-index))) function attribute
10.38 __attribute__((malloc)) function attribute
10.39 __attribute__((noinline)) function attribute
10.40 __attribute__((no_instrument_function)) function attribute
10.41 __attribute__((nomerge)) function attribute
10.42 __attribute__((nonnull)) function attribute
10.43 __attribute__((noreturn)) function attribute
10.44 __attribute__((notailcall)) function attribute
10.45 __attribute__((nothrow)) function attribute
10.46 __attribute__((pcs("calling_convention"))) function attribute
10.47 __attribute__((pure)) function attribute
10.48 __attribute__((section("name"))) function attribute
10.49 __attribute__((sentinel)) function attribute
10.50 __attribute__((unused)) function attribute
10.51 __attribute__((used)) function attribute
10.52 __attribute__((visibility("visibility_type"))) function attribute
10.53 __attribute__((weak)) function attribute
10.54 __attribute__((weakref("target"))) function attribute
10.55 Type attributes
10.56 __attribute__((bitband)) type attribute
10.57 __attribute__((aligned)) type attribute
10.58 __attribute__((packed)) type attribute
10.59 __attribute__((transparent_union)) type attribute
10.60 Variable attributes
10.61 __attribute__((alias)) variable attribute
10.62 __attribute__((at(address))) variable attribute
10.63 __attribute__((aligned)) variable attribute
10.64 __attribute__((deprecated)) variable attribute
10.65 __attribute__((noinline)) constant variable attribute
10.66 __attribute__((packed)) variable attribute
10.67 __attribute__((section("name"))) variable attribute
10.68 __attribute__((unused)) variable attribute
10.69 __attribute__((used)) variable attribute
10.70 __attribute__((visibility("visibility_type"))) variable attribute
10.71 __attribute__((weak)) variable attribute
10.72 __attribute__((weakref("target"))) variable attribute
10.73 __attribute__((zero_init)) variable attribute
10.74 Pragmas
10.75 #pragma anon_unions, #pragma no_anon_unions
10.76 #pragma arm
10.77 #pragma arm section [section_type_list]
10.78 #pragma diag_default tag[,tag,...]
10.79 #pragma diag_error tag[,tag,...]
10.80 #pragma diag_remark tag[,tag,...]
10.81 #pragma diag_suppress tag[,tag,...]
10.82 #pragma diag_warning tag[, tag, ...]
10.83 #pragma exceptions_unwind, #pragma no_exceptions_unwind
10.84 #pragma GCC system_header
10.85 #pragma hdrstop
10.86 #pragma import symbol_name
10.87 #pragma import(__use_full_stdio)
10.88 #pragma import(__use_smaller_memcpy)
10.89 #pragma inline, #pragma no_inline
10.90 #pragma no_pch
10.91 #pragma Onum
10.92 #pragma once
10.93 #pragma Ospace
10.94 #pragma Otime
10.95 #pragma pack(n)
10.96 #pragma pop
10.97 #pragma push
10.98 #pragma softfp_linkage, #pragma no_softfp_linkage
10.99 #pragma thumb
10.100 #pragma unroll [(n)]
10.101 #pragma unroll_completely
10.102 #pragma weak symbol, #pragma weak symbol1 = symbol2
10.103 Instruction intrinsics
10.104 __breakpoint intrinsic
10.105 __cdp intrinsic
10.106 __clrex intrinsic
10.107 __clz intrinsic
10.108 __current_pc intrinsic
10.109 __current_sp intrinsic
10.110 __disable_fiq intrinsic
10.111 __disable_irq intrinsic
10.112 __enable_fiq intrinsic
10.113 __enable_irq intrinsic
10.114 __fabs intrinsic
10.115 __fabsf intrinsic
10.116 __force_stores intrinsic
10.117 __ldrex intrinsic
10.118 __ldrexd intrinsic
10.119 __ldrt intrinsic
10.120 __memory_changed intrinsic
10.121 __nop intrinsic
10.122 __pld intrinsic
10.123 __pldw intrinsic
10.124 __pli intrinsic
10.125 __promise intrinsic
10.126 __qadd intrinsic
10.127 __qdbl intrinsic
10.128 __qsub intrinsic
10.129 __rbit intrinsic
10.130 __rev intrinsic
10.131 __return_address intrinsic
10.132 __ror intrinsic
10.133 __schedule_barrier intrinsic
10.134 __semihost intrinsic
10.135 __sev intrinsic
10.136 __sqrt intrinsic
10.137 __sqrtf intrinsic
10.138 __ssat intrinsic
10.139 __strex intrinsic
10.140 __strexd intrinsic
10.141 __strt intrinsic
10.142 __swp intrinsic
10.143 __usat intrinsic
10.144 __wfe intrinsic
10.145 __wfi intrinsic
10.146 __yield intrinsic
10.147 ARMv6 SIMD intrinsics
10.148 ETSI basic operations
10.149 C55x intrinsics
10.150 VFP status intrinsic
10.151 __vfp_status intrinsic
10.152 Fused Multiply Add (FMA) intrinsics
10.153 Named register variables
10.154 GNU built-in functions
10.155 Predefined macros
10.156 Built-in function name variables
11 C and C++ Implementation Details
11.1 Character sets and identifiers in ARM C and C++
11.2 Basic data types in ARM C and C++
11.3 Operations on basic data types ARM C and C++
11.4 Structures, unions, enumerations, and bitfields in ARM C and C++
11.5 Using the ::operator new function in ARM C++
11.6 Tentative arrays in ARM C++
11.7 Old-style C parameters in ARM C++ functions
11.8 Anachronisms in ARM C++
11.9 Template instantiation in ARM C++
11.10 Namespaces in ARM C++
11.11 C++ exception handling in ARM C++
11.12 Extern inline functions in ARM C++
11.13 C++11 supported features
12 ARMv6 SIMD Instruction Intrinsics
12.1 ARMv6 SIMD intrinsics by prefix
12.2 ARMv6 SIMD intrinsics, summary descriptions, byte lanes, affected flags
12.3 ARMv6 SIMD intrinsics, compatible processors and architectures
12.4 ARMv6 SIMD instruction intrinsics and APSR GE flags
12.5 __qadd16 intrinsic
12.6 __qadd8 intrinsic
12.7 __qasx intrinsic
12.8 __qsax intrinsic
12.9 __qsub16 intrinsic
12.10 __qsub8 intrinsic
12.11 __sadd16 intrinsic
12.12 __sadd8 intrinsic
12.13 __sasx intrinsic
12.14 __sel intrinsic
12.15 __shadd16 intrinsic
12.16 __shadd8 intrinsic
12.17 __shasx intrinsic
12.18 __shsax intrinsic
12.19 __shsub16 intrinsic
12.20 __shsub8 intrinsic
12.21 __smlad intrinsic
12.22 __smladx intrinsic
12.23 __smlald intrinsic
12.24 __smlaldx intrinsic
12.25 __smlsd intrinsic
12.26 __smlsdx intrinsic
12.27 __smlsld intrinsic
12.28 __smlsldx intrinsic
12.29 __smuad intrinsic
12.30 __smuadx intrinsic
12.31 __smusd intrinsic
12.32 __smusdx intrinsic
12.33 __ssat16 intrinsic
12.34 __ssax intrinsic
12.35 __ssub16 intrinsic
12.36 __ssub8 intrinsic
12.37 __sxtab16 intrinsic
12.38 __sxtb16 intrinsic
12.39 __uadd16 intrinsic
12.40 __uadd8 intrinsic
12.41 __uasx intrinsic
12.42 __uhadd16 intrinsic
12.43 __uhadd8 intrinsic
12.44 __uhasx intrinsic
12.45 __uhsax intrinsic
12.46 __uhsub16 intrinsic
12.47 __uhsub8 intrinsic
12.48 __uqadd16 intrinsic
12.49 __uqadd8 intrinsic
12.50 __uqasx intrinsic
12.51 __uqsax intrinsic
12.52 __uqsub16 intrinsic
12.53 __uqsub8 intrinsic
12.54 __usad8 intrinsic
12.55 __usada8 intrinsic
12.56 __usat16 intrinsic
12.57 __usax intrinsic
12.58 __usub16 intrinsic
12.59 __usub8 intrinsic
12.60 __uxtab16 intrinsic
12.61 __uxtb16 intrinsic
13 Via File Syntax
13.1 Overview of via files
13.2 Via file syntax rules
14 Summary Table of GNU Language Extensions
14.1 Supported GNU extensions
15 Standard C Implementation Definition
15.1 Implementation definition
15.2 Translation
15.3 Environment
15.4 Identifiers
15.5 Characters
15.6 Integers
15.7 Floating-point
15.8 Arrays and pointers
15.9 Registers
15.10 Structures, unions, enumerations, and bitfields
15.11 Qualifiers
15.12 Expression evaluation
15.13 Preprocessing directives
15.14 Library functions
15.15 Behaviors considered undefined by the ISO C Standard
16 Standard C++ Implementation Definition
16.1 Integral conversion
16.2 Calling a pure virtual function
16.3 Major features of language support
16.4 Standard C++ library implementation definition
17 C and C++ Compiler Implementation Limits
17.1 C++ ISO/IEC standard limits
17.2 Limits for integral numbers
17.3 Limits for floating-point numbers
18 Using NEON Support
18.1 Introduction to NEON intrinsics
18.2 Vector data types
18.3 NEON intrinsics
18.4 NEON intrinsics for addition
18.5 NEON intrinsics for multiplication
18.6 NEON intrinsics for subtraction
18.7 NEON intrinsics for comparison
18.8 NEON intrinsics for absolute difference
18.9 NEON intrinsics for maximum and minimum
18.10 NEON intrinsics for pairwise addition
18.11 NEON intrinsics for folding maximum
18.12 NEON intrinsics for folding minimum
18.13 NEON intrinsics for reciprocal and sqrt
18.14 NEON intrinsics for shifts by signed variable
18.15 NEON intrinsics for shifts by a constant
18.16 NEON intrinsics for shifts with insert
18.17 NEON intrinsics for loading a single vector or lane
18.18 NEON intrinsics for storing a single vector or lane
18.19 NEON intrinsics for loading an N-element structure
18.20 NEON intrinsics for extracting lanes from a vector into a register
18.21 NEON intrinsics for loading a single lane of a vector from a literal
18.22 NEON intrinsics for initializing a vector from a literal bit pattern
18.23 NEON intrinsics for setting all lanes to the same value
18.24 NEON intrinsics for combining vectors
18.25 NEON intrinsics for splitting vectors
18.26 NEON intrinsics for converting vectors
18.27 NEON intrinsics for table look up
18.28 NEON intrinsics for extended table look up
18.29 NEON intrinsics for operations with a scalar value
18.30 NEON intrinsics for vector extraction
18.31 NEON intrinsics for reversing vector elements (swap endianness)
18.32 NEON intrinsics for other single operand arithmetic
18.33 NEON intrinsics for logical operations
18.34 NEON intrinsics for transposition operations
18.35 NEON intrinsics for vector cast operations
18.36 NEON instructions without equivalent intrinsics
A Compiler Document Revisions
A.1 Revisions for armcc Compiler User Guide

List of Figures

2-1 GCC fallback process diagram
5-1 Half-precision floating-point format
10-1 Nonpacked structure S
10-2 Packed structure SP
11-1 Conventional nonpacked structure example
11-2 Bitfield allocation 1
11-3 Bitfield allocation 2
15-1 Conventional nonpacked structure example
15-2 Bitfield allocation 1
15-3 Bitfield allocation 2

List of Tables

2-1 Filename suffixes recognized by the compiler
2-2 Include file search paths
3-1 Array A
3-2 Array B
3-3 Result
3-4 Vectorizable and nonvectorizable loops
3-5 Factors that limit or prevent automatic vectorization
5-1 C code for incrementing and decrementing loops
5-2 C Disassembly for incrementing and decrementing loops
5-3 C code for rolled and unrolled bit-counting loops
5-4 Disassembly for rolled and unrolled bit-counting loops
5-5 C code for nonvolatile and volatile buffer loops
5-6 Disassembly for nonvolatile and volatile buffer loop
5-7 C code for pure and impure functions
5-8 Disassembly for pure and impure functions
5-9 Compiler storage of data objects by byte alignment
5-10 C code for an unpacked struct, a packed struct, and a struct with individually packed fields
5-11 Disassembly for an unpacked struct, a packed struct, and a struct with individually packed fields
5-12 C code for a packed struct and a pragma packed struct
5-13 Compiler options for floating-point linkage and floating-point computations
5-14 FPU-option capabilities and requirements
5-15 Implicit FPUs of processors
6-1 Severity of diagnostic messages
6-2 Identifying diagnostic messages
7-1 Differences between inline and embedded assembler
8-1 Compiling with the --asm option
8-2 Compatible processor or architecture combinations
8-3 Supported ARM architectures
8-4 Compiling with the --interleave option
8-5 Compiling with the -o option
8-6 Compiling without the -o option
9-1 Behavior of constant value initializers in comparison with ISO Standard C
10-1 Keyword extensions that the ARM compiler supports
10-2 __declspec attributes that the compiler supports, and their equivalents
10-3 Function attributes that the compiler supports, and their equivalents
10-4 Type attributes that the compiler supports, and their equivalents
10-5 Variable attributes that the compiler supports, and their equivalents
10-6 Pragmas that the compiler supports
10-7 Instruction intrinsics that the ARM compiler supports
10-8 Access widths that the __ldrex intrinsic supports
10-9 Access widths that the __ldrex intrinsic supports
10-10 Access widths that the __ldrt intrinsic supports
10-11 Access widths that the __strex intrinsic supports
10-12 Access widths that the __strexd intrinsic supports
10-13 Access widths that the __strt intrinsic supports
10-14 Access widths that the __swp intrinsic supports
10-15 ETSI basic operations that the ARM compilation tools support
10-16 ETSI status flags exposed in the ARM compilation tools
10-17 TI C55x intrinsics that the compilation tools support
10-18 Modifying the FPSCR flags
10-19 Named registers available on ARM architecture-based processors
10-20 Named registers available on targets with floating-point hardware
10-21 Predefined macros
10-22 Thumb architecture versions in relation to ARM architecture versions
10-23 built-in variables
11-1 Character escape codes
11-2 Size and alignment of data types
12-1 ARMv6 SIMD intrinsics by prefix
12-2 ARMv6 SIMD intrinsics, summary descriptions, byte lanes, affected flags
12-3 ARMv6 SIMD intrinsics, compatible processors and architectures
12-4 ARMv6 SIMD instruction intrinsics and APSR GE flags
14-1 Supported GNU extensions
15-1 Character escape codes
16-1 Major feature support for language
17-1 Implementation limits
17-2 Integer ranges
17-3 Floating-point limits
17-4 Other floating-point characteristics
18-1 Vector data types
18-2 NEON instructions without equivalent intrinsics
A-1 Differences between issue J and issue K
A-2 Differences between issue I and issue J
A-3 Differences between issue H and issue I
A-4 Differences between issue G and issue H
A-5 Differences between issue F and issue G
A-6 Differences between issue E and issue F
A-7 Differences between issue D and issue E
A-8 Differences between issue C and issue D
A-9 Differences between issue B and issue C
A-10 Differences between issue A and issue B

Release Information

Document History
Issue Date Confidentiality Change
A 28 May 2010 Non-Confidential ARM Compiler v4.1 Release
B 30 September 2010 Non-Confidential Update 1 for ARM Compiler v4.1
C 28 January 2011 Non-Confidential Update 2 for ARM Compiler v4.1 Patch 3
D 30 April 2011 Non-Confidential ARM Compiler v5.0 Release
E 29 July 2011 Non-Confidential Update 1 for ARM Compiler v5.0
F 30 September 2011 Non-Confidential ARM Compiler v5.01 Release
G 29 February 2012 Non-Confidential Document update 1 for ARM Compiler v5.01 Release
H 27 July 2012 Non-Confidential ARM Compiler v5.02 Release
I 31 January 2013 Non-Confidential ARM Compiler v5.03 Release
J 27 November 2013 Non-Confidential ARM Compiler v5.04 Release
K 10 September 2014 Non-Confidential ARM Compiler v5.05 Release

Non-Confidential Proprietary Notice

This document is protected by copyright and other related rights and the practice or implementation of the information contained in this document may be protected by one or more patents or pending patent applications. No part of this document may be reproduced in any form by any means without the express prior written permission of ARM. No license, express or implied, by estoppel or otherwise to any intellectual property rights is granted by this document unless specifically stated.
Your access to the information in this document is conditional upon your acceptance that you will not use or permit others to use the information for the purposes of determining whether implementations infringe any third party patents.
THIS DOCUMENT IS PROVIDED “AS IS”. ARM PROVIDES NO REPRESENTATIONS AND NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY, SATISFACTORY QUALITY, NON-INFRINGEMENT OR FITNESS FOR A PARTICULAR PURPOSE WITH RESPECT TO THE DOCUMENT. For the avoidance of doubt, ARM makes no representation with respect to, and has undertaken no analysis to identify or understand the scope and content of, third party patents, copyrights, trade secrets, or other rights.
This document may include technical inaccuracies or typographical errors.
This document consists solely of commercial items. You shall be responsible for ensuring that any use, duplication or disclosure of this document complies fully with any relevant export laws and regulations to assure that this document or any portion thereof is not exported, directly or indirectly, in violation of such export laws. Use of the word “partner” in reference to ARM’s customers is not intended to create or refer to any partnership relationship with any other company. ARM may make changes to this document at any time and without notice.
If any of the provisions contained in these terms conflict with any of the provisions of any signed written agreement covering this document with ARM, then the signed written agreement prevails over and supersedes the conflicting provisions of these terms. This document may be translated into other languages for convenience, and you agree that if there is any conflict between the English version of this document and any translation, the terms of the English version of the Agreement shall prevail.
Copyright © [2010-2014], ARM Limited or its affiliates. All rights reserved.
ARM Limited. Company 02557590 registered in England.
110 Fulbourn Road, Cambridge, England CB1 9NJ.

Additional Notices

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.
Unrestricted Access is an ARM internal classification.

Product Status

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

Web Address

Non-ConfidentialPDF file icon PDF versionARM DUI0472K
Copyright © 2010-2014 ARM. All rights reserved.