| |||
| Home > ARMv6 SIMD Instruction Intrinsics > __sxtab16 intrinsic | |||
This intrinsic inserts an SXTAB16 instruction
into the instruction stream generated by the compiler. It enables
you to extract two 8-bit values from the second operand (at bit
positions [7:0] and [23:16]), sign-extend them to 16-bits each,
and add the results to the first operand.
unsigned int __sxtab16(unsigned intval1, unsigned intval2)
Where:
val1holds the values that the extracted and sign-extended values are added to
val2holds the two 8-bit values to be extracted and sign-extended.
The __sxtab16 intrinsic returns the addition
of and val1 ,
where the 8-bit values in val2[7:0] and val2[23:16]
have been extracted and sign-extended prior to the addition.val2
Example:
unsigned int extract_sign_extend_and_add(unsigned int val1, unsigned int val2)
{
unsigned int res;
res = __sxtab16(val1,val2); /* res[15:0]
= val1[15:0] + SignExtended(val2[7:0])
res[31:16]
= val1[31:16] + SignExtended(val2[23:16])
*/
return res;
}
Instruction summary in the Assembler Reference
SXT, SXTA, UXT, and UXTA in the Assembler Reference.