Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mapped memory and SSE

I found this paragraph in the Intel developer manual:

From the chaper "PROGRAMMING WITH SSE3, SSSE3, SSE4 AND AESNI"

Streaming loads must not be used to reference memory addresses that are mapped to I/O devices having side effects or when reads to these devices are destructive. This is because MOVNTDQA is speculative in nature.

Anyone could clarify this question?

I'm asking because I'm thinking to apply some SSE assembly to OpenGL mapped buffer objects, but I fear about that destructive word. Is this subject applied to mapped memory? Actually I don't know what's behind a glMapBuffer call.

I don't think my graphic card will be destroyed (:), but surely that word doesn't sound good.

like image 719
Luca Avatar asked Nov 04 '11 23:11

Luca


1 Answers

Destructive here would refer to reads that can only be done once, such as when a device presents a memory-mapped way to read the next item from its queue. In that case, reading from that location a second time would give a second result. This is bad because MOVNTDQA is speculative, so the fetch may be performed even if the instruction is ultimately skipped due to a mis-predicted branch. The data from the first fetch would be irretrievably destroyed, though with no actual harm to the hardware.

Since you're only trying to access ordinary RAM on a different device, and not a MMIO register, you don't need to worry.

like image 175
user57368 Avatar answered Oct 12 '22 08:10

user57368