IMADSP : Extracted Integer Multiply And Add.

Format:

SPA 5.0:
        {@{!}Pg}   IMADSP.saext.sbext.scext   Rd{.CC},Ra,Sb,Sc   {&req_6}   {&rdN}   {&wrN}   {?sched}   ;   

 .saext : { .U32, .S32, .U24. .S24, .U16H0, .S16H0, .U16H1, .S16H1 }   // operand extract modifier
 .sbext : { .U24, .S24, .U16H0, .S16H0 }                               // operand extract modifier
 .scext : { .U32, .S32, .U24, .S24, .U16H0, .S16H0 }                   // operand extract modifier

IMADSP allows the following sources Sb,Sc:
    Sb(register),                         Sc(register)
    Sb(constant with immediate address),  Sc(register)
    Sb(#Imm20),                           Sc(register)
    Sb(register),                         Sc(constant with immediate address)

Description:

Multiply and add sources (smaller than or equal to 32 bits) to produce single precision (32 bits) result.

IMADSP operates as follows. First the operands are extracted/sign extended based on the saext/sbext/scext modifiers. These ext modifiers define if the data container is the whole 32 bits or 24 lsb bits or top 16 bits or bottom 16 bits.

saext/sbext/scext are the operand extract modifiers to extract 16/24/32 bit part selects out of A/B/C operands (similar to VMAD). In case of saext/sbext, these modifiers also define the signed/unsigned behavior of the operands.

After extracting the correct bits, the operands are extended (based on signed or unsigned) to full 32 bits. The sign of operand C is signed if any of the Ra/Sb is signed. Thus only following multiplication combinations are possible (post extention)


   tmp =  (RaExtracted  * SbExtracted) + RcEtracted:
   tmp =  (U32 * U32) + U32   // intermediate unsigned; final unsigned
   tmp =  (U32 * S32) + S32   // intermediate   signed; final   signed
   tmp =  (S32 * U32) + S32   // intermediate   signed; final   signed
   tmp =  (S32 * S32) + S32   // intermediate   signed; final   signed

   Note: The intermediate sign of the multiply (Ra*Sb) will be unsigned if Both Ra and Sb are unsigned.
	 Otherwise, the intermediate sign will be signed.

The sign of source C and final destination will be same as the intermediate sign.

Examples:

IMADSP.U24.U24.U16H0 R0,R1,R2,R3;
IMADSP.S24.S24.S16H0 R0,R1,R2,R3;

Back to Index of Instructions