-qfloat=hssngl

The -qfloat=hssngl option improves the performance of single-precision (float) floating-point calculations by suppressing certain rounding operations. The suppressed rounding operations are required by the C and C++ languages, but are not necessary for correct program execution. Rounding operations are still inserted when double-precision results are stored into single-precision memory locations.

The hssngl option retains the results of floating-point expressions in double precision when the original program would have rounded those results to single precision. The retained double-precision results are then used in later expressions instead of the rounded results. The program results may be more accurate because of the increased precision, and program execution may be faster because rounding operations have been omitted.

Rounding operations are still necessary in cases where a floating-point result is stored into a single-precision variable. The result must be rounded to detect a single-precision floating-point overflow or underflow. In some cases, program optimization can remove store operations from a program. The hssngl option allows the rounding operation that accompanied the original store to be removed also. When the hssngl option can retain such a result in double precision, an exception can be avoided.

The hssngl option is safe for all types of programs because it can only increase the precision of floating-point computations in a program.

Use the -qfloat=hssngl option with the -O option, but not with the -qfloat=rndsngl option.



Overview
-qfloat=nomaf
-qfloat=nans
-qfloat=hsflt
-qfloat=rndsngl
-qflttrap


Sample TRAP Exception Handler


float Compiler Option
flttrap Compiler Option