This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] x86: Apply standalone prefixes to the following instruction
- From: Florian Weimer <fweimer at redhat dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Fri, 19 Jul 2019 11:31:36 +0200
- Subject: Re: [PATCH] x86: Apply standalone prefixes to the following instruction
- References: <CAMe9rOohqV49DVBVRr_kNTyT6ruNYJZgTCWkq4B-Bmh+VRAM=Q@mail.gmail.com>
* 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