I'm trying to write a shader that uses many bit operations. In fact they are supported since glsl 1.30, but I'm only on OpenGL 2.1.
Is there any way to use bit operations with my OpenGL version?
All SM3 compatible (~OpenGL 2.1) hardware supports limited integer functionality. This is usually done by emulating integers with floats and does not include bit operations.
For bit operations, you need either GLSL 1.3 or EXT_gpu_shader4.
If the reason that you have only OpenGL 2.1 is that your driver is somewhat outdated, you may be lucky to still have EXT_gpu_shader4 (updating drivers might be a good idea though, in that case).
If the reason is that your graphics card simply does not support anything better, you are out of luck.
If you do have EXT_gpu_shader4 (check extension string), you can add:
#extension EXT_gpu_shader4 : require
to your GLSL 1.2 shaders, and it should work.