⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dot_prod_10.c

📁 dsp6713开发板的许多例程.对入门特别有用
💻 C
字号:
int dot_prod(const short *restrict a, const short *restrict b,             short *restrict c, int len){    int i;    int      sum = 0;                  /* 32-bit accumulation         */    unsigned a3_a2, a1_a0;             /* Packed 16-bit values        */    unsigned b3_b2, b1_b0;             /* Packed 16-bit values        */    for (i = 0; i < len; i += 4)    {        a3_a2 = _hi(*(const double *) &a[i]);        a1_a0 = _lo(*(const double *) &a[i]);        b3_b2 = _hi(*(const double *) &b[i]);        b1_b0 = _lo(*(const double *) &b[i]);        /* Perform dot-products on pairs of elements, totalling the            results in the accumulator. */        sum += _dotp2(a3_a2, b3_b2);        sum += _dotp2(a1_a0, b1_b0);    }    return sum;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -