RISC-V: Record implicit subsets in a table, to avoid repeated codes.
authorNelson Chu <nelson.chu@sifive.com>
Thu, 13 May 2021 03:48:26 +0000 (11:48 +0800)
committerNelson Chu <nelson.chu@sifive.com>
Thu, 13 May 2021 07:21:38 +0000 (15:21 +0800)
commit7671eff8f08de314d8c9837225eba95ed5ea053b
tree4bfdac07f53e9d347866344421f5a85c2e7d8e6e
parentcf893b0ef7482ec11df3787772f35e820ef2592a
RISC-V: Record implicit subsets in a table, to avoid repeated codes.

Add a new table, riscv_implicit_subsets, to record all implicit information.
So that we add all implicit subsets according to the table, to avoid too
many repeated codes in the riscv_parse_add_implicit_subsets.  Besides, the
check_func is used to check whether we should add this implicit subset.
For example, check_implicit_for_i checks the version of i, and we only add
zicsr and zifencei implicitly only when the version less than 2.1.

bfd/
    * elfxx-riscv.c (check_implicit_always): The check_func, always add
    the implicit subset without checking.
    (check_implicit_for_i): The check_func for i, only add zicsr and
    zifencei when the version of i less than 2.1.
    (struct riscv_implicit_subset): Record the subsets and their
    corresponding implicit subsets.
    (riscv_implicit_subsets): Table records all implicit informations.
    (riscv_parse_add_implicit_subsets): Updated and add implicit subsets
    according to riscv_implicit_subsets.  Remove the redundant codes.
bfd/ChangeLog
bfd/elfxx-riscv.c
This page took 0.025574 seconds and 4 git commands to generate.