Skip to content

Conversation

a4lg
Copy link
Owner

@a4lg a4lg commented Aug 6, 2023

@a4lg a4lg added the enhancement New feature or request label Aug 6, 2023
@a4lg a4lg force-pushed the riscv-zimop-zcmop branch 6 times, most recently from 295f459 to 99bf60a Compare August 11, 2023 03:56
@a4lg a4lg force-pushed the riscv-zimop-zcmop branch from 99bf60a to ec3eb78 Compare August 15, 2023 06:37
@a4lg a4lg force-pushed the riscv-zimop-zcmop branch from ec3eb78 to fb14b6b Compare August 15, 2023 07:27
@a4lg a4lg force-pushed the riscv-zimop-zcmop branch 4 times, most recently from e2c33c4 to 8275deb Compare September 7, 2023 09:35
@a4lg a4lg force-pushed the riscv-zimop-zcmop branch 2 times, most recently from 931838e to 23722f7 Compare October 19, 2023 03:17
a4lg added 2 commits October 19, 2023 06:58
[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.
@a4lg a4lg force-pushed the riscv-zimop-zcmop branch from 23722f7 to 463ca11 Compare October 19, 2023 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant