07.04.2013 Views

MPLAB C Compiler for PIC24 MCUs and dsPIC DSCs ... - Microchip

MPLAB C Compiler for PIC24 MCUs and dsPIC DSCs ... - Microchip

MPLAB C Compiler for PIC24 MCUs and dsPIC DSCs ... - Microchip

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.

16-Bit C <strong>Compiler</strong> User’s Guide<br />

__builtin_ed<br />

Error Messages An error message will be displayed if:<br />

• the result is not an accumulator register<br />

• xptr is null<br />

• yptr is null<br />

• distance is null<br />

__builtin_edac<br />

Description: Squares sqr <strong>and</strong> sums with the nominated accumulator register,<br />

returning it as the result. Also prefetchs data <strong>for</strong> future square operation<br />

by computing **xptr - **yptr <strong>and</strong> storing the result in *distance.<br />

xincr <strong>and</strong> yincr may be the literal values: -6, -4, -2, 0, 2, 4, 6 or an<br />

integer value.<br />

For example:<br />

register int result asm("A");<br />

int *xmemory, *ymemory;<br />

int distance;<br />

result = __builtin_ed(distance,<br />

&xmemory, 2,<br />

&ymemory, 2,<br />

&distance);<br />

Prototype:<br />

might generate:<br />

ed w4*w4, A, [w8]+=2, [W10]+=2, w4<br />

int __builtin_edac(int sqr, int **xptr, int xincr,<br />

int **yptr, int yincr, int *distance);<br />

Argument: sqr Integer squared value.<br />

xptr Integer pointer to pointer to x prefetch.<br />

xincr Integer increment value of x prefetch.<br />

yptr Integer pointer to pointer to y prefetch.<br />

yincr Integer increment value of y prefetch.<br />

distance Integer pointer to distance.<br />

Return Value: Returns the squared result to specified accumulator.<br />

Assembler Operator<br />

/ Machine<br />

Instruction:<br />

edac<br />

Error Messages An error message will be displayed if:<br />

• the result is not an accumulator register<br />

• xptr is null<br />

• yptr is null<br />

• distance is null<br />

__builtin_fbcl<br />

Description: Finds the first bit change from left in value. This is useful <strong>for</strong> dynamic<br />

scaling of fixed-point data. For example:<br />

int result, value;<br />

result = __builtin_fbcl(value);<br />

might generate:<br />

fbcl w4, w5<br />

Prototype: int __builtin_fbcl(int value);<br />

DS51284G-page 148 © 2008 <strong>Microchip</strong> Technology Inc.

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

Saved successfully!

Ooh no, something went wrong!