stfd
Store Floating-Point Double - D8 00 00 00
stfd

Instruction Syntax

Mnemonic Format Flags
stfd frS,d(rA) None

Instruction Encoding

1
1
0
1
1
0
S
S
S
S
S
A
A
A
A
A
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I

Field Bits Description
Primary Opcode 0-5 110110 (0x36)
frS 6-10 Source floating-point register
rA 11-15 Base register
SIMM 16-31 Signed immediate offset

Operation

EA ← (rA) + SIMM
(EA) ← (frS)

The effective address is calculated by adding the signed immediate offset to the base register. The double-precision floating-point value in the source register is stored at the effective address.

Note: The stfd instruction stores a 64-bit double-precision floating-point value to memory. The address must be aligned to an 8-byte boundary.

Affected Registers

Memory

Examples

Basic Store Floating-Point Double

# Store double-precision value from fr1 to memory
stfd fr1, 0(r3)     # Store at address in r3
stfd fr1, 8(r3)     # Store at address r3 + 8

Array of Doubles

# Store double in array
li r4, 0            # Array index
slwi r4, r4, 3      # Multiply by 8 (double size)
add r5, r3, r4      # Calculate address
stfd fr1, 0(r5)     # Store double

Floating-Point Calculations

# Store result of floating-point calculation
fadd fr2, fr0, fr1  # fr2 = fr0 + fr1
stfd fr2, result    # Store result to memory

Related Instructions

stfdu, stfdux, stfdx, lfd

Back to Index