When used in a C or C++ expression, an __fp16
type is promoted to
single precision. Subsequent promotion to double precision can occur if required by one
of the operands.
A single precision value can be converted to __fp16
. A double
precision value is converted to single precision and then to __fp16
,
that could involve double rounding. This reflects the lack of direct double-to-16-bit
conversion in the ARM architecture.
When using fpmode=fast
, no floating-point exceptions are raised when
converting to and from half-precision floating-point format.
Function formal arguments cannot be of type __fp16
. However,
pointers to variables of type __fp16
can be used as function formal
argument types.
__fp16
values can be passed as actual function arguments. In this
case, they are converted to single-precision values.
__fp16
cannot be specified as the return type of a function.
However, a pointer to an __fp16
type can be used as a return
type.
An __fp16
value is converted to a single-precision or
double-precision value when used as a return value for a function that returns a
float
or double
.