This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] x86: Apply standalone prefixes to the following instruction


* H. J. Lu:

> Standalone prefixes should be applied to the following instruction,
> instead of being treated as regular instructions.  An error should be
> issued when a standalone prefix is at the end of source or isn't
> followed by an instruction in the same section.

glibc used to do this:

| #define __arch_c_compare_and_exchange_val_8_acq(mem, newval, oldval) \
|   ({ __typeof (*mem) ret;                                                    \
|     __asm __volatile ("cmpl $0, %%fs:%P5\n\t"                                \
|                      "je 0f\n\t"                                             \
|                      "lock\n"                                                \
|                       "0:\tcmpxchgb %b2, %1"                                 \
|                       : "=a" (ret), "=m" (*mem)                              \
|                       : "q" (newval), "m" (*mem), "0" (oldval),              \
|                         "i" (offsetof (tcbhead_t, multiple_threads)));       \
|      ret; })

Will this still work?

Thanks,
Florian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]