Is there a recommended way of achieving compiler level barriers? #2766
Unanswered
Foxy-Boxes
asked this question in
Q&A
Replies: 1 comment
-
|
I was just thinking about this when implementing fn void relax() @inline
{
$switch env::ARCH_TYPE:
$case RISCV32:
$case RISCV64:
$case X86:
$case X86_64:
asm("pause");
$case ARM:
$case ARM64:
asm("yield");
$default:
// __asm__ volatile("" ::: "memory");
$endswitch
}
``} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I wanted to ask if there was a way to disable reordering memory accesses when optimizations are enabled. With some C compilers one can insert an empty inline assembly line with memory in the clobber list which disables reordering across the line. I haven't checked the compiler code to see if there was a similar capability, or maybe this kind of optimization is not enabled for C3, in any case I would like some guidance if anyone is familiar with this issue.
Beta Was this translation helpful? Give feedback.
All reactions