HP-UX Floating-Point Guide

8
Contents
Handling Traps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
Using the ON Statement (Fortran only) . . . . . . . . . . . . . . . . . . . . . . 157
Using the sigaction(2) Function (C only). . . . . . . . . . . . . . . . . . . . . . 161
Detecting Exceptions without Enabling Traps. . . . . . . . . . . . . . . . . . . 164
Handling Integer Exceptions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
Handling Integer Division by Zero. . . . . . . . . . . . . . . . . . . . . . . . . . . 165
Handling Integer Overflow. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
7. Performance Tuning
Identifying and Removing Performance Bottlenecks. . . . . . . . . . . . . . 169
Inefficient Code. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
Optimizing Your Program. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
Specifying the Architecture Type. . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
Including Debugging Information . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
Producing Position-Independent Code. . . . . . . . . . . . . . . . . . . . . . . . 178
Using Profile-Based Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
Creating and Zeroing Static Data (Fortran only) . . . . . . . . . . . . . . . 178
Writing Routines in Assembly Language . . . . . . . . . . . . . . . . . . . . . 179
BLAS Library Versions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
Shared Libraries versus Archive Libraries. . . . . . . . . . . . . . . . . . . . . . 181
Denormalized Operands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
Mixed-Precision Expressions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
Matrix Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
Data Alignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
Cache Aliasing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
Static Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
Quad-Precision Computations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191