These intrinsics are supposed to select to BT, BTS, etc instructions.
Those instructions actually perform a bitwise array indexing memory
operation that LLVM doesn't currently expose. This change implements
the shifting and array indexing in plain C.
Fixes PR33188
If we ever fix PR19164, then the array indexing should be pattern
matched to BT and BTS memory instructions as appropriate.
_bittest seems to expand to (((unsigned char const *)_BitBase)[_BitPos >> 3] >> (_BitPos & 7)) & 1 on CL ARM: https://godbolt.org/g/Yc8rMH
Perhaps these are the intended semantics?