DSP_neg32
DSP_neg32 |
| |||
Function |
| void DSP_neg32(int *x, int *r, short nx) |
| |
Arguments |
| x[nx] | Pointer to input data vector 1 of size nx with | |
|
|
| Must be | |
|
| r[nx] | Pointer to output data vector of size nx with | |
|
|
| Must be | |
|
| nx | Number of elements of input and output vectors. Must be a | |
|
|
| multiple of 4 and ≥8. | |
Description |
| This function negates the elements of a vector | ||
|
| output arrays must not be overlapped except for where the input and output | ||
|
| pointers are exactly equal. | ||
Algorithm |
| This is the C equivalent of the assembly code without restrictions. Note that | ||
|
| the assembly code is hand optimized and restrictions may apply. |
void DSP_neg32(int *x, int *r, short nx)
{
short i;
for(i=nx; i>0; i−−) *(r++)=−*(x++);
}
Special Requirements
-nx must be a multiple of 4 and greater than or equal to 8.
-The arrays x[ ] and r[ ] must be
Implementation Notes
| - Bank Conflicts: No bank conflicts occur. | |
| - Interruptibility: The code is | |
| - The loop is unrolled twice and pipelined. | |
Benchmarks | Cycles | nx/2 + 19 |
| Codesize | 124 bytes |