Skip to content
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

Draft Extension: Zicfiss and Zicfilp #121

Open
wants to merge 2 commits into
base: riscv-zimop-zcmop
Choose a base branch
from

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-zicfiss-zicfilp branch from 65e049d to af3c200 Compare August 7, 2023 01:23
@a4lg a4lg force-pushed the riscv-zimop-zcmop branch from 0220db5 to b1a75ea Compare August 7, 2023 02:55
@a4lg a4lg force-pushed the riscv-zicfiss-zicfilp branch from af3c200 to 73b34d9 Compare August 7, 2023 02:55
@a4lg a4lg force-pushed the riscv-zimop-zcmop branch from b1a75ea to c32ce68 Compare August 8, 2023 03:19
@a4lg a4lg force-pushed the riscv-zicfiss-zicfilp branch 4 times, most recently from 6fad8da to 9f59642 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-zicfiss-zicfilp branch from 9f59642 to 95fd54a 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-zicfiss-zicfilp branch from 95fd54a to b3a0d70 Compare August 15, 2023 07:27
@a4lg a4lg force-pushed the riscv-zicfiss-zicfilp branch from b3a0d70 to cd1f349 Compare September 3, 2023 02:26
@a4lg a4lg force-pushed the riscv-zimop-zcmop branch from 5523e8b to 7251358 Compare September 3, 2023 02:42
@a4lg a4lg force-pushed the riscv-zicfiss-zicfilp branch from cd1f349 to 5d9fede Compare September 3, 2023 02:42
@a4lg a4lg force-pushed the riscv-zimop-zcmop branch from 7251358 to e2c33c4 Compare September 5, 2023 07:58
@a4lg a4lg force-pushed the riscv-zicfiss-zicfilp branch 2 times, most recently from 185fdfe to d340ddd Compare September 7, 2023 09:35
@a4lg a4lg force-pushed the riscv-zicfiss-zicfilp branch 2 times, most recently from d0de7a2 to 84f5443 Compare October 19, 2023 03:17
a4lg added 2 commits October 19, 2023 06:58
[DO NOT MERGE]
Until the 'Zicfiss' extension is frozen/ratified and final version number
is determined, this patch should not be merged upstream. This commit uses
unratified version 0.3 as in the documentation (instead of possible 1.0
after ratification).

This commit adds RISC-V Shadow Stack extension (Zicfiss) and its
CSRs based on the document version 0.3 (latest git revision):
<riscv/riscv-cfi@d21de9e>

bfd/ChangeLog:

	* elfxx-riscv.c (riscv_implicit_subsets): Add implication 'Zicfiss'
	-> 'Zicsr', 'Zimop' and 'Zcmop'.
	(riscv_supported_std_z_ext): Add 'Zicfiss' extension to valid
	'Z' extension list.
	(riscv_multi_subset_supports): Support new instruction class.
	(riscv_multi_subset_supports_ext): Likewise.

