04.01.2015 Views

RealView Compilation Tools - ARM Information Center

RealView Compilation Tools - ARM Information Center

RealView Compilation Tools - ARM Information Center

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Compiler-specific Features<br />

4.7.82 __sxtab16 intrinsic<br />

This intrinsic inserts an SXTAB16 instruction into the instruction stream generated by the<br />

compiler. It enables you to extract two 8-bit values from the second operand (at bit<br />

positions [7:0] and [23:16]), sign-extend them to 16-bits each, and add the results to the<br />

first operand.<br />

unsigned int __sxtab16(unsigned int val1, unsigned int val2)<br />

Where:<br />

val1<br />

val2<br />

holds the values that the extracted and sign-extended values are added to<br />

holds the two 8-bit values to be extracted and sign-extended.<br />

The __sxtab16 intrinsic returns the addition of val1 and val2, where the 8-bit values in<br />

val2[7:0] and val2[23:16] have been extracted and sign-extended prior to the addition.<br />

Example:<br />

unsigned int extract_sign_extend_and_add(unsigned int val1, unsigned int val2)<br />

{<br />

unsigned int res;<br />

res = __sxtab16(val1,val2); /* res[15:0]<br />

= val1[15:0] + SignExtended(val2[7:0])<br />

}<br />

return res;<br />

res[31:16]<br />

= val1[31:16] + SignExtended(val2[23:16])<br />

*/<br />

See also<br />

• <strong>ARM</strong>v6 SIMD intrinsics on page 4-109<br />

• Instruction summary on page 4-2 in the Assembler Guide<br />

• SXT, SXTA, UXT, and UXTA on page 4-109 in the Assembler Guide.<br />

<strong>ARM</strong> DUI 0348C Copyright © 2007-2010 <strong>ARM</strong>. All rights reserved. 4-159<br />

ID101213<br />

Non-Confidential,

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!