HP Compilers for HP Integrity Servers (September 2011)

However, in general, we would expect +O4 to be no worse than 2x slower than +O2
(depending on the application’s build mechanics and the build machines).
Precise floating-point control
HP compilers are designed to provide complete developer access to the uniquely powerful
floating-point features of the architecture. These features enable HP compiler-generated
floating-point code and the math library to be both highly accurate and well optimized
under default and general compiler options.
Under the -fpwidetypes option, the C and C++ math library headers define names
for functions and macros involving the 80-bit floating-point type, and they define alternative
names for functions and macros involving the 128-bit long double type, as shown in
Table 1 (page 21). The names extended and quad, which are industry convention,
facilitate portability by providing type names that are not dependent on the particular
format of the long double type, which differs in implementation among different
operating systems.
Table 1 Floating-point type suffixes and macros
MacrosFunction SuffixNameType
W (e.g., HUGE_VALW)w (e.g., logw)extended (defined in
math.h, float.h,
__float80 (80-bit-type)
EXT_(e.g., EXT_MAX)
complex.h,and
stdlib.h)
Q (e.g., HUGE_VALQ)
QUAD_ (e.g., QUAD_MAX)
q (e.g., logq)quad (defined in
math.h, float.h,
long double or
__float128 (128-bit
type) complex.h, and
stdlib.h)
HP C and C++ compilers provide a choice of three binary floating-point evaluation
methods, indicated by the -fpeval={float|double|extended} option. The option
-fpeval=extended can facilitate importing programs from IA-32 platforms that employ
wide range and/or precision, and can generally improve robustness where narrower
evaluation would be sensitive to rounding error, overflow, or underflow.
float, the default, selects the C99-specified evaluation method which evaluates
binary floating operations and constants to their semantic type.
double selects the C99-specified evaluation method which evaluates float operations
and constants to the wider range and precision of double and other operations and
constants to their semantic types.
extended selects a method that evaluates float and double operations and constants
to the wider range and precision of extended, and other operations and constants
to their semantic types.
Understanding key features of the HP compilers 21