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

Florian Weimer fweimer@redhat.com
Fri Jul 19 09:31:00 GMT 2019


* 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



More information about the Binutils mailing list