nmacchws

Negative Multiply Accumulate Cross Halfword Signed

nmacchws RT, RA, RB

Negate product of cross halfwords and add to accumulator (Signed Saturation).

Details

Multiplies the sign-extended bottom halfword of RA by the sign-extended top halfword of RB, negates the product, and adds it to RT with signed saturation to 32 bits. The saturated result is stored in RT, and the SAT bit in the SPEFSCR is set if saturation occurred. This instruction requires the SPE category.

Pseudocode Operation

a ← EXTS(RA[16:31])
b ← EXTS(RB[0:15])
product ← (a × b)[32:63]
result ← RT + (¬product + 1)
if result > 2147483647 then
  RT ← 2147483647
  SPEFSCR[SAT] ← 1
elif result < -2147483648 then
  RT ← -2147483648
  SPEFSCR[SAT] ← 1
else
  RT ← result

Example

nmacchws r3, r4, r5

Encoding

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

Operands

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