nmaclhws
Negative Multiply Accumulate Low Halfword Signed
nmaclhws RT, RA, RB
Negate product of low halfwords and add to accumulator (Signed Saturation).
Details
Multiplies the low halfwords (bits 16–31) of RA and RB as signed 16-bit integers, negates the 32-bit product, and adds it to RT with signed saturation, storing the result in RT. This is an embedded SPE instruction that performs signed halfword multiply-accumulate with negation and saturation. The overflow and saturation bits (XER[OV] and XER[SAT]) are set appropriately.
Pseudocode Operation
prod ← EXTS((RA[16:31]) * (RB[16:31]))
result ← RT + (-prod)
if result > 2147483647 then
RT ← 2147483647
XER[SAT] ← 1
else if result < -2147483648 then
RT ← -2147483648
XER[SAT] ← 1
else
RT ← result
XER[OV] ← XER[SAT]
Example
nmaclhws r3, r4, r5
Encoding
Binary Layout
4
0
RT
6
RA
11
RB
16
494
21
0
31
Operands
-
RT
Acc/Dest -
RA
Src A -
RB
Src B