Files
perfect/include/perfect/detail/cache/amd64.hpp
2019-09-19 16:56:57 -05:00

35 lines
496 B
C++

#pragma once
namespace perfect {
namespace detail {
inline void flush_line(void *p) {
/*!
arch/x86/include/asm/special_insns.h
p139
https://www.amd.com/system/files/TechDocs/24594.pdf
clflush mem8
*/
asm volatile("clflush %0"
: "+m"(p)
: // no inputs
: // no clobbers
);
}
inline void barrier_all() {
asm volatile("mfence"
: // no outputs
: // no inputs
: "memory");
}
}
}