From: Jiawei Date: Fri, 9 May 2025 02:55:25 +0000 (+0800) Subject: RISC-V: Add augmented hypervisor extension 'sha' support. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0b0e00271c2c2c90446827207288b3f67e9d3602;p=thirdparty%2Fbinutils-gdb.git RISC-V: Add augmented hypervisor extension 'sha' support. The augmented hypervisor extension 'sha'[1] is a new profile-defined extension that captures the full set of features that are mandated to be supported along with the H extension. https://github.com/riscv/riscv-profiles/blob/main/src/rva23-profile.adoc#rva23s64-profile bfd/ChangeLog: * elfxx-riscv.c: New extension and implies. gas/ChangeLog: * NEWS: New extension. * testsuite/gas/riscv/imply.d: New test for sha. * testsuite/gas/riscv/imply.s: Ditto. * testsuite/gas/riscv/march-help.l: New extension. --- diff --git a/bfd/elfxx-riscv.c b/bfd/elfxx-riscv.c index 5cb2500a35a..83e237c2a03 100644 --- a/bfd/elfxx-riscv.c +++ b/bfd/elfxx-riscv.c @@ -1223,6 +1223,8 @@ static struct riscv_implicit_subset riscv_implicit_subsets[] = {"zicfilp", "+zicsr", check_implicit_always}, {"zicfiss", "+zimop,+zicsr", check_implicit_always}, + {"sha", "+h,+ssstateen,+shcounterenw,+shvstvala,+shtvala,+shvstvecd,+shvsatpa,+shgatpa", check_implicit_always}, + {"shcounterenw", "+h", check_implicit_always}, {"shgatpa", "+h", check_implicit_always}, {"shtvala", "+h", check_implicit_always}, @@ -1447,6 +1449,7 @@ static struct riscv_supported_ext riscv_supported_std_z_ext[] = static struct riscv_supported_ext riscv_supported_std_s_ext[] = { + {"sha", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 }, {"shcounterenw", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 }, {"shgatpa", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 }, {"shtvala", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 }, diff --git a/gas/NEWS b/gas/NEWS index af0c37c480a..9d845a8bdca 100644 --- a/gas/NEWS +++ b/gas/NEWS @@ -11,7 +11,8 @@ * Add support for RISC-V privileged version 1.13. * Add support for RISC-V standard extensions: - ssqosid v1.0, ssnpm v1.0, smnpm v1.0, smmpm v1.0, sspm v1.0, supm v1.0. + ssqosid v1.0, ssnpm v1.0, smnpm v1.0, smmpm v1.0, sspm v1.0, supm v1.0, + sha v1.0. * Add support for RISC-V vendor extensions: T-Head: xtheadvdot v1.0. diff --git a/gas/testsuite/gas/riscv/imply.d b/gas/testsuite/gas/riscv/imply.d index 78ff200e810..bce97ddf471 100644 --- a/gas/testsuite/gas/riscv/imply.d +++ b/gas/testsuite/gas/riscv/imply.d @@ -51,6 +51,7 @@ SYMBOL TABLE: [0-9a-f]+ l .text 0+000 \$xrv32i2p1_zicsr2p0_zca1p0_zcmt1p0 [0-9a-f]+ l .text 0+000 \$xrv32i2p1_zicfilp1p0_zicsr2p0 [0-9a-f]+ l .text 0+000 \$xrv32i2p1_zicfiss1p0_zicsr2p0_zimop1p0 +[0-9a-f]+ l .text 0+000 \$xrv32i2p1_h1p0_zicsr2p0_sha1p0_shcounterenw1p0_shgatpa1p0_shtvala1p0_shvsatpa1p0_shvstvala1p0_shvstvecd1p0_ssstateen1p0 [0-9a-f]+ l .text 0+000 \$xrv32i2p1_h1p0_zicsr2p0_shcounterenw1p0 [0-9a-f]+ l .text 0+000 \$xrv32i2p1_h1p0_zicsr2p0_shgatpa1p0 [0-9a-f]+ l .text 0+000 \$xrv32i2p1_h1p0_zicsr2p0_shtvala1p0 diff --git a/gas/testsuite/gas/riscv/imply.s b/gas/testsuite/gas/riscv/imply.s index d696b52655a..c047ed6b758 100644 --- a/gas/testsuite/gas/riscv/imply.s +++ b/gas/testsuite/gas/riscv/imply.s @@ -57,6 +57,8 @@ imply zcmt imply zicfilp imply zicfiss +imply sha + imply shcounterenw imply shgatpa imply shtvala diff --git a/gas/testsuite/gas/riscv/march-help.l b/gas/testsuite/gas/riscv/march-help.l index e71795663f5..bcc3a8f1fbd 100644 --- a/gas/testsuite/gas/riscv/march-help.l +++ b/gas/testsuite/gas/riscv/march-help.l @@ -107,6 +107,7 @@ All available -march extensions for RISC-V: zcmop 1.0 zcmp 1.0 zcmt 1.0 + sha 1.0 shcounterenw 1.0 shgatpa 1.0 shtvala 1.0