IHI 0053B Copyright © 2011-2013 ARM Limited. All rights reserved. Page 13 of 66
4 C LANGUAGE EXTENSIONS
4.1 Fundamental data types
This section overlaps with the specification of the ARM Procedure Call Standard, particularly [AAPCS 4.1]. ACLE
extends C by providing some types not present in Standard C and defining how they are dealt with by the AAPCS.
It also extends some of the guarantees of C, allowing assumptions to be made in source code beyond those
permitted by Standard C.
Plain „char‟ is unsigned, as specified in the ABI [AAPCS 7.1.1].
When pointers are 32 bits, the „long‟ type is 32 bits (ILP32 model).
When pointers are 64 bits, the „long‟ type may be either 64 bits (LP64 model) or 32 bits (LLP64 model).
This release of ACLE does not deal with platforms with 64-bit pointers.
4.1.1 Implementation-defined type properties
ACLE and the ARM ABI allow implementations some freedom in order to conform to long-standing conventions in
various environments. It is suggested that implementations set suitable defaults for their environment (and
document what these are) but allow the default to be overridden.
The signedness of a plain „int‟ bit-field is implementation-defined [C99 6.7.2#4].
Whether the underlying type of an enumeration is minimal or at least 32-bit, is implementation-defined. The
predefined macro __ARM_SIZEOF_MINIMAL_ENUM should be defined as 1 or 4 according to the size of a minimal
enumeration type such as enum { X=0 }.
wchar_t may be 2 or 4 bytes. The predefined macro __ARM_SIZEOF_WCHAR_T should be defined as the same
number.
Where an implementation conforms to the ARM ABI, an object that is sensitive to implementation-defined settings
must indicate those settings in object build attributes, e.g. Tag_ABI_enum_size and Tag_ABI_PCS_wchar_t,
as specified in [BA]. See also section 6.8.
4.1.2 Half-precision floating-point
The __fp16 type denotes half-precision (16-bit) floating-point. It is not required to be provided when not
implemented in hardware. The recommended way to test for this hardware support is to test bit 1 in __ARM_FP.
Implementations which support 16-bit floating-point support two formats: the “binary16” format defined in [IEEE-
FP], and an alternative format, defined by ARM, which extends the range by removing support for infinities and
NaNs. Both formats are described in [ARM ARM A2.7.4]. Toolchains are not required to support the alternative
format. The format in use can be selected at runtime but ACLE assumes it is fixed for the life of a program. If 16-
bit floating-point is available, one of __ARM_FP16_FORMAT_IEEE and __ARM_FP16_FORMAT_ALTERNATIVE will be
defined to indicate the format in use. An implementation conforming to the ARM ABI will set the
Tag_ABI_FP_16bit_format build attribute.
16-bit floating point is a storage and interchange format only. Values of __fp16 type promote to (at least) float
when used in arithmetic operations, in the same way that values of char or short types promote to int. There
is no arithmetic directly on 16-bit values.
Conversion from 64-bit to 16-bit, i.e. from double to __fp16, must round only once. (With round-to-nearest,
converting first to 32-bit and then to 16-bit could give an incorrectly rounded result.) Because in current ARM