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
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_msc<br />
Description: Computes a x b <strong>and</strong> subtracts from accumulator; also prefetchs data<br />
ready <strong>for</strong> a future MAC operation.<br />
xptr may be null to signify no X prefetch to be per<strong>for</strong>med, in which<br />
case the values of xincr <strong>and</strong> xval are ignored, but required.<br />
yptr may be null to signify no Y prefetch to be per<strong>for</strong>med, in which<br />
case the values of yincr <strong>and</strong> yval are ignored, but required.<br />
xval <strong>and</strong> yval nominate the address of a C variable where the<br />
prefetched value will be stored.<br />
xincr <strong>and</strong> yincr may be the literal values: -6, -4, -2, 0, 2, 4, 6 or an<br />
integer value.<br />
If AWB is non null, the other accumulator will be written back into the<br />
referenced variable.<br />
For example:<br />
register int result asm("A");<br />
int *xmemory;<br />
int *ymemory;<br />
int xVal, yVal;<br />
result = __builtin_msc(xVal, yVal,<br />
&xmemory, &xVal, 2,<br />
&ymemory, &yVal, 2, 0);<br />
might generate:<br />
msc w4*w5, A, [w8]+=2, w4, [w10]+=2, w5<br />
Prototype: int __builtin_msc(int a, int b,<br />
int **xptr, int *xval, int xincr,<br />
int **yptr, int *yval, int yincr, int *AWB);<br />
Argument: aInteger multiplic<strong>and</strong>.<br />
bInteger multiplier.<br />
xptrInteger pointer to pointer to x prefetch.<br />
xvalInteger pointer to value of x prefetch.<br />
xincrInteger increment value of x prefetch.<br />
yptrInteger pointer to pointer to y prefetch.<br />
yvalInteger pointer to value of y prefetch.<br />
yincrInteger increment value of y prefetch.<br />
AWBInteger pointer to accumulator selection.<br />
Return Value: Returns the cleared value result to an accumulator.<br />
Assembler Opera- msc<br />
tor / Machine<br />
Instruction:<br />
Error Messages An error message will be displayed if:<br />
• the result is not an accumulator register<br />
• xval is a null value but xptr is not null<br />
• yval is a null value but yptr is not null<br />
__builtin_mulss<br />
Description: Computes the product p0 x p1. Function arguments are signed integers,<br />
<strong>and</strong> the function result is a signed long integer. The comm<strong>and</strong>-line<br />
option -Wconversions can be used to detect unexpected sign<br />
conversions.<br />
Prototype: signed long __builtin_mulss(const signed int p0,<br />
const signed int p1);<br />
DS51284G-page 154 © 2008 <strong>Microchip</strong> Technology Inc.