161
11100B–ATARM–31-Jul-12
SAM4S Series [Preliminary]
11.6.8.3
SXTA and UXTA
Signed and Unsigned Extend and Add
Syntax
op{cond} {Rd,} Rn, Rm {, ROR #n}
op{cond} {Rd,} Rn, Rm {, ROR #n}
where:
Operation
These instructions do the following:
1.
Rotate the value from
Rm
right by 0, 8, 16 or 24 bits.
2.
Extract bits from the resulting value:
–
SXTAB
extracts bits[7:0] from Rm and sign extends to 32 bits.
–
UXTAB
extracts bits[7:0] from Rm and zero extends to 32 bits.
–
SXTAH
extracts bits[15:0] from Rm and sign extends to 32 bits.
–
UXTAH
extracts bits[15:0] from Rm and zero extends to 32 bits.
–
SXTAB16
extracts bits[7:0] from Rm and sign extends to 16 bits,
and extracts bits [23:16] from Rm and sign extends to 16 bits.
–
UXTAB16
extracts bits[7:0] from Rm and zero extends to 16 bits,
and extracts bits [23:16] from Rm and zero extends to 16 bits.
3.
Adds the signed or zero extended value to the word or corresponding halfword of Rn
and writes the result in Rd.
Restrictions
Do not use SP and do not use PC.
Condition Flags
These instructions do not affect the flags.
op
is one of:
SXTAB
Sign extends an 8-bit value to a 32-bit value and add.
SXTAH
Sign extends a 16-bit value to a 32-bit value and add.
SXTAB16
Sign extends two 8-bit values to two 16-bit values and add.
UXTAB
Zero extends an 8-bit value to a 32-bit value and add.
UXTAH
Zero extends a 16-bit value to a 32-bit value and add.
UXTAB16
Zero extends two 8-bit values to two 16-bit values and add.
cond
is an optional condition code, see
Rd
is the destination register.
Rn
is the first operand register.
Rm
is the register holding the value to rotate and extend.
ROR #n
is one of:
ROR #8
Value from
Rm
is rotated right 8 bits.
ROR #16
Value from
Rm
is rotated right 16 bits.
ROR #24
Value from
Rm
is rotated right 24 bits.
If
ROR #n
is omitted, no rotation is performed.
Summary of Contents for SAM4S Series
Page 44: ...44 11100B ATARM 31 Jul 12 SAM4S Series Preliminary ...
Page 412: ...412 11100B ATARM 31 Jul 12 SAM4S Series Preliminary ...
Page 1105: ...1105 11100B ATARM 31 Jul 12 SAM4S Series Preliminary ...
Page 1143: ...1143 11100B ATARM 31 Jul 12 SAM4S Series Preliminary Figure 43 4 64 lead LQFP Package Drawing ...
Page 1145: ...1145 11100B ATARM 31 Jul 12 SAM4S Series Preliminary Figure 43 5 64 lead QFN Package Drawing ...