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

H.J. Lu hjl.tools@gmail.com
Fri Jul 19 17:18:00 GMT 2019


On Fri, Jul 19, 2019 at 2:31 AM Florian Weimer <fweimer@redhat.com> wrote:
>
> * 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?
>

":" between prefixes and instruction is a special case.   Here is the updated
patch to add i386_frob_colon so that i386 can output all pending stand-alone
prefixes when seeing a colon in the same frag.

-- 
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-x86-Apply-standalone-prefixes-to-the-following-instr.patch
Type: text/x-patch
Size: 21191 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20190719/10d4c9b2/attachment.bin>


More information about the Binutils mailing list