Keil Logo Arm Logo

Technical Support

On-Line Manuals

Compiler Reference Guide

Conventions and Feedback Introduction 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=qualifer...qualifier --arm --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 --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_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} --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 --extended_initializers, --no_extended_initializer --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,...] --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 --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 --nonstd_qualifier_deduction, --no_nonstd_qualifie -o filename -Onum --old_specializations, --no_old_specializations --old_style_preprocessing --omf_browse -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 --show_cmdline --signed_bitfields, --unsigned_bitfields --signed_chars, --unsigned_chars --split_ldm --split_sections --strict, --no_strict --strict_warnings --sys_include --thumb --trigraphs, --no_trigraphs --type_traits_helpers, --no_type_traits_helpers -Uname --unaligned_access, --no_unaligned_access --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 Semihosting ARMv6 SIMD Instruction Intrinsics Via File Syntax Standard C Implementation Definition Standard C++ Implementation Definition C and C++ Compiler Implementation Limits

--fpmode=model

--fpmode=model

This option specifies the floating-point conformance, and sets library attributes and floating-point optimizations.

Show/hideSyntax

--fpmode=model

where model is one of:

ieee_full

All facilities, operations, and representations guaranteed by the IEEE standard are available in single and double-precision. Modes of operation can be selected dynamically at runtime.

This defines the symbols:

__FP_IEEE
__FP_FENV_EXCEPTIONS
__FP_FENV_ROUNDING
__FP_INEXACT_EXCEPTION
ieee_fixed

IEEE standard with round-to-nearest and no inexact exceptions.

This defines the symbols:

__FP_IEEE
__FP_FENV_EXCEPTIONS
ieee_no_fenv

IEEE standard with round-to-nearest and no exceptions. This mode is stateless and is compatible with the Java floating-point arithmetic model.

This defines the symbol __FP_IEEE.

none

The compiler permits --fpmode=none as an alternative to --fpu=none, indicating that source code is not permitted to use floating-point types of any kind.

std

IEEE finite values with denormals flushed to zero, round-to-nearest, and no exceptions. This is compatible with standard C and C++ and is the default option.

Normal finite values are as predicted by the IEEE standard. However:

  • NaNs and infinities might not be produced in all circumstances defined by the IEEE model. When they are produced, they might not have the same sign.

  • The sign of zero might not be that predicted by the IEEE model.

Using a NaN with --fpmode=std can produce undefined behavior.

fast

Perform more aggressive floating-point optimizations that might cause a small loss of accuracy to provide a significant performance increase. This option defines the symbol __FP_FAST.

This option results in behavior that is not fully compliant with the ISO C or C++ standard. However, numerically robust floating-point programs are expected to behave correctly.

A number of transformations might be performed, including:

  • Double-precision math functions might be converted to single precision equivalents if all floating-point arguments can be exactly represented as single precision values, and the result is immediately converted to a single-precision value.

    This transformation is only performed when the selected library contains the single-precision equivalent functions, for example, when the selected library is armcc or aeabi_glibc.

    For example:

    float f(float a)
    {
        return sqrt(a);
    }
    

    is transformed to

    float f(float a)
    {
        return sqrtf(a);
    }.
    
  • Double-precision floating-point expressions that are narrowed to single-precision are evaluated in single-precision when it is beneficial to do so. For example, float y = (float)(x + 1.0) is evaluated as float y = (float)x + 1.0f.

  • Division by a floating-point constant is replaced by multiplication with the inverse. For example, x / 3.0 is evaluated as x * (1.0 / 3.0).

  • It is not guaranteed that the value of errno is compliant with the ISO C or C++ standard after math functions have been called. This enables the compiler to inline the VFP square root instructions in place of calls to sqrt() or sqrtf().

Using a NaN with --fpmode=fast can produce undefined behavior.

Note

Initialization code might be required to enable the VFP. See Limitations on hardware handling of floating-point arithmetic in Using the Compiler for more information.

Show/hideDefault

By default, --fpmode=std applies.

Copyright © 2007-2008, 2011-2012 ARM. All rights reserved.ARM DUI 0376D
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.