nmachhw
Negative Multiply Accumulate High Halfword
nmachhw RT, RA, RB
Negate product of high halfwords and add to accumulator.
Details
Multiplies the high halfwords (bits 0–15) of RA and RB as signed 16-bit integers, negates the 32-bit product, and adds it to RT, storing the result in RT. This is an embedded SPE instruction that performs signed halfword multiply-accumulate with negation. The overflow bit (XER[OV]) is set if the result overflows a 32-bit signed integer.
Pseudocode Operation
prod ← EXTS((RA[0:15]) * (RB[0:15]))
RT ← RT + (-prod)
if overflow then XER[OV] ← 1 else XER[OV] ← 0
XER[SO] ← XER[SO] | XER[OV]
Example
nmachhw r3, r4, r5
Encoding
Binary Layout
4
0
RT
6
RA
11
RB
16
46
21
0
31
Operands
-
RT
Acc/Dest -
RA
Src A -
RB
Src B