Question: Consider the following program: Perform at least the following optimizations: Removal of the if in the innermost loop (line 14) Loop unrolling (line 13) Constant
Consider the following program:![234 6 #include #define DATALEN 15 #define FILTERTAPS 5 double x [DATALEN]](https://dsd5zvtm8ll6.cloudfront.net/images/question_images/1710/4/7/3/10365f3bf8f6f0a31710473101013.jpg)
Perform at least the following optimizations:
- Removal of the if in the innermost loop (line 14)
- Loop unrolling (line 13)
- Constant propagation
- Floating-point to fixed-point conversion
- Avoidance of all accesses to arrays
Please provide the optimized version of the program after each of the transformations and do also check for consistent results!
234 6 #include #define DATALEN 15 #define FILTERTAPS 5 double x [DATALEN] = {128.0, 130.0, 180.0, 140.0, 120.0, 110.0, 107.0, 103.5, 102.0, 90.0, 84.0, 70.0, 30.0, 77.3, 95.7 const double h[FILTERTAPS]={0.125,-0.25, 0.5,-0.25, 0.125}; double y [DATALEN]; // result; int main(void) { int i,n; for (i=0; i return 0;
Step by Step Solution
★★★★★
3.41 Rating (157 Votes )
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
