nmaclhw

Negative Multiply Accumulate Low Halfword

nmaclhw RT, RA, RB

Negate product of low halfwords and add to accumulator.

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, 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[16:31]) * (RB[16:31]))
RT ← RT + (-prod)
if overflow then XER[OV] ← 1 else XER[OV] ← 0
XER[SO] ← XER[SO] | XER[OV]

Example

nmaclhw r3, r4, r5

Encoding

Binary Layout
4
0
RT
6
RA
11
RB
16
430
21
0
31
 
Format XO-form
Opcode 0x1000035C
Extension Embedded

Operands

  • RT
    Acc/Dest
  • RA
    Src A
  • RB
    Src B