-
Notifications
You must be signed in to change notification settings - Fork 2
Draft Extension: Zimop
and Zcmop
#120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
a4lg
wants to merge
2
commits into
master
Choose a base branch
from
riscv-zimop-zcmop
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
295f459
to
99bf60a
Compare
99bf60a
to
ec3eb78
Compare
ec3eb78
to
fb14b6b
Compare
e2c33c4
to
8275deb
Compare
931838e
to
23722f7
Compare
[DO NOT MERGE] Until the 'Zimop' extension is frozen/ratified and final version number is determined, this patch should not be merged upstream. This commit uses version 0.1 as a placeholder. This commit adds support for "May Be Operations (MOP)" (Zimop) extension which adds 32 2-operand MOP instructions and 8 3-operand MOP instructions. By default, they are practically the same as "li rd, 0". However, if certain feature is supported (and optionally enabled), it is allowed to alter architectural state unlike HINT instructions. This commit is based on the TENTATIVE specification: <riscv/riscv-cfi#131> bfd/ChangeLog: * elfxx-riscv.c (riscv_supported_std_z_ext): Add 'Zimop'. (riscv_multi_subset_supports): Support new instruction class. (riscv_multi_subset_supports_ext): Likewise. gas/ChangeLog: * testsuite/gas/riscv/zimop.s: New test for 'Zimop'. * testsuite/gas/riscv/zimop.d: Likewise. * testsuite/gas/riscv/zimop-noarch.d: New test for architecture failure. * testsuite/gas/riscv/zimop-noarch.l: Likewise. include/ChangeLog: * opcode/riscv-opc.h (MATCH_MOP_R_0, MASK_MOP_R_0, MATCH_MOP_R_1, MASK_MOP_R_1, MATCH_MOP_R_2, MASK_MOP_R_2, MATCH_MOP_R_3, MASK_MOP_R_3, MATCH_MOP_R_4, MASK_MOP_R_4, MATCH_MOP_R_5, MASK_MOP_R_5, MATCH_MOP_R_6, MASK_MOP_R_6, MATCH_MOP_R_7, MASK_MOP_R_7, MATCH_MOP_R_8, MASK_MOP_R_8, MATCH_MOP_R_9, MASK_MOP_R_9, MATCH_MOP_R_10, MASK_MOP_R_10, MATCH_MOP_R_11, MASK_MOP_R_11, MATCH_MOP_R_12, MASK_MOP_R_12, MATCH_MOP_R_13, MASK_MOP_R_13, MATCH_MOP_R_14, MASK_MOP_R_14, MATCH_MOP_R_15, MASK_MOP_R_15, MATCH_MOP_R_16, MASK_MOP_R_16, MATCH_MOP_R_17, MASK_MOP_R_17, MATCH_MOP_R_18, MASK_MOP_R_18, MATCH_MOP_R_19, MASK_MOP_R_19, MATCH_MOP_R_20, MASK_MOP_R_20, MATCH_MOP_R_21, MASK_MOP_R_21, MATCH_MOP_R_22, MASK_MOP_R_22, MATCH_MOP_R_23, MASK_MOP_R_23, MATCH_MOP_R_24, MASK_MOP_R_24, MATCH_MOP_R_25, MASK_MOP_R_25, MATCH_MOP_R_26, MASK_MOP_R_26, MATCH_MOP_R_27, MASK_MOP_R_27, MATCH_MOP_R_28, MASK_MOP_R_28, MATCH_MOP_R_29, MASK_MOP_R_29, MATCH_MOP_R_30, MASK_MOP_R_30, MATCH_MOP_R_31, MASK_MOP_R_31, MATCH_MOP_RR_0, MASK_MOP_RR_0, MATCH_MOP_RR_1, MASK_MOP_RR_1, MATCH_MOP_RR_2, MASK_MOP_RR_2, MATCH_MOP_RR_3, MASK_MOP_RR_3, MATCH_MOP_RR_4, MASK_MOP_RR_4, MATCH_MOP_RR_5, MASK_MOP_RR_5, MATCH_MOP_RR_6, MASK_MOP_RR_6, MATCH_MOP_RR_7, MASK_MOP_RR_7): New. * opcode/riscv.h (enum riscv_insn_class): Add new instruction class INSN_CLASS_ZIMOP. opcodes/ChangeLog: * riscv-opc.c (riscv_opcodes): Add new "may be" operations from the 'Zimop' extension near the bottom.
[DO NOT MERGE] Until the 'Zcmop' extension is frozen/ratified and final version number is determined, this patch should not be merged upstream. This commit uses version 0.1 as a placeholder. This commit adds support for the compressed "May Be Operations (MOP)" (Zcmop) extension which adds 8 compressed MOP instructions. By default, they are the same as NOP. However, if certain feature is supported (and optionally enabled), it is allowed to alter architectural state unlike HINT instructions. This commit is based on the TENTATIVE specification: <riscv/riscv-cfi#131> bfd/ChangeLog: * elfxx-riscv.c (riscv_implicit_subsets): Add 'Zcmop' -> 'Zca' implication. (riscv_supported_std_z_ext): Add 'Zcmop'. (riscv_multi_subset_supports): Support new instruction class. (riscv_multi_subset_supports_ext): Likewise. gas/ChangeLog: * testsuite/gas/riscv/zcmop.s: New test for 'Zcmop'. * testsuite/gas/riscv/zcmop.d: Likewise. include/ChangeLog: * opcode/riscv-opc.h ( MATCH_C_MOP_0, MASK_C_MOP_0, MATCH_C_MOP_1, MASK_C_MOP_1, MATCH_C_MOP_2, MASK_C_MOP_2, MATCH_C_MOP_3, MASK_C_MOP_3, MATCH_C_MOP_4, MASK_C_MOP_4, MATCH_C_MOP_5, MASK_C_MOP_5, MATCH_C_MOP_6, MASK_C_MOP_6, MATCH_C_MOP_7, MASK_C_MOP_7): New. * opcode/riscv.h (enum riscv_insn_class): Add new instruction class INSN_CLASS_ZCMOP. opcodes/ChangeLog: * riscv-opc.c (riscv_opcodes): Add new "may be" operations from the 'Zcmop' extension near the bottom.
23722f7
to
463ca11
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Wiki Page (details): https://github.com/a4lg/binutils-gdb/wiki/riscv_zimop_zcmop