Storing requires shifting and bitwise OR:
Here, C is the result of a 6 and a 5-bit field.
A 31
B 15
C | A LSH B 6
Extracting the fields requires shifting and AND.
A & C 63
B RSH C 6
Here, 63 is a mask to isolate the first 6 bits (63 = 0b111111).
More fields will require more careful usage. A field in the “middle” will require a shift as well as a masking AND.
As the numbers are signed, I would simply avoid using the most significant bit at all if you are counting on doing math with the numbers. Poking the top bit will screw with the results of your RSH. It won’t be a problem if you always AND mask the top field when extracting, though, I think.
Also, don’t try to store negative numbers this way.