28.2.21 __builtin_ed
Description
Squares sqr
, returning it as the result. Also prefetches data for future
square operation by computing **xptr - **yptr
and storing the result in
*distance
.
xincr
and yincr
may be the literal values: -6, -4, -2,
0, 2, 4, 6 or an integer value.
For example:
volatile register int16_t result asm("A");
int16_t *xmemory, *ymemory;
int16_t distance;
result = __builtin_ed(distance, &xmemory, 2, &ymemory, 2, &distance);
might generate:
ed w4*w4, A, [w8]+=2, [W10]+=2, w4
Prototype
int16_t __builtin_ed(int16_t sqr, int16_t **xptr, int16_t xincr, int16_t **yptr, int16_t yincr, int16_t *distance);
Arguments
sqr
– Integer squared value.
xptr
– Integer pointer to pointer to x prefetch.
xincr
– Integer increment value of x prefetch.
yptr
– Integer pointer to pointer to y prefetch.
yincr
– Integer increment value of y prefetch.
distance
– Integer pointer to distance.
Return Value
Returns the squared result to an accumulator.
Machine Instruction
ed
Error Messages
An error message will be displayed if:
- the result is not an accumulator register
xptr
is nullyptr
is nulldistance
is null