Question: Task 3 The function find _ above _ instruction _ without _ dependencies ( ) scans a subset upward ( from bottom to top )
Task
The function findaboveinstructionwithoutdependencies scans a subset upward from bottom to top until an instruction with no data dependencies is found. This alone will not be enough to sufficiently check the subset for suitable instructions to swap, because when a suitable instruction is not found searching bottom to top, the search must be repeated from top to bottom.
Complete findaboveinstructionwithoutdependencies
Note: When checking whether or not an instruction is truly dependencyfree, we must check in both directions ie instructionA against instructionB and instructionB against instructionA
The bidirectional check only applies to the intermediate instructions intermediateindex but not the current instruction currentindex The current instruction is always below the test instruction testindex even after swapping. Thus, you only need to compare the rd of the test instruction with the rs of the current instruction.
Step by Step Solution
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
