Peer-review by Noel Svartsjö Söderberg (noesva-3)
Errors
-
In your
.c
files, you should (according to lab isntructions) define seed as a global variable (outside of themain()
function). Since you store it insidemain()
as a "local" variable, it will dissappear after termination. -
There are currently zero comments in your code. You need to add some (according to lab isntructions) to make your code easier to read. Since the code itself is pretty easy to understand, I think it is enough to add general comment about the segments of your code so that someone who hasn't written the lab can understand.
// counting number of zeros by checking all bits iteratively
over the loop for example. -
You haven't yet finished answering any questions (part 3 & 4 of the lab). You should do this by writing directly into the
README
file.
TIPS
- I recommend that you (when answering the questions) look at the link under part 4 of the documented features of each optimization level.
- I don't think it is important to understand every line of the generated code (especially for the optimized versions), so try to look for things like how the stack and registers are used as well as structural differences, like whether loops and functions remain the same after optimization.
- I also found it very useful to use
ctrl + f
to quickly look for which registers were used, and how many stallsnop
were used. You could also check how the stack was used by looking for$sp
.
Good luck!