nmacchws
Negative Multiply Accumulate Cross Halfword to Word Saturate Signed
PPC440x5 CPU Core User’s Manual Preliminary
Page 386 of 589 instrset.fm.
September 12, 2002
nmacchws
Negative Multiply Accumulate High Halfword to Word Saturate Signed
nprod0:31 –((RA)16:31 × (RB)0:15 signed
temp0:32 nprod0:31+ (RT)
if ((nprod0= RT0) (RT0 temp1)) then (RT) (RT0|| 31(¬RT0))
else (RT) temp1:32
Thelow-order halfword of RA ismultiplied by the high-order halfword of RB. The signed productis subtracted
from the contents of RT.
If the result of the subtraction can be represented in 32 bits, then RT is updated with the low-order 32 bits of
the result.
If the result of the subtraction cannot be represented in 32 bits, then RT is updated with a value which is
“saturated” to the nearest representable value. That is, if the result is less than –231, then RT is updated with
–231. Likewise, if the result is greater than 231 1, then RT is updated with 231–1.
Registers Altered
•RT
CR[CR0] if Rc contains 1
XER[SO, OV] if OE contains 1
Architecture Note
This instruction is implementation-specific and programs which use this instruction may not be portable to
other PowerPC Book-E implementations. See Instruction Set Portability on page250.
nmacchws RT, RA, RB OE=0, Rc =0
nmacchws. RT, RA, RB OE=0, Rc =1
nmacchwso RT, RA, RB OE=1, Rc =0
nmacchwso. RT, RA, RB OE=1, Rc =1
4 RT RA RB OE 238 Rc
0 6 11 16 21 22 31