Important: The information in this document is obsolete and should not be used for new development.
Conversions From Double to Single Format
To convert a double floating-point number to single format, either store the double number in single format (listed here and described in Chapter 11) or use thefrsp
instruction.
frsp Convert double to single format. stfs Store in single format. stfsu Store in single format and update. stfsux Store in single format and update indexed. stfsx Store in single format indexed. For store instructions, the conversion takes place automatically. The store instructions raise no floating-point exceptions and treat zeros, NaNs, and Infinities like any other value. The
frsp
instruction converts a double-format number to single format and then places it in the last half of a floating-point register. Use thefrsp
instruction immediately before using the single form of any arithmetic instruction. The following example performs single-precision addition on a number that has been converted to single format using thefrsp
instruction.
lfs f1,d(r1) #load single format number into f1 #conversion to double format is automatic frsp f1,f1 #f1 is now in single format fadds f0,f1,f1 #so that it can be added as single format number
- Note
- The
frsp
instruction might raise floating-point exceptions. See the Motorola PowerPC 601 RISC Microprocessor User's Manual for more information.