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.69 __smlaldx intrinsic<br />

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

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

two signed 16-bit multiplications, adding both results to a 64-bit accumulate operand.<br />

Overflow is only possible as a result of the 64-bit addition. This overflow is not detected<br />

if it occurs. Instead, the result wraps around modulo2 64 .<br />

unsigned long long__smlaldx(unsigned int val1, unsigned int val2, unsigned long<br />

long val3)<br />

Where:<br />

val1<br />

val2<br />

val3<br />

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

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

holds the accumulate value.<br />

The __smlald intrinsic returns the product of each multiplication added to the<br />

accumulate value.<br />

Example:<br />

unsigned int dual_multiply_accumulate(unsigned int val1, unsigned int val2,<br />

unsigned int val3)<br />

{<br />

unsigned int res;<br />

}<br />

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

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

sum = p1 + p2 + val3[63:32][31:0]<br />

res[63:32] = sum[63:32]<br />

res[31:0] = sum[31:0]<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 />

• SMLALD and SMLSLD on page 4-88 in the Assembler Guide.<br />

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

ID101213<br />

Non-Confidential,

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

Saved successfully!

Ooh no, something went wrong!