This PR adds a function that encodes an immediate value into an integer packing various opcode fields when possible, and returns 0 otherwise.
The lowest 6 bits encode the rotation (immr), the next 6 encode the size/pattern (imms), the next bit encodes the N bit and the next one (0x2000) encodes whether the immediate given is encodable (1) or not (0).
This PR adds a function that encodes an immediate value into an integer packing various opcode fields when possible, and returns
0
otherwise. The lowest 6 bits encode the rotation (immr
), the next 6 encode the size/pattern (imms
), the next bit encodes theN
bit and the next one (0x2000
) encodes whether the immediate given is encodable (1
) or not (0
).