This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: atomicity of x86 bt/bts/btr/btc?
- From: "Rick C. Hodgin" <foxmuldrster at yahoo dot com>
- To: Jay K <jay dot krell at cornell dot edu>
- Cc: gcc <gcc at gcc dot gnu dot org>
- Date: Tue, 19 Oct 2010 02:52:34 -0500
- Subject: Re: atomicity of x86 bt/bts/btr/btc?
- References: <COL101-W23F10CF8B1E37F02B0989BE65B0@phx.gbl>
> ;; %%% bts, btr, btc, bt.
> ;; In general these instructions are *slow* when applied to memory,
> ;; since they enforce atomic operation. When applied to registers,
>
> I haven't found documented confirmation that these instructions are atomic without a lock prefix,
> having checked Intel and AMD documentation and random web searching.
> They are mentioned as instructions that can be used with lock prefix.
They do not automatically lock the bus. They will lock the bus with the
explicit LOCK prefix, and BTS is typically used for an atomic read/write
operation.
- Rick