Floating-point formats

XL C/C++ supports three floating-point formats:

Note that the long double type may represent either double-precision or extended-precision values, depending on the setting of the -qldbl128/-qlongdouble compiler option.

Single-precision and double-precision performance

If you compile your application with the default value of -qarch=com option or any of the values pwr, pwr2, pwrx, pwr2s, or p2sc, only double-precision computations are supported. For these architectures, if you need to convert results to single precision, rounding is applied, based on the rounding mode in effect.

With these architectures, because explicit rounding operations are required, single-precision computations are often slower than double-precision computations. With all other values for -qarch, single-precision instructions are used for single-precision operations, and are executed with the same speed as double-precision operations.

For more information about the PowerPC(R) floating-point processor, see the AIX Assembler Language Reference.