Answered You can hire a professional tutor to get the answer.

QUESTION

3 [20] Consider the following code, which multiplies two vectors that contain single- precision complex values. Convert this code into VMIPS assembly...

for ( i = 0 ; i< 64 ; i++)

c_re[i] = a_re[i] * b_re[i] – a_im[i] * b_im[i] ;

c_im[i] = a_re[i] * b_im[i] + a_im[i] * b_re[i] ;

Assume the processor has a maximum vector length of 64, so you can solve this problem in one iteration without branch/loop instructions. You may use the vector registers from v1 to v8 to store the results and the array name represents the start address of each array. For example, you can load the array a_re to v1 by this instruction: lv $v1, a_re;

The vector instructions you may use to solve this problem ( Note: some vector instructions may not be used. ):

lv, svaddv.saddvs.ssubv.ssubvs.smulv.smulvs.s

: load/store vector : add vectors of single-precision : add scalar to each element of vector of single-precision : sub vectors of single-precision : sub scalar to each element of vector of single-precision : multiply vectors of single-precision : multiply scalar to each element of vector of single-precision.

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question