HP-UX Floating-Point Guide
184 Chapter 7
Performance Tuning
Mixed-Precision Expressions
Mixed-Precision Expressions
Expressions that contain a mixture of single-precision and
double-precision data generally execute more slowly than expressions of
just one precision type because they require extra conversions. (Whether
the compiler converts a mixed expression to single-precision or
double-precision depends on the rules of the high-level language.) The
reason is that HP 9000 instructions require their operands to be of the
same precision. For example, for an add or multiply or any other
two-operand instruction, both operands must be either single-precision
or double-precision; they cannot be of mixed precision.
Aside from performance considerations, it is generally a good idea to
avoid mixed-precision expressions for numerical analysis reasons. If you
must mix precisions in a single expression, choose the precisions
carefully so that the compiler does not need to perform repetitive
conversions.