12.37 __sxtab16 intrinsic
This intrinsic inserts an
SXTAB16 instruction into the instruction stream generated by the compiler.
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 int
, unsigned int
holds the values that the extracted and sign-extended
values are added to
holds the two 8-bit values to be extracted and sign-extended.
__sxtab16 intrinsic returns the addition
where the 8-bit values in
have been extracted and sign-extended prior to the addition.
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])
= val1[31:16] + SignExtended(val2[23:16])