gas/ChangeLog:

	* config/tc-riscv.c (enum riscv_csr_class): Add new CSR class.
	(riscv_csr_address): Add new CSR class handling.
	* testsuite/gas/riscv/csr.s: Add new CSR test.
	* testsuite/gas/riscv/csr-dw-regnums.s: Likewise.
	* testsuite/gas/riscv/csr-dw-regnums.d: Likewise.
	* testsuite/gas/riscv/csr-version-1p10.d: Likewise.
	* testsuite/gas/riscv/csr-version-1p10.l: Likewise.
	* testsuite/gas/riscv/csr-version-1p11.d: Likewise.
	* testsuite/gas/riscv/csr-version-1p11.l: Likewise.
	* testsuite/gas/riscv/csr-version-1p12.d: Likewise.
	* testsuite/gas/riscv/csr-version-1p12.l: Likewise.
	* testsuite/gas/riscv/csr-version-1p9p1.d: Likewise.
	* testsuite/gas/riscv/csr-version-1p9p1.l: Likewise.
	* testsuite/gas/riscv/zicfiss.s: New test for shadow stack
	instructions and its auto-compression.
	* testsuite/gas/riscv/zicfiss.d: Likewise.
	* testsuite/gas/riscv/zicfiss-32.s: New test for RV32-only insn.
	* testsuite/gas/riscv/zicfiss-32.d: Likewise.
	* testsuite/gas/riscv/zicfiss-64.s: New test for RV64-only insn.
	* testsuite/gas/riscv/zicfiss-64.d: Likewise.
	* testsuite/gas/riscv/zicfiss-na.d: Likewise.
	* testsuite/gas/riscv/zicfiss-mop.s: New test for MOP encoding.
	* testsuite/gas/riscv/zicfiss-mop-32.d: Likewise.  Result on RV32.
	* testsuite/gas/riscv/zicfiss-mop-64.d: Likewise.  Result on RV64.
	* testsuite/gas/riscv/zicfiss-fail.s: New failure test for
	shadow stack instructions.
	* testsuite/gas/riscv/zicfiss-fail.d: Likewise.
	* testsuite/gas/riscv/zicfiss-fail.l: Likewise.
	* testsuite/gas/riscv/zicfiss-fail-64.s: New failure test for
	shadow stack instructions.  RV64 only.
	* testsuite/gas/riscv/zicfiss-fail-64.d: Likewise.
	* testsuite/gas/riscv/zicfiss-fail-64.l: Likewise.

include/ChangeLog:

	* opcode/riscv-opc.h (MATCH_SSPUSH, MASK_SSPUSH, MATCH_SSPOPCHK,
	MASK_SSPOPCHK, MATCH_SSLW, MASK_SSLW, MATCH_SSLD, MASK_SSLD,
	MATCH_SSINCP, MASK_SSINCP, MATCH_SSRDP, MASK_SSRDP, MATCH_C_SSPUSH,
	MASK_C_SSPUSH, MATCH_C_SSPOPCHK, MASK_C_SSPOPCHK, MATCH_C_SSINCP,
	MASK_C_SSINCP): New.
	(CSR_SSP): New.
	* opcode/riscv.h (enum riscv_insn_class): Add new instruction
	class INSN_CLASS_ZICFISS.

opcodes/ChangeLog:

	* riscv-opc.c (match_rd_eq_1_or_5, match_rs1_eq_1_or_5,
	match_rs2_eq_1_or_5): New.
	(riscv_opcodes): Add 'Zicfiss' instructions and aliases.
[DO NOT MERGE]
Until the 'Zicfilp' extension is frozen/ratified and final version number
is determined, this patch should not be merged upstream. This commit uses
unratified version 0.3 as in the documentation (instead of possible 1.0
after ratification).

This commit adds RISC-V Landing Pads extension (Zicfilp) based on
the document version 0.3 (latest git revision):
<riscv/riscv-cfi@d21de9e>

**Important Note**

The "lpad" instruction requires 4-byte alignment to complete without
exceptions but this is not currently enforced by the assembler.

bfd/ChangeLog:

	* elfxx-riscv.c (riscv_supported_std_z_ext): Add 'Zicfilp' extension
	to valid 'Z' extension list.
	(riscv_multi_subset_supports): Support new instruction class.
	(riscv_multi_subset_supports_ext): Likewise.

gas/ChangeLog:

	* testsuite/gas/riscv/zicfilp.s: New test.
	* testsuite/gas/riscv/zicfilp.d: Likewise.

include/ChangeLog:

	* opcode/riscv-opc.h (MATCH_LPAD, MASK_LPAD): New.
	* opcode/riscv.h (enum riscv_insn_class): Add new instruction
	class INSN_CLASS_ZICFILP.

opcodes/ChangeLog:

	* riscv-opc.c (riscv_opcodes): Although not strictly a hint, add
	"lpad" to the list of standard hints because of its encoding.
@a4lg a4lg force-pushed the riscv-zimop-zcmop branch from 23722f7 to 463ca11 Compare October 19, 2023 07:01
@a4lg a4lg force-pushed the riscv-zicfiss-zicfilp branch from 84f5443 to 02c7f21 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