test.c
上传用户:csczyc
上传日期:2021-02-19
资源大小:1051k
文件大小:1k
- Longword L_v_magsq(Shortword *vec1,Shortword n,Shortword qvec1,Shortword qout)
- {
- Shortword i,shift;
- Longword L_magsq;
- Longword L_temp,L_mult,L_qvec1,L_qout;
- L_temp = 0; // L_data_move();mark del
- for(i = 0; i < n; i++){
- L_mult = _smpy(vec1[i],vec1[i]);
- L_temp = _sadd(L_temp,L_mult);
- }
- /* L_temp = L_mac(L_temp,vec1[i],vec1[i]);*/
- /* ((qout-16)-((2*qvec1+1)-16)) */
- /* shift = sub(sub(qout,shl(qvec1,1)),1);*/
- L_qvec1 = (Longword)qvec1;
- L_qout = (Longword)qout;
- L_mult = _sshl(L_qvec1,1);
- L_mult = _sub2(L_qout,L_mult);
- L_mult = _sub2(L_mult,1);
- shift = (Shortword) (0x0000ffffL & L_mult);
- /*L_magsq = L_shl(L_temp,shift); // L_data_move();mark del*/
- L_magsq = _sshvl(L_temp,shift);
- return(L_magsq);
- } /* L_v_magsq */