The immr and imms values are decoded to get an immediate value. Is there a way to encode from immediate value to immr and imms field for ARMv8 ?
Instruction
Routine.
The DecodeBitMasks routine is not very clear. Any help is appreciated.
Hi
In lj_emit_arm64.h, there is a stub for the function emit_isk13() which, when implemented, will return the 13 bits representing N:immr:imms if the constant can be encoded using this scheme, or -1 otherwise. Are you working on implementing this function?
To understand how DecodeBitMasks works, I suggest creating some encodings, and disassembling them to see which values are displayed. You can do that as follows:
Here, you can see that when N, immr and imms are all zero, the resulting constant has the value of 1. With some experimentation, the explanation in the ARM v8 architecture manual should become clear.