RISC-V: Zicbo{m,p,z} adjustments to riscv_multi_subset_supports_ext()

Message ID ffa9c1d7-e8c2-a62b-ef3e-b565c0ffbe5b@suse.com
State Accepted, archived
Headers
Series RISC-V: Zicbo{m,p,z} adjustments to riscv_multi_subset_supports_ext() |

Checks

Context Check Description
snail/binutils-gdb-check success Github commit url

Commit Message

Jan Beulich Oct. 4, 2022, 1:56 p.m. UTC
  The lack thereof did caused gas to issue "internal: unreachable
INSN_CLASS_*" errors when trying to assemble respective insns without
the feature(s) enabled via e.g. ".option arch, ...". Of course a proper
hint towards the missing extension then wasn't given either.
  

Comments

Tsukasa OI Oct. 4, 2022, 4:08 p.m. UTC | #1
On 2022/10/04 22:56, Jan Beulich via Binutils wrote:
> The lack thereof did caused gas to issue "internal: unreachable
> INSN_CLASS_*" errors when trying to assemble respective insns without
> the feature(s) enabled via e.g. ".option arch, ...". Of course a proper
> hint towards the missing extension then wasn't given either.
> 
> --- a/bfd/elfxx-riscv.c
> +++ b/bfd/elfxx-riscv.c
> @@ -2440,6 +2440,12 @@ riscv_multi_subset_supports_ext (riscv_p
>      {
>      case INSN_CLASS_I:
>        return "i";
> +    case INSN_CLASS_ZICBOM:
> +      return "zicbom";
> +    case INSN_CLASS_ZICBOP:
> +      return "zicbop";
> +    case INSN_CLASS_ZICBOZ:
> +      return "zicboz";
>      case INSN_CLASS_ZICSR:
>        return "zicsr";
>      case INSN_CLASS_ZIFENCEI:
> 

LGTM.

Thanks!
Tsukasa
  
Tsukasa OI Oct. 6, 2022, 4:50 a.m. UTC | #2
On 2022/10/04 22:56, Jan Beulich via Binutils wrote:
> The lack thereof did caused gas to issue "internal: unreachable
> INSN_CLASS_*" errors when trying to assemble respective insns without
> the feature(s) enabled via e.g. ".option arch, ...". Of course a proper
> hint towards the missing extension then wasn't given either.
> 
> --- a/bfd/elfxx-riscv.c
> +++ b/bfd/elfxx-riscv.c
> @@ -2440,6 +2440,12 @@ riscv_multi_subset_supports_ext (riscv_p
>      {
>      case INSN_CLASS_I:
>        return "i";
> +    case INSN_CLASS_ZICBOM:
> +      return "zicbom";
> +    case INSN_CLASS_ZICBOP:
> +      return "zicbop";
> +    case INSN_CLASS_ZICBOZ:
> +      return "zicboz";

I confirmed that those three are the last ones to be added to this
function.  Thanks!

>      case INSN_CLASS_ZICSR:
>        return "zicsr";
>      case INSN_CLASS_ZIFENCEI:
>
  
Nelson Chu Oct. 14, 2022, 1:19 a.m. UTC | #3
Looks reasonable, please commit, thanks.

Nelson

On Tue, Oct 4, 2022 at 9:56 PM Jan Beulich <jbeulich@suse.com> wrote:
>
> The lack thereof did caused gas to issue "internal: unreachable
> INSN_CLASS_*" errors when trying to assemble respective insns without
> the feature(s) enabled via e.g. ".option arch, ...". Of course a proper
> hint towards the missing extension then wasn't given either.
>
> --- a/bfd/elfxx-riscv.c
> +++ b/bfd/elfxx-riscv.c
> @@ -2440,6 +2440,12 @@ riscv_multi_subset_supports_ext (riscv_p
>      {
>      case INSN_CLASS_I:
>        return "i";
> +    case INSN_CLASS_ZICBOM:
> +      return "zicbom";
> +    case INSN_CLASS_ZICBOP:
> +      return "zicbop";
> +    case INSN_CLASS_ZICBOZ:
> +      return "zicboz";
>      case INSN_CLASS_ZICSR:
>        return "zicsr";
>      case INSN_CLASS_ZIFENCEI:
  

Patch

--- a/bfd/elfxx-riscv.c
+++ b/bfd/elfxx-riscv.c
@@ -2440,6 +2440,12 @@  riscv_multi_subset_supports_ext (riscv_p
     {
     case INSN_CLASS_I:
       return "i";
+    case INSN_CLASS_ZICBOM:
+      return "zicbom";
+    case INSN_CLASS_ZICBOP:
+      return "zicbop";
+    case INSN_CLASS_ZICBOZ:
+      return "zicboz";
     case INSN_CLASS_ZICSR:
       return "zicsr";
     case INSN_CLASS_ZIFENCEI: