Memory Ordering Flashcards

1
Q

What is memory ordering for?

A

Eliminating memory dependencies for Load and Store instructions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a Load-Store Queue?

A

It’s just like a ROB, but for Load and Store instructions. This allows us to Load values as soon as they’re available while only writing Store results on commit.

Has columns for: Instruction, address, value, and commit bit.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is Store-to-Load Forwarding?

A

When we add a Load instruction to the Load to Store Queue, we check whether there are any previous Store instructions referring to the same address. If so, we use Store to Load Forwarding to forward the value used by the Store instruction to our Load instruction.

This saves our Load from having to go to memory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do modern processors generally decide where to get the value for a Load instruction? They could just go through all instructions in order, or wait for all Store instructions, or something else.

A

They just go anyway! If we add a Load to the LSQ and there are previous Stores with unknown addresses, we just go to memory to get the Load value. If, in ensuing cycles, it turns out that there is a previous Store with the same address as the load, we forward the Store result to this Load. If future instructions already used the value from Load, the new value must be forwarded to them too.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Which Store instruction should forward its value to Load when there are multiple matches on Load’s address?

A

The most recent one!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What entries do Load/Stores need vs other instructions?

A

Load/Store
- ROB entry
- LSQ entry

Others
- RS entry
- LSQ entry ( I don’t think that’s right!)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What process do we go through with Load/Stores after Issuing?

A

Execute Load/Store:
1) Compute address
2) Produce value
This order matters for Load, but not for Store.

Write result (only for Load)
- Broadcast result too

Commit Load/Stores
- Move ROB commit head
- Move LSQ commit head
This frees ROB and LSQ entries

Finally, for Stores only, we send the Committed value to memory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly