USAD8 and USADA8

Unsigned Sum of Absolute Differences, and Accumulate unsigned sum of absolute differences.

Show/hideSyntax

USAD8{cond} {Rd}, Rn, Rm
USADA8{cond} Rd, Rn, Rm, Ra

where:

cond

is an optional condition code.

Rd

is the destination register.

Rn

is the register holding the first operand.

Rm

is the register holding the second operand.

Ra

is the register holding the accumulate operand.

Show/hideOperation

The USAD8 instruction finds the four differences between the unsigned values in corresponding bytes of Rn and Rm. It adds the absolute values of the four differences, and saves the result to Rd.

The USADA8 instruction adds the absolute values of the four differences to the value in Ra, and saves the result to Rd.

Show/hideRegister restrictions

You cannot use PC for any register.

You can use SP in ARM instructions but these are deprecated in ARMv6T2 and above. You cannot use SP in Thumb instructions.

Show/hideCondition flags

These instructions do not alter any flags.

Show/hideArchitectures

These ARM instructions are available in ARMv6 and above.

These 32-bit Thumb instructions are available in ARMv6T2 and above. For the ARMv7-M architecture, they are only available in an ARMv7E-M implementation.

There are no 16-bit Thumb versions of these instructions.

Show/hideExamples

    USAD8       r2, r4, r6
    USADA8      r0, r3, r5, r2
    USADA8VS    r0, r4, r0, r1

Show/hideIncorrect examples

    USADA8      r2, r4, r6      ; USADA8 requires four registers
    USADA16     r0, r4, r0, r1  ; no such instruction

Show/hideSee also

Reference
Copyright © 2011-2012 ARM. All rights reserved.ARM DUI 0588B
Non-ConfidentialID062912