stfiwx
Store Floating-Point as Integer Word Indexed - 7C 00 00 5F
stfiwx
Instruction Syntax
Mnemonic | Format | Flags |
stfiwx | frS,rA,rB | None |
Instruction Encoding
0
1
1
1
1
1
S
S
S
S
S
A
A
A
A
A
B
B
B
B
B
0
0
0
0
0
0
0
0
0
0
0
Field | Bits | Description |
Primary Opcode | 0-5 | 011111 (0x1F) |
frS | 6-10 | Source floating-point register |
rA | 11-15 | Base register |
rB | 16-20 | Index register |
Reserved | 21-29 | 000000000 |
Reserved | 30-31 | 00 |
Operation
EA ← (rA) + (rB) (EA) ← (frS)[32:63]
The effective address is calculated by adding the base register to the index register. The high-order 32 bits of the floating-point register are stored as an integer word at the effective address.
Note: The stfiwx instruction stores the high-order 32 bits of a floating-point register as an integer word to memory. This is useful for accessing the integer representation of floating-point values.
Affected Registers
Memory
- Integer word at effective address (EA)
Examples
Basic Store Floating-Point as Integer
# Store floating-point value as integer word stfiwx fr1, r3, r4 # Store high 32 bits of fr1 as integer at r3 + r4
Floating-Point to Integer Conversion
# Convert floating-point to integer representation li r3, buffer # Load buffer address li r4, 0 # Index = 0 stfiwx fr1, r3, r4 # Store fr1 as integer word
Bit Manipulation of Floating-Point
# Access floating-point bits as integer li r3, result # Load result address li r4, 0 # Index = 0 stfiwx fr1, r3, r4 # Store high 32 bits of fr1 # Now can manipulate the integer representation