📄 lesson2_c.c
字号:
/****************************************************************************//* *//* 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -