If you mean testing and modifying a bit as a single atomic operation, then the bit test instructions (BT, BTS, BTR, and BTC) can all be made atomic by using the LOCK prefix.
If you mean testing a bit atomically, and then setting a bit atomically as separate operations, you can test the bit using a standard atomic read, and modifying the bit can be done using LOCK OR, LOCK AND, LOCK XOR instructions.
If you need something more complicated, e.g. testing one bit and then setting a different bit, you ll have to use the standard compare-and-swap CMPXCHG instruction in a retry loop.