12.37 __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.

Syntax

unsigned int __sxtab16(unsigned int val1, unsigned int val2)
Where:
val1
holds the values that the extracted and sign-extended values are added to
val2
holds the two 8-bit values to be extracted and sign-extended.

Return value

The __sxtab16 intrinsic returns the addition of val1 and val2, where the 8-bit values in val2[7:0] and val2[23:16] have been extracted and sign-extended prior to the addition.

Examples

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;
}
Related reference
9.143 ARMv6 SIMD intrinsics
Related information
SXTAB16
ARM and Thumb instruction summary
Non-ConfidentialPDF file icon PDF versionARM DUI0375E
Copyright © 2007, 2008, 2011, 2012, 2014 ARM. All rights reserved.