Important: The information in this document is obsolete and should not be used for new development.
Contraction Operator Switch
To allow programmer control of whether contraction operators are used, the FPCE technical report defines the following pragma:
#pragma fp_contract on | offWhen thefp_contract
pragma is turned on, the compiler can produce contraction operators in the generated code. For the PowerPC processor, the contraction operators are the multiply-add instructions. These instructions perform a multiplication operation and either an addition or a subtraction operation with at most a single roundoff error. For some input values, the result of a multiply-add instruction is slightly different than if the operations were performed separately. This difference in value might be unacceptable in certain programs. Compilers that support thefp_contract
pragma allow programmers to disable the generation of multiply-add instructions where necessary.Where supported, the
fp_contract
pragma can occur only outside external declarations. It enables or disables contraction operators until anotherfp_contract
pragma is encountered or until the end of the module. The default state forfp_contract
is implementation dependent.