Write after write and write after read dependencies.
Let's, let's talk about these. In write after write dependence, you're
going to write to one register, then you're going to write to the register
again, and in our pipelines we've talked about so far, you're basically gonna stall
the pipe while you're waiting for the first right to commit.
Because we're not able to handle multiple rights in, in the pipeline at the same
time. But these are not fundamental
dependencies. So computer architects put on our thinking
cap and we came up with ways to break these dependencies.
A read after write, that, that also is true for a write after a read.
So, if you do write to let's says register four after a read from register four,
well, there should be nothing wrong with that.
But, if you try to execute the instructions out of order, then you need
to think about that. A read after write is a true dependence,
because you actually need the data, you need the value to go execute the
subsequent instruction. And we're going to call write after read,
write after write and write after read dependencies name dependencies, and we're
going to call a read after write a true dependence that we can't break.
Okay. So let's, let's look at a some example
code here, and see what can go wrong if you just ignore all the name dependencies.
Like I said, they're not true dependencies, so maybe we just don't need
them. Okay, so we have, a different code
sequence here, we have a mul, mul, then two add immediates.
Let's, let's identify some important things in here.
First let's identify the true read after write dependencies.
So I, I put some circles and some arrows here.
So let's take a look here. This writes register one in the mul.
The second mall reads the results of that. Okay?