Browse Source

On x86-64, make MB/WMB compiler barriers

Whie on x86(64) one does not normally need full memory barriers, it's
good practice to at least use compiler barriers for places where on other
architectures memory barriers are used; this prevents the compiler
from over-optimizing.
tags/v0.3.1
Arjan van de Ven 7 years ago
parent
commit
7e39ffe113
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      common_x86_64.h

+ 5
- 0
common_x86_64.h View File

@@ -60,8 +60,13 @@
#endif
*/

#ifdef __GNUC__
#define MB __asm__ __volatile__("": : :"memory")
#define WMB __asm__ __volatile__("": : :"memory")
#else
#define MB
#define WMB
#endif

static void __inline blas_lock(volatile BLASULONG *address){



Loading…
Cancel
Save