Answer by Alex for Can x86 reorder a narrow store with a wider load that...
Can x86 reorder a narrow store with a wider load that fully contains it?Yes, x86 can reorder a narrow store with a wider load that fully contains it.That is why your lock algorithm is broken,...
View ArticleAnswer by Peter Cordes for Can x86 reorder a narrow store with a wider load...
Can mov byte [rcx+r8], 1 reorder with the cmp qword [rcx], rdx load that follows it? This is the lock[threadNum]=1 store and the following load to make sure nobody else wrote a byte.The load must...
View ArticleCan x86 reorder a narrow store with a wider load that fully contains it?
Intel® 64 and IA-32 Architectures Software Developer’s Manual says:8.2.3.4 Loads May Be Reordered with Earlier Stores to Different LocationsThe Intel-64 memory-ordering model allows a load to be...
View Article
More Pages to Explore .....