3.3.8 ARM floating-point compiler extensions to the C99 interface

The ARM® C library provides some extensions to the C99 interface to enable it to do everything that the ARM floating-point environment is capable of. This includes trapping and untrapping individual exception types, and installing custom trap handlers.

Note:

The following functionality requires you to select a floating-point model that supports exceptions, such as --fpmode=ieee_full or --fpmode=ieee_fixed.

The types fenv_t and fexcept_t are not defined by C99 to be anything in particular. The ARM compiler defines them both to be the same structure type.

fenv_t and fexcept_t have the following structure:

typedef struct{
    unsigned __statusword;
    __ieee_handler_t __invalid_handler;
    __ieee_handler_t __divbyzero_handler;
    __ieee_handler_t __overflow_handler;
    __ieee_handler_t __underflow_handler;
    __ieee_handler_t __inexact_handler;
} fenv_t, fexcept_t;

The members of this structure are:

  • __statusword, the same status variable that the function __ieee_status() sees, laid out in the same format.

  • Five function pointers giving the address of the trap handler for each exception. By default, each is NULL. This means that if the exception is trapped, the default exception trap action happens. The default is to cause a SIGFPE signal.

Non-ConfidentialPDF file icon PDF versionARM DUI0475M
Copyright © 2010-2016 ARM Limited or its affiliates. All rights reserved.