SBFM Signed bitfield move This instruction is usually accessed via one of its aliases, which are always preferred for disassembly. If <imms> is greater than or equal to <immr>, this copies a bitfield of (<imms>-<immr>+1) bits starting from bit position <immr> in the source register to the least significant bits of the destination register. If <imms> is less than <immr>, this copies a bitfield of (<imms>+1) bits from the least significant bits of the source register to bit position (regsize-<immr>) of the destination register, where regsize is the destination register size of 32 or 64 bits. In both cases, the destination bits below the bitfield are set to zero, and the bits above the bitfield are set to a copy of the most significant bit of the bitfield. If PSTATE.DIT is 1: The execution time of this instruction is independent of: The values of the data supplied in any of its registers. The values of the NZCV flags. The response of this instruction to asynchronous exceptions does not vary based on: The values of the data supplied in any of its registers. The values of the NZCV flags. This instruction is used by the aliases ASR (immediate) imms == '011111' imms == '111111' SBFIZ UInt(imms) < UInt(immr) SBFX BFXPreferred(sf, opc<1>, imms, immr) SXTB immr == '000000' && imms == '000111' SXTH immr == '000000' && imms == '001111' SXTW immr == '000000' && imms == '011111' See below for details of when each alias is preferred. 0 0 1 0 0 1 1 0 0 0 SBFM <Wd>, <Wn>, #<immr>, #<imms> 1 1 SBFM <Xd>, <Xn>, #<immr>, #<imms> if sf == '1' && N != '1' then UNDEFINED; if sf == '0' && (N != '0' || immr<5> != '0' || imms<5> != '0') then UNDEFINED; constant integer d = UInt(Rd); constant integer n = UInt(Rn); constant integer datasize = 32 << UInt(sf); constant integer s = UInt(imms); constant integer r = UInt(immr); bits(datasize) wmask; bits(datasize) tmask; (wmask, tmask) = DecodeBitMasks(N, imms, immr, FALSE, datasize); <Wd> Is the 32-bit name of the general-purpose destination register, encoded in the "Rd" field. <Wn> Is the 32-bit name of the general-purpose source register, encoded in the "Rn" field. <immr> For the 32-bit variant: is the right rotate amount, in the range 0 to 31, encoded in the "immr" field. <immr> For the 64-bit variant: is the right rotate amount, in the range 0 to 63, encoded in the "immr" field. <imms> For the 32-bit variant: is the leftmost bit number to be moved from the source, in the range 0 to 31, encoded in the "imms" field. <imms> For the 64-bit variant: is the leftmost bit number to be moved from the source, in the range 0 to 63, encoded in the "imms" field. <Xd> Is the 64-bit name of the general-purpose destination register, encoded in the "Rd" field. <Xn> Is the 64-bit name of the general-purpose source register, encoded in the "Rn" field. Alias Conditions constant bits(datasize) src = X[n, datasize]; // Perform bitfield move on low bits constant bits(datasize) bot = ROR(src, r) AND wmask; constant bits(datasize) top = Replicate(src<s>, datasize); // Combine extension bits and result bits X[d, datasize] = (top AND NOT(tmask)) OR (bot AND tmask);