Created by: semihalf-kardach-stanislaw
Add the main source file for instruction codec whose goal is to decode and encode all RISC-V instructions. At the moment only the decoding part is implemented.
The decoding process is based on instr_info_t structures and is separated into two stages:
- Instruction opcode decoding to retrieve a corresponding rv_instr_info_t. This gives the codec information on the number and type of source and destination operands.
- Instruction operand decoding. All operands are decoded utilizing the data from instr_info_t and a set of operand decoder functions gathered in the opnd_decoders array indexed by the operand field type.
Note: The codec.c file is not yet added to the build system as it relies on a set of generated files with opcode and instr_info_t data. The script for that as well as Instruction Set Listing files will follow in later commits.
Note 2: There is currently no support for decoding of translated instructions and hence orig_pc is never used. In fact all base+disp operands utilize opnd_create_mem_instr() which is described as a PC-relative memory reference, so it "should" be resistant to the change in base address.
Issue #3544
Signed-off-by: Stanislaw Kardach kda@semihalf.com