Using bitwise operations is blazing fast for the VM. Here is how you can encode and use information: First you have to determine the number of operations that you need to encode to know how many bits you need, based on 2^n, where n is the number of bits, and 2^n the number of operations that you can encode.
For example if I have 5 operations, I need 3 bits (2^2 = 4 operations, and 2^3 = 8 operations). Then you can encode the operations in an enum. Each operation will have a different number, and you need to shift each operation by 32 bits - n (for 5 operations and 3 bits, we will shift by 32-3=29).