Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • D dynamorio
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,467
    • Issues 1,467
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 44
    • Merge requests 44
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • DynamoRIO
  • dynamorio
  • Merge requests
  • !5666

i#3544 riscv64, part 1: add instruction codec

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge i3544-riscv64-p1-add-instr-codec into master Sep 30, 2022
  • Overview 66
  • Commits 9
  • Pipelines 0
  • Changes 3

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:

  1. 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.
  2. 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 [email protected]

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: i3544-riscv64-p1-add-instr-codec