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

QUICK fix on Li's Zhinx implementation #9

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 26 additions & 6 deletions bfd/elfxx-riscv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1190,7 +1190,6 @@ static struct riscv_supported_ext riscv_supported_std_z_ext[] =
{"zfinx", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
{"zdinx", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
{"zqinx", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
{"zhinx", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
{"zbb", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
{"zba", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
{"zbc", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
Expand Down Expand Up @@ -1226,6 +1225,7 @@ static struct riscv_supported_ext riscv_supported_std_z_ext[] =
{"zvl16384b", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
{"zvl32768b", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
{"zvl65536b", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
{"zhinx", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
{NULL, 0, 0, 0, 0}
};

Expand Down Expand Up @@ -2340,15 +2340,17 @@ riscv_multi_subset_supports (riscv_parse_subset_t *rps,
return riscv_subset_supports (rps, "zfh");
case INSN_CLASS_ZFH_OR_ZHINX:
return riscv_subset_supports (rps, "zfh")
|| riscv_subset_supports (rps, "zhinx");
|| riscv_subset_supports (rps, "zhinx");
case INSN_CLASS_D_AND_ZFH_INX:
return (riscv_subset_supports (rps, "d")
&& riscv_subset_supports (rps, "zfh"))
|| riscv_subset_supports (rps, "zhinx");
|| (riscv_subset_supports (rps, "zdinx")
&& riscv_subset_supports (rps, "zhinx"));
case INSN_CLASS_Q_AND_ZFH_INX:
return (riscv_subset_supports (rps, "q")
&& riscv_subset_supports (rps, "zfh"))
|| riscv_subset_supports (rps, "zhinx");
|| (riscv_subset_supports (rps, "zqinx")
&& riscv_subset_supports (rps, "zhinx"));
case INSN_CLASS_ZBA:
return riscv_subset_supports (rps, "zba");
case INSN_CLASS_ZBB:
Expand Down Expand Up @@ -2495,9 +2497,27 @@ riscv_multi_subset_supports_ext (riscv_parse_subset_t *rps,
case INSN_CLASS_ZFH_OR_ZHINX:
return _("zfh' or 'zhinx");
case INSN_CLASS_D_AND_ZFH_INX:
return _("('d' and 'zfh') or 'zhinx");
if (riscv_subset_supports (rps, "zfh"))
return "d";
else if (riscv_subset_supports (rps, "d"))
return "zfh";
else if (riscv_subset_supports (rps, "zhinx"))
return "zdinx";
else if (riscv_subset_supports (rps, "zdinx"))
return "zhinx";
else
return _("zfh' and `d', or `zhinx' and `zdinx");
case INSN_CLASS_Q_AND_ZFH_INX:
return _("('q' and 'zfh') or 'zhinx");
if (riscv_subset_supports (rps, "zfh"))
return "q";
else if (riscv_subset_supports (rps, "q"))
return "zfh";
else if (riscv_subset_supports (rps, "zhinx"))
return "zqinx";
else if (riscv_subset_supports (rps, "zqinx"))
return "zhinx";
else
return _("zfh' and `q', or `zhinx' and `zqinx");
case INSN_CLASS_H:
return _("h");
default:
Expand Down
2 changes: 1 addition & 1 deletion gas/testsuite/gas/riscv/fp-zhinx-insns.d
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#as: -march=rv64ima_zhinx
#as: -march=rv64ima_zqinx_zhinx
#source: fp-zhinx-insns.s
#objdump: -dr

Expand Down