Subtracts the contents of a general-purpose register from a 16-bit signed integer and places the result in another general-purpose register.
Bits | Value |
---|---|
0-5 | 08 |
6-10 | RT |
11-15 | RA |
16-31 | SI |
PowerPC | |
---|---|
subfic | RT, RA, SI |
POWER family | |
---|---|
sfi | RT, RA, SI |
The subfic and sfi instructions add the one's complement of the contents of general-purpose register (GPR) RA, 1, and a 16-bit signed integer SI. The result is placed in the target GPR RT.
Note: When SI is -1, the subfic and sfi instructions place the one's complement of the contents of GPR RA in GPR RT.
The subfic and sfi instructions have one syntax form and do not affect Condition Register Field 0. These instructions always affect the Carry bit in the Fixed-Point Exception Register.
RT | Specifies target general-purpose register where result of operation is stored. |
RA | Specifies source general-purpose register for operation. |
SI | Specifies 16-bit signed integer for operation. |
The following code subtracts the contents of GPR 4 from the signed integer 0x0000 7000 and stores the result in GPR 6:
# Assume GPR 4 holds 0x9000 3000. subfic 6,4,0x00007000 # GPR 6 now holds 0x7000 4000.
Fixed-Point Arithmetic Instructions .