Keil Logo

Technical Support

On-Line Manuals

Compiler User Guide

Preface Overview of the Compiler Getting Started with the Compiler Compiler Features Compiler Coding Practices Compiler Diagnostic Messages Using the Inline and Embedded Assemblers of the AR Compiler Command-line Options -Aopt --allow_fpreg_for_nonfpdata, --no_allow_fpreg_for_ --allow_null_this, --no_allow_null_this --alternative_tokens, --no_alternative_tokens --anachronisms, --no_anachronisms --apcs=qualifier...qualifier --arm --arm_only --asm --asm_dir=directory_name --autoinline, --no_autoinline --bigend --bitband --branch_tables, --no_branch_tables --brief_diagnostics, --no_brief_diagnostics --bss_threshold=num -c -C --c90 --c99 --code_gen, --no_code_gen --comment_section, --no_comment_section --compatible=name --compile_all_input, --no_compile_all_input --conditionalize, --no_conditionalize --cpp --cpp11 --cpp_compat --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_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_header --depend_target=target --diag_error=tag[,tag,...] --diag_remark=tag[,tag,...] --diag_style=arm|ide|gnu compiler option --diag_suppress=tag[,tag,...] --diag_suppress=optimizations --diag_warning=tag[,tag,...] --diag_warning=optimizations --dollar, --no_dollar --dwarf2 --dwarf3 -E --echo --emit_frame_directives, --no_emit_frame_directive --enum_is_int --errors=filename --exceptions, --no_exceptions --exceptions_unwind, --no_exceptions_unwind --execute_only --extended_initializers, --no_extended_initializer --feedback=filename --float_literal_pools, --no_float_literal_pools --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 --guiding_decls, --no_guiding_decls --help -Idir[,dir,...] --ignore_missing_headers --implicit_include, --no_implicit_include --implicit_include_searches, --no_implicit_include --implicit_key_function, --no_implicit_key_functio --implicit_typename, --no_implicit_typename --info=totals --inline, --no_inline --integer_literal_pools, --no_integer_literal_pool --interface_enums_are_32_bit --interleave -Jdir[,dir,...] --kandr_include -Lopt --library_interface=lib --library_type=lib --liclinger=seconds --link_all_input, --no_link_all_input --list --list_dir=directory_name --list_macros --littleend --locale=lang_country --long_long --loop_optimization_level=opt --loose_implicit_cast --lower_ropi, --no_lower_ropi --lower_rwpi, --no_lower_rwpi -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_qualifie -o filename -Onum --old_specializations, --no_old_specializations --old_style_preprocessing --omf_browse --ool_section_name, --no_ool_section_name -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 --preprocess_assembly --preprocessed --protect_stack, --no_protect_stack --reassociate_saturation, --no_reassociate_saturat --reduce_paths, --no_reduce_paths --remarks --remove_unneeded_entities, --no_remove_unneeded_e --restrict, --no_restrict --retain=option --rtti, --no_rtti --rtti_data, --no_rtti_data -S --share_inlineable_strings, --no_share_inlineable_ --show_cmdline --signed_bitfields, --unsigned_bitfields --signed_chars, --unsigned_chars --split_ldm --split_sections --strict, --no_strict --strict_warnings --string_literal_pools, --no_string_literal_pools --sys_include --thumb --trigraphs, --no_trigraphs --type_traits_helpers, --no_type_traits_helpers -Uname --unaligned_access, --no_unaligned_access --use_frame_pointer, --no_use_frame_pointer --use_pch=filename --using_std, --no_using_std --version_number --vfe, --no_vfe --via=filename --vla, --no_vla --vsn -W --wchar, --no_wchar --wchar16 --wchar32 --whole_program --wrap_diagnostics, --no_wrap_diagnostics Language Extensions Compiler-specific Features C and C++ Implementation Details What is Semihosting? Via File Syntax Summary Table of GNU Language Extensions Standard C Implementation Definition Standard C++ Implementation Definition C and C++ Compiler Implementation Limits

--fpu=name

7.70 --fpu=name

Specifies the target FPU architecture.

If you specify this option, it overrides any implicit FPU option that appears on the command line, for example, where you use the --cpu option.
The compiler sets a build attribute corresponding to name in the object file. The linker determines compatibility between object files, and selection of libraries, accordingly.
To obtain a full list of FPU architectures use the --fpu=list option.

Syntax

--fpu=name
Where name is one of:
none
Selects no floating-point option. No floating-point code is to be used. This makes your object file compatible with other object files built with any FPU.
This produces an error if your code contains float types.
vfp
This is a synonym for vfpv2.
vfpv2
Selects a hardware vector floating-point unit conforming to architecture VFPv2.

Note

