Explain the meaning of the term memory disambiguation and write a short fragment of code either in C or as pseudocode that illustrates the problem.

What will be an ideal response?


When executing strictly sequential code, the problem of memory disambiguation does not arise. For example,
suppose we execute (here we are using an absolute memory address X to illustrate a point) the following


LDR r0,X ;load r0 with the contents of memory location X
ADD r0,r0,#1
STR r0,X

This sequence performs the operation X = X + 1. Obviously, the load and store have to be performed in the
correct sequence to preserve the meaning of the code. If you change the order of the load and store, the
outcome will be different. Now, suppose we have the code

LDR r0,[r1]
ADD r0,r0,#1
STR r0,[r1]

We have the same situation as the previous example, except that the source and destination are provided by
pointers. Let’s go one step further. Now consider the code fragment

LDR r0,[r1]
ADD r0,r0,#1
STR r3,[r2]

Here we have two different pointer registers r1 and r2. Consequently, we can change the order of the load and
store operations. Or can we? If r1 and r2 point to different entities, there is no problem. If they point to the
same entity, there is a problem and we have to preserve order. The programmer doesn’t have a problem with
this code because he or she knows what objects are being referenced. However, the processor does not know
that and can’t alter the order of loads and stores.

Disambiguation refers to the ability of some processors to determine whether pointers point to the same or
different objects and therefore whether the order of loads and stores can be changed. You can say that memory
disambiguation removes spurious (or false) dependencies.

Computer Science & Information Technology

You might also like to view...

The NIST CSF Reference Tool provides a way for you to browse the Framework Core by which of the following?

A) Categories B) Functions C) Informative references D) All of the above

Computer Science & Information Technology

To set preferences for importing Photoshop documents in Windows, click ____ on the Menu bar, click Preferences, click the PSD File Importer Category, and then select how you want Flash to import images, text, and shapes.

A. File B. Import C. Edit D. Manage

Computer Science & Information Technology

Which type of DVD media has a storage capacity of 7.95 GB?

A. DVD-5 B. DVD-9 C. DVD-10 D. DVD-18

Computer Science & Information Technology

A company has one public IP address, and only one device needs to be able to connect to the Internet at a time. Which of the following is the BEST option for connectivity?

A. VLSM B. CIDR C. NAT D. PAT

Computer Science & Information Technology