IBM PPC440X5 Computer Hardware User Manual


 
machhws
Multiply Accumulate High Halfword to Word Saturate Signed
PPC440x5 CPU Core User’s Manual Preliminary
Page 350 of 589
instrset.fm.
September 12, 2002
machhws
Multiply Accumulate High Halfword to Word Saturate Signed
prod
0:31
(RA)
0:15
× (RB)
0:15
signed
temp
0:32
prod
0:31
+ (RT)
if ((prod
0
= RT
0
) (RT
0
temp
1
)) then (RT) (RT
0
||
31
(¬RT
0
))
else (RT)
temp
1:32
The high-order halfword of RA is multiplied by the high-order halfword of RB. The signed product is summed
with the contents of RT.
If the signed sum can be represented in 32 bits, then RT is updated with the low-order 32 bits of the signed
sum.
If the signed sum 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 signed sum is less than –2
31
, then RT is updated with –2
31
. Like-
wise, if the signed sum is greater than 2
31
– 1, then RT is updated with 2
31
–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 page 250.
machhws RT, RA, RB OE=0, Rc=0
machhws. RT, RA, RB OE=0, Rc=1
machhwso RT, RA, RB OE=1, Rc=0
machhwso. RT, RA, RB OE=1, Rc=1
4 RT RA RB OE 108 Rc
0 6 11 16 21 22 31