If you enter armcc --thumb --fpu=vfpv2 on the command line, the compiler compiles as much of the code using the Thumb instruction set as possible, but hard floating-point sensitive functions are compiled to ARM code. In this case, the value of the predefine __thumb is not correct.
vfpv3
Selects a hardware vector floating-point unit conforming to architecture VFPv3. VFPv3 is backwards compatible with VFPv2 except that VFPv3 cannot trap floating-point exceptions.
vfpv3_fp16
Selects a hardware vector floating-point unit conforming to architecture VFPv3 that also provides the half-precision extensions.
vfpv3_d16
Selects a hardware vector floating-point unit conforming to VFPv3-D16 architecture.
vfpv3_d16_fp16
Selects a hardware vector floating-point unit conforming to VFPv3-D16 architecture, that also provides the half-precision extensions.
vfpv4
Selects a hardware floating-point unit conforming to the VFPv4 architecture.
vfpv4_d16
Selects a hardware floating-point unit conforming to the VFPv4-D16 architecture.
fpv4-sp
Selects a hardware floating-point unit conforming to the single precision variant of the FPv4 architecture.
fpv5_d16
Selects a hardware floating-point unit conforming to the FPv5-D16 architecture.
fpv5-sp
Selects a hardware floating-point unit conforming to the single precision variant of the FPv5 architecture.
softvfp
Selects software floating-point support where floating-point operations are performed by a floating-point library, fplib. This is the default if you do not specify a --fpu option, or if you select a processor that does not have an FPU.
softvfp+vfpv2
Selects a hardware vector floating-point unit conforming to VFPv2, with software floating-point linkage. Select this option if you are interworking Thumb code with ARM code on a system that implements a VFP unit.
If you select this option:
  • Building with --thumb behaves in a similar way to --fpu=softvfp except that it links with floating-point libraries that use VFP instructions.
  • Building with --arm behaves in a similar way to --fpu=vfpv2 except that all functions are given software floating-point linkage. This means that functions pass and return floating-point arguments and results in the same way as --fpu=softvfp, but use VFP instructions internally.

Note

If you specify softvfp+vfpv2 with the --arm or --thumb option for C code, it ensures that your interworking floating-point code is compiled to use software floating-point linkage.
softvfp+vfpv3
Selects a hardware vector floating-point unit conforming to VFPv3, with software floating-point linkage.
softvfp+vfpv3_fp16
Selects a hardware vector floating-point unit conforming to VFPv3-fp16, with software floating-point linkage.
softvfp+vfpv3_d16
Selects a hardware vector floating-point unit conforming to VFPv3-D16, with software floating-point linkage.
softvfp+vfpv3_d16_fp16
Selects a hardware vector floating-point unit conforming to VFPv3-D16-fp16, with software floating-point linkage.
softvfp+vfpv4
Selects a hardware floating-point unit conforming to FPv4, with software floating-point linkage.
softvfp+vfpv4_d16
Selects a hardware floating-point unit conforming to VFPv4-D16, with software floating-point linkage.
softvfp+fpv4-sp
Selects a hardware floating-point unit conforming to FPv4-SP, with software floating-point linkage.
softvfp+fpv5_d16
Selects a hardware floating-point unit conforming to FPv5-D16, with software floating-point linkage.
softvfp+fpv5-sp
Selects a hardware floating-point unit conforming to FPv5-SP, with software floating-point linkage.

Usage

Any FPU explicitly selected using the --fpu option always overrides any FPU implicitly selected using the --cpu option.
To control floating-point linkage without affecting the choice of FPU, you can use --apcs=/softfp or --apcs=/hardfp.

Restrictions

The compiler only permits hardware VFP architectures (for example, --fpu=vfpv3, --fpu=softvfp+vfpv2), to be specified when MRRC and MCRR instructions are supported in the processor instruction set. MRRC and MCRR instructions are not supported in 4, 4T, 5T and 6-M. Therefore, the compiler does not allow the use of these architectures with hardware VFP architectures.
Other than this, the compiler does not check that --cpu and --fpu combinations are valid. Beyond the scope of the compiler, additional architectural constraints apply. For example, VFPv3 is not supported with architectures prior to ARMv7. Therefore, the combination of --fpu and --cpu options permitted by the compiler does not necessarily translate to the actual device in use.
The compiler only generates scalar floating-point operations. If you want to use VFP vector operations, you must do this using assembly code.

Default

The default target FPU architecture is derived from the use of the --cpu option.
If the processor specified with --cpu has a VFP coprocessor, the default target FPU architecture is the VFP architecture for that processor. If a VFP coprocessor is present, VFP instructions are generated.
If there is no VFP coprocessor, the compiler generates code that makes calls to the software floating-point library fplib to carry out floating-point operations.
Related information
Non-ConfidentialPDF file icon PDF versionARM DUI0375H
Copyright © 2007, 2008, 2011, 2012, 2014-2016 ARM. All rights reserved. 
  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.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.