4.1.1. The Q flag

The Q flag only exists in E variants of ARM architecture v5 and above. It is used to detect saturation in special saturating arithmetic instructions (see QADD, QSUB, QDADD, and QDSUB), or overflow in certain multiply instructions (see SMLAxy and SMLAWy).

The Q flag is a sticky flag. Although these instructions can set the flag, they cannot clear it. You can execute a series of such instructions, and then test the flag to find out whether saturation or overflow occurred at any point in the series, without needing to check the flag after each instruction.

To clear the Q flag, use an MSR instruction (see MSR).

The state of the Q flag cannot be tested directly by the condition codes. To read the state of the Q flag, use an MRS instruction (see MRS).

Copyright © 2000, 2001 ARM Limited. All rights reserved.ARM DUI 0068B