lileishitou 发表于 2010-11-30 17:55

求一段AT&T一段内联汇编问题

/* Conditionally execute fence after interlocked instruction. */
static INLINE void
AtomicEpilogue(void)
{
#ifdef ATOMIC_USE_FENCE
#ifdef VMM
      /* The monitor conditionally patches out the lfence when not needed.*/
      /* Construct a MonitorPatchTextEntry in the .patchtext section. */
   asm volatile ("1:\n\t"
               "lfence\n\t"
               "2:\n\t"
               ".pushsection .patchtext\n\t"
               ".quad 1b\n\t"
               ".quad 2b\n\t"
               ".popsection\n\t" ::: "memory");
#else
   if (UNLIKELY(AtomicUseFence)) {
      asm volatile ("lfence" ::: "memory");
   }
#endif
#endif

上面这段代码完全看不懂啥意思

cjaizss 发表于 2010-11-30 21:16

info gcc->C Extensions->Extended Asm
info as->Pseudo Ops
也可以看看
http://blog.chinaunix.net/u/17660/showart_259729.html

cjaizss 发表于 2010-11-30 21:16

info gcc->C Extensions->Extended Asm
info as->Pseudo Ops
也可以看看
http://blog.chinaunix.net/u/17660/showart_259729.html
页: [1]
查看完整版本: 求一段AT&T一段内联汇编问题