Skip to content

Commit

Permalink
Merge pull request #6916 from tautschnig/bugfixes/asm-x86
Browse files Browse the repository at this point in the history
C library: __asm("<X>fence") is x86-only
  • Loading branch information
tautschnig authored Jun 8, 2022
2 parents 31e4ddf + e42a46d commit 4a4755d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/ansi-c/library/gcc.c
Original file line number Diff line number Diff line change
@@ -1,24 +1,36 @@
/* FUNCTION: __builtin_ia32_sfence */

#if defined(__i386__) || defined(__x86_64__)

void __builtin_ia32_sfence(void)
{
__asm("sfence");
}

#endif

/* FUNCTION: __builtin_ia32_lfence */

#if defined(__i386__) || defined(__x86_64__)

void __builtin_ia32_lfence(void)
{
__asm("lfence");
}

#endif

/* FUNCTION: __builtin_ia32_mfence */

#if defined(__i386__) || defined(__x86_64__)

void __builtin_ia32_mfence(void)
{
__asm("mfence");
}

#endif

/* FUNCTION: __sync_synchronize */

void __sync_synchronize(void)
Expand Down

0 comments on commit 4a4755d

Please sign in to comment.