Cleaner implementation of bitwise operations of integeral types (#33849)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/33849
For integral types, there is no need to manipulate with
`reinterpret_cast` and therefore a cleaner implementation is available.
This might also be helpful on some less optimized compilers or on a less optimized arch (while a
test on gcc 8.3 x64 shows no difference in performance).
Test Plan: Imported from OSS
Differential Revision: D20222675
Pulled By: VitalyFedyunin
fbshipit-source-id: 875890d1479f8abab4c4a19d934fe9807d12dfd2