Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: PowerPC Numerics / Part 3 - Appendixes
Appendix D - FPCE Recommendations for Compilers


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 | off 
When the fp_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 the fp_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 another fp_contract pragma is encountered or until the end of the module. The default state for fp_contract is implementation dependent.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
13 JUL 1996