lesson2_c.c

来自「dsp6713开发板的许多例程.对入门特别有用」· C语言 代码 · 共 41 行

C
41
字号
/****************************************************************************//*                                                                          *//* lesson2_c  -  Minimum trip count and max trip counter factor info added  *//*                                                                          *//* Results for Release 4.00:                                                *//*                                                                          *//*     When compiled with -k -mw -mh -o3:                                   *//*          1.5 cycles per iteration - 4 LDHs & 2 STHs every 2 iterations   *//*                                                                          *//*          Program info needed but not available:                          *//*              Alignment info - xptr and yptr aligned on a word boundary   *//*                                                                          *//*          Program info available:                                         *//*              Potential pointer aliasing info (restrict type qualifier)   *//*              Loop count info - minimum trip count                        *//*              Loop count info - max trip count factor                     *//*                                                                          *//*     When compiled with -k -mw -mh -o3 -pm -op2 with tutor_d              *//*           1 cycle per iteration - All info available                     *//*                                                                          *//****************************************************************************/void lesson2_c(short * restrict xptr, short * restrict yptr, short *zptr,               short *w_sum, int N){    int i, w_vec1, w_vec2;    short w1, w2;                w1 = zptr[0];    w2 = zptr[1];    #pragma MUST_ITERATE(20, , 2);    for (i = 0; i < N; i++)    {        w_vec1 =  xptr[i] * w1;        w_vec2 =  yptr[i] * w2;        w_sum[i] = (w_vec1 + w_vec2) >> 15;    }}

⌨️ 快捷键说明

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