| 724 | } |
| 725 | |
| 726 | void ap::vsub(double *vdst, int stride_dst, const double *vsrc, int stride_src, int n) |
| 727 | { |
| 728 | int i; |
| 729 | if( stride_dst!=1 || stride_src!=1 ) |
| 730 | { |
| 731 | // |
| 732 | // general unoptimized case |
| 733 | // |
| 734 | for(i=0; i<n; i++, vdst+=stride_dst, vsrc+=stride_src) |
| 735 | *vdst -= *vsrc; |
| 736 | } |
| 737 | else |
| 738 | { |
| 739 | // |
| 740 | // highly optimized case |
| 741 | // |
| 742 | int n2 = n/2; |
| 743 | for(i=0; i<n2; i++, vdst+=2, vsrc+=2) |
| 744 | { |
| 745 | vdst[0] -= vsrc[0]; |
| 746 | vdst[1] -= vsrc[1]; |
| 747 | } |
| 748 | if( n%2!=0 ) |
| 749 | vdst[0] -= vsrc[0]; |
| 750 | } |
| 751 | } |
| 752 | |
| 753 | void ap::vsub(ap::complex *vdst, int stride_dst, const ap::complex *vsrc, int stride_src, const char *conj_src, int n) |
| 754 | { |