TST (shifted register)

Test (shifted register)

This instruction performs a bitwise AND operation on a register value and an optionally-shifted register value. It updates the condition flags based on the result, and discards the result.

Encoding: Setting the condition flags

313029282726252423222120191817161514131211109876543210
1101010011111
sfopcshiftNRmimm6RnRd

32-bit (sf == 0)

TST <Wn>, <Wm>{, <shift> #<amount>}

Equivalent to: ANDS WZR, <Wn>, <Wm>{, <shift> #<amount>}

64-bit (sf == 1)

TST <Xn>, <Xm>{, <shift> #<amount>}

Equivalent to: ANDS XZR, <Xn>, <Xm>{, <shift> #<amount>}

Explanations

<Wn>: Is the 32-bit name of the first general-purpose source register, encoded in the "Rn" field.
<Wm>: Is the 32-bit name of the second general-purpose source register, encoded in the "Rm" field.
<shift>: <amount>: For the "32-bit" variant: is the shift amount, in the range 0 to 31, defaulting to 0 and encoded in the "imm6" field.
<amount>: For the "64-bit" variant: is the shift amount, in the range 0 to 63, defaulting to 0 and encoded in the "imm6" field.
<Xn>: Is the 64-bit name of the first general-purpose source register, encoded in the "Rn" field.
<Xm>: Is the 64-bit name of the second general-purpose source register, encoded in the "Rm" field.

Operational Notes

If PSTATE.DIT is 1: