Be aware, this post is intended for shader developers using the ReShade FX shader programming language.
It is probably relativly unknown, but ReShade FX supports bitwise integer operations even on targets which don't have native support for them (like shader model 3). They are emulated there. As this was requested, here is a list of high level code transformations (in pseudocode) ReShade applies for that emulation. It's no rocket science, but still useful to know and could provide as base for optimizations.
!a => (4294967295 - a)
a & b => if (is_pow2(b)) => (((a / b) % 2) * b)
else if (is_pow2(b + 1)) => ((b + 1) * frac(a / (b + 1)))
else => error
a | b => error
a ^ b => error
a << b => (a * exp2(b))
a >> b => (floor(a / exp2(b)))