PER ARM'S REQUEST, THIS SITE WILL BE DISCONTINUED ON 4 DECEMBER 2026. :(

Arm's lawyers have notified me to take down this site or face legal action.

To all of the fans of this site over the years (even the ones at Arm): thank you for your support! I'm glad I could provide a resource so many people found value in. I will look into solutions that can potentially keep bookmarks and links working.

— Jon

← Home

SUBPS

Subtract pointer, setting flags

This instruction subtracts the 56-bit address held in the second source register from the 56-bit address held in the first source register, sign-extends the result to 64 bits, and writes the result to the destination register. It updates the condition flags based on the result of the subtraction.

This instruction is used by the alias CMPP.

Integer class

(FEAT_MTE)

313029282726252423222120191817161514131211109876543210
10111010110Rm000000RnRd
sfSopcode

Encoding

SUBPS <Xd>, <Xn|SP>, <Xm|SP>

Decode

if !IsFeatureImplemented(FEAT_MTE) then EndOfDecode(Decode_UNDEF); end; let d : integer{} = UInt(Rd); let n : integer{} = UInt(Rn); let m : integer{} = UInt(Rm);

Assembler Symbols

<Xd>

Is the 64-bit name of the general-purpose destination register, encoded in the "Rd" field.

<Xn|SP>

Is the 64-bit name of the first source general-purpose register or stack pointer, encoded in the "Rn" field.

<Xm|SP>

Is the 64-bit name of the second general-purpose source register or stack pointer, encoded in the "Rm" field.

Alias Conditions

AliasIs preferred when
CMPPS == '1' && Rd == '11111'

Operation

var operand1 : bits(64) = if n == 31 then SP{64}() else X{64}(n); var operand2 : bits(64) = if m == 31 then SP{64}() else X{64}(m); operand1 = SignExtend{64}(operand1[55:0]); operand2 = NOT SignExtend{64}(operand2[55:0]); var result : bits(64); var nzcv : bits(4); (result, nzcv) = AddWithCarry{64}(operand1, operand2, '1'); X{64}(d) = result; PSTATE.[N,Z,C,V] = nzcv;


Version 2026.09 — Copyright © 2010-2026 Arm Limited or its affiliates.

This site is provided as a community resource and is NOT affiliated with nor endorsed by Arm Limited.