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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Compiler-specific Features<br />

4.7.77 __smuadx intrinsic<br />

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

compiler. It enables you to exchange the halfwords of the second operand, perform two<br />

16-bit signed integer multiplications, and add the products together. Exchanging the<br />

halfwords of the second operand produces top × bottom and bottom × top<br />

multiplication. The Q flag is set if the addition overflows. The multiplications cannot<br />

overflow.<br />

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

Where:<br />

val1<br />

val2<br />

holds the first halfword operands for each multiplication<br />

holds the second halfword operands for each multiplication.<br />

The __smuadx intrinsic returns the products of the two 16-bit signed multiplications.<br />

Example:<br />

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

{<br />

unsigned int res;<br />

}<br />

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

p1 = val1[15:0] × val2[15:0]<br />

p2 = val1[31:16] × val2[31:16]<br />

res[31:0] = p1 + p2<br />

*/<br />

return res;<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 />

• SMUAD{X} and SMUSD{X} on page 4-82 in the Assembler Guide.<br />

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

ID101213<br />

Non-Confidential,

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

Saved successfully!

Ooh no, something went wrong!