maclhwsu

Multiply Accumulate Low Halfword Signed Unsigned

maclhwsu RT, RA, RB

Mixed Sign Multiply Accumulate Low Halfword with Saturation.

Encoding

Binary Layout
4
0:5
RT
6:10
RA
11:15
RB
16:20
460
21:30
0
31
 
Format XO-form
Opcode 0x10000398
Extension Embedded

Operands

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

Example

maclhwsu r3, r4, r5

Related

More in Embedded

Reference

Description

Multiplies the low halfword (bits 16-31) of RA (signed) by the low halfword of RB (unsigned), adds the 32-bit product to RT, and saturates the result to the signed 32-bit range if overflow occurs. This is part of the Embedded (SPE) category and sets the SAT bit in SPEFSCR if saturation occurs.

Operation

product ← EXTS(RA[16:31]) × EXTZ(RB[16:31])
result ← RT + product
if result > 2147483647 then
  RT ← 2147483647
  SPEFSCR[SAT] ← 1
elif result < -2147483648 then
  RT ← -2147483648
  SPEFSCR[SAT] ← 1
else
  RT ← result