4.5.3. SSAT and USAT

Signed Saturate and Unsigned Saturate to any bit position, with optional shift before saturating.

See also SSAT16 and USAT16.

Syntax

op{cond} Rd, #sat, Rm{, shift}

where:

op

is either SSAT or USAT.

cond

is an optional condition code (see Conditional execution).

Rd

is the destination register. Rd must not be r15.

sat

specifies the bit position to saturate to, in the range 0 to 31.

Rm

is the register containing the operand. Rm must not be r15.

shift

is an optional shift. It must be one of the following:

ASR #n

where n is in the range 1-32

LSL #n

where n is in the range 0-31.

Operation

The SSAT instruction applies the specified shift, then saturates to the signed range –2sat–1 = x = 2sat–1 –1.

The USAT instruction applies the specified shift, then saturates to the unsigned range 0 = x = 2sat – 1.

Condition flags

If saturation occurs, these instructions set the Q flag. To read the state of the Q flag, use an MRS instruction (see MRS).

Architectures

These ARM instructions are available in ARMv6 and above, and E variants of ARMv5.

These 32-bit Thumb-2 instructions are available in T2 variants of ARMv6 and above.

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

Examples

    SSAT    r7, #16, r7, LSL #4
    USATNE  r0, #7, r5

Incorrect example

    USATGT  r0, #7, r15, ASR #16          ; use of r15 not permitted
Copyright © 2002-2005 ARM Limited. All rights reserved.ARM DUI 0204F
Non-Confidential