Software Archive
Read-only legacy content
17061 Discussions

Scatter behaviour

Vladimir_Dergachev
418 Views

What does scatter instruction do when the indices are all the same (0 for example) ? Is this allowed, an if so which element actually gets stored ?

Thank you !

Vladimir Dergachev

0 Kudos
2 Replies
Sumedh_N_Intel
Employee
418 Views

This is what I found in the Intel Xeon Phi coprocessor Instruction Set Architecture reference: 

Writes to overlapping destination memory locations are guaranteed to be ordered with respect to each other (from LSB to MSB of the source registers). Only writes to overlapping vector indices are guaranteed to be ordered with respect to each other (from LSB to MSB of the source registers). Writes that are not overlapped may happen in any order. Memory ordering with other instructions follows the Intel-64 memory ordering model. Note that this does not account for non-overlapping indices that map into the same physical address locations

From this, I deduce that same indices are allowed in a scatter instruction. Also, since the overlapping writes are ordered from LSB to MSB of the souce elements, I would expect the MSB value to be actually present in the memory location after the scatter has been executed. 

0 Kudos
Vladimir_Dergachev
418 Views

Excellent, this is exactly what I was looking for !

Thank you very much,

Vladimir Dergachev

0 Kudos
Reply