Question: Function funct2 has the following prototype: double funct2(double w, int x, float y, long z); Gcc generates the following code for the function: 1 23

Function funct2 has the following prototype:

double funct2(double w, int x, float y, long z);

Gcc generates the following code for the function:

1 23 4 5 6 7 8 9 double funct2(double w, int x, float y, long z) w in %xmm0, x in %edi, y in %xmmi, z in %rsi

1 23 4 5 6 7 8 9 double funct2(double w, int x, float y, long z) w in %xmm0, x in %edi, y in %xmmi, z in %rsi funct2: vcvtsi2ss vmulss %xmm1, %xmm2, %xmm1 %edi, %xmm2, %xmm2 vunpcklps vcvtps2pd vcvtsi2sdq %xmm1, %xmm1, %xmm1 %xmm1, %xmm2 %rsi, %xmm1, %xmm1 vdivsd %xmm1, %xmm0, %xmmo vsubsd %xmm0, %xmm2, %xmmo ret Write a C version of funct2.

Step by Step Solution

3.28 Rating (151 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

This problem can readily be solved by stepping through the a... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Computer Systems A Programmers Perspective Questions!