3.6.5. SMLALD, SMLALDX, SMLALBB, SMLALBT, SMLALTB, and SMLALTT

Signed Multiply Accumulate Long Dual and Signed Multiply Accumulate Long (halfwords).

Syntax

op{cond} RdLo, RdHi, Rn, Rm

Where:

op

Is one of:

SMLALBB, SMLALBT

Signed Multiply Accumulate Long (halfwords, B and T).

B and T specify which halfword of the source registers Rn and Rm are used as the first and second multiply operand:

The bottom halfword, bits [15:0], of Rn is used.

SMLALBB: the bottom halfword, bits [15:0], of Rm is used. SMLALBT: the top halfword, bits [31:16], of Rm is used.

SMLALTB, SMLALTT

Signed Multiply Accumulate Long (halfwords, B and T).

The top halfword, bits [31:16], of Rn is used.

SMLALTB: the bottom halfword, bits [15:0], of Rm is used. SMLALTT: the top halfword, bits [31:16], of Rm is used.

SMLALD

Signed Multiply Accumulate Long Dual.

The multiplications are bottom × bottom and top × top.

SMLALDX

Signed Multiply Accumulate Long Dual reversed.

The multiplications are bottom × top and top × bottom.

cond

Is an optional condition code. See Conditional execution.

RdHi, RdLo

Are the destination registers. RdLo is the lower 32 bits and RdHi is the upper 32 bits of the 64-bit integer. The accumulating value for the lower and upper 32 bits are held in the RdLo and RdHi registers respectively.

Rn, Rm

Are registers holding the first and second operands.

Operation

  • Multiplies the two’s complement signed word values from Rn and Rm.

  • Adds the 64-bit value in RdLo and RdHi to the resulting 64-bit product.

  • Writes the 64-bit result of the multiplication and addition in RdLo and RdHi.

The SMLALBB, SMLALBT, SMLALTB and SMLALTT instructions:

  • Multiplies the specified signed halfword, Top or Bottom, values from Rn and Rm.

  • Adds the resulting sign-extended 32-bit product to the 64-bit value in RdLo and RdHi.

  • Writes the 64-bit result of the multiplication and addition in RdLo and RdHi.

The non-specified halfwords of the source registers are ignored.

The SMLALD and SMLALDX instructions interpret the values from Rn and Rm as four halfword two’s complement signed 16-bit integers. These instructions:

  • SMLALD multiplies the top signed halfword value of Rn with the top signed halfword of Rm and the bottom signed halfword values of Rn with the bottom signed halfword of Rm.

  • SMLALDX multiplies the top signed halfword value of Rn with the bottom signed halfword of Rm and the bottom signed halfword values of Rn with the top signed halfword of Rm.

  • Add the two multiplication results to the signed 64-bit value in RdLo and RdHi to create the resulting 64-bit product.

  • Write the 64-bit product in RdLo and RdHi.

Restrictions

In these instructions:

  • Do not use SP and do not use PC.

  • RdHi and RdLo must be different registers.

Condition flags

These instructions do not affect the condition code flags.

Examples

SMLAL       R4, R5, R3, R8   ; Multiplies R3 and R8, adds R5:R4 and writes to 
                             ; R5:R4.
SMLALBT     R2, R1, R6, R7   ; Multiplies bottom halfword of R6 with top 
                             ; halfword of R7, sign extends to 32-bit, adds 
                             ; R1:R2 and writes to R1:R2.
SMLALTB     R2, R1, R6, R7   ; Multiplies top halfword of R6 with bottom
                             ; halfword of R7,sign extends to 32-bit, adds R1:R2
                             ; and writes to R1:R2.
SMLALD      R6, R8, R5, R1   ; Multiplies top halfwords in R5 and R1 and bottom
                             ; halfwords of R5 and R1, adds R8:R6 and writes to
                             ; R8:R6.
SMLALDX     R6, R8, R5, R1   ; Multiplies top halfword in R5 with bottom
                             ; halfword of R1, and bottom halfword of R5 with 
                             ; top halfword of R1, adds R8:R6 and writes to 
                             ; R8:R6.
Copyright © 2015, 2018 Arm. All rights reserved.ARM DUI 0646C
Non-ConfidentialID121118