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.72 __smlsld intrinsic<br />

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

compiler. It enables you to perform two 16-bit signed multiplications, take the<br />

difference of the products, subtracting the high halfword product from the low halfword<br />

product, and add the difference to a 64-bit accumulate operand. Overflow cannot occur<br />

during the multiplications or the subtraction. Overflow can occur as a result of the 64-bit<br />

addition, and this overflow is not detected. Instead, the result wraps round to modulo 64 .<br />

unsigned long long__smlsld(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 __smlsld intrinsic returns the difference of the product of each multiplication,<br />

added to the accumulate value.<br />

Example:<br />

unsigned long long dual_multiply_diff_prods(unsigned int val1, unsigned int<br />

val2, unsigned long long val3)<br />

{<br />

unsigned int res;<br />

}<br />

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

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

res[63:0] = p1 - p2 + val3[63: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 />

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

Non-Confidential,<br />

ID101213

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

Saved successfully!

Ooh no, something went wrong!