Important: The information in this document is obsolete and should not be used for new development.
Load and Store Instructions
Before you perform any floating-point computation, you must load a value into a floating-point register. To do this, use one of the load instructions. Load instructions load either single or double floating-point numbers from memory into floating-point registers. Store instructions take the contents of a floating-point register and store them in memory.Load and store instructions take one of two forms depending on which address mode is used. The first form is
instr FPR, D(GPR)
The D(GPR) part of the instruction determines the memory address involved. If GPR is not 0, it is interpreted as a general-purpose register and the contents of register GPR are added to the value D to produce the memory address. If GPR is 0, it is interpreted as the value 0 rather than as register GPR0, so 0 is added to D to produce the memory address.
- instr
- Specifies which type of load or store is to be performed.
- FPR
- A floating-point register, which is either the source or the destination for the operation, depending on whether it is a load or a store.
- D
- A 16-bit signed integer value.
- GPR
- A general-purpose register or the value 0.
Load instructions of this form are interpreted as FPR \xC6 (D + (GPR)), which means that the instruction loads into FPR the contents of the memory address obtained by adding D to the contents of GPR (unless GPR is 0).
Store instructions of this form are interpreted as D + (GPR) \xC6 (FPR), which means that the instruction stores the contents of FPR at the memory address obtained by adding D to the contents of GPR (unless GPR is 0).
The second form for load and store operations uses a different address mode:
instr FPR
, GPR1, GPR2
GPR1 and GPR2 determine the memory address involved. If GPR1 is not 0, it is interpreted as a general-purpose register, and the contents of register GPR1 are added to the contents of register GPR2 to produce the memory address. If GPR1 is 0, it is interpreted as the value 0 rather than as register GPR0, so 0 is added to the contents of register GPR2 to produce the memory address.
- instr
- Specifies which type of load or store is to be performed.
- FPR
- A floating-point register, which is either the source or the destination for the operation, depending on whether it is a load or a store.
- GPR1
- A general purpose register or the value 0.
- GPR2
- A general-purpose register.
Load instructions of this form are interpreted as FPR \xC6 ((GPR1) + (GPR2)) unless GPR1 is 0.
Store instructions of this form are interpreted as (GPR1) + (GPR2) \xC6 (FPR) unless
GPR1 is 0.Table 11-1 lists and describes the PowerPC load and store instructions. There are two load and two store instructions for each address mode. One version simply performs
the load or store, and the other version puts the effective memory address into the general-purpose register specified in the instruction (shown as Rn in the table).Each of the load and store instructions has a single and a double form, making a total of eight load and eight store instructions. If the single form of a load instruction is used, the number is converted to double format before the load is performed. If the single form of a store instruction is used, the number is converted to single format before it is stored. See Chapter 13, "Assembly-Language Numeric Conversions," for more information about conversions performed during load and store operations.
None of the load and store instructions raise floating-point exceptions or make special cases of zeros, NaNs, or Infinities.