Skip to content

Commit

Permalink
UNRATIFIED RISC-V: Add 'Zfa' extension
Browse files Browse the repository at this point in the history
[DO NOT MERGE]
Until 'Zfa' extension is frozen/ratified and final version number is
determined, this patch should not merged upstream. This commit uses
unratified version 0.1 as in documentation (instead of possible 1.0
after ratification).

This commit adds the 'Zfa' extension (its instructions and new operand
type for FLI instructions).

This is based on:
<riscv/riscv-isa-manual@044fbbf>
(latest commit of the 'master' branch as of this writing)

Note: the author is calling FLI instructions' RS1 encoded field as
"value".  It must be reviewed before the specification is frozen.

bfd/ChangeLog:

	* elfxx-riscv.c (riscv_multi_subset_supports): Add instruction
	class support for 'Zfa' extension.
	(riscv_multi_subset_supports_ext): Likewise.
	(riscv_implicit_subsets): Add 'Zfa' -> 'F' dependency.

gas/ChangeLog:

	* testsuite/gas/riscv/zfa.s: New test.
	* testsuite/gas/riscv/zfa.d: Likewise.
	* testsuite/gas/riscv/zfa-32.s: New test.
	* testsuite/gas/riscv/zfa-32.d: Likewise.
	* testsuite/gas/riscv/zfa-64.s: New test.
	* testsuite/gas/riscv/zfa-64.d: Likewise.
	* testsuite/gas/riscv/zfa-fail-fcvtmod.w.d.s: New failure test for
	the "fcvtmod.w.d" instruction.
	* testsuite/gas/riscv/zfa-fail-fcvtmod.w.d.d: Likewise.
	* testsuite/gas/riscv/zfa-fail-fcvtmod.w.d.l: Likewise.
	* testsuite/gas/riscv/zfa-fail-fli.s: New failure test for "fli"
	instructions.
	* testsuite/gas/riscv/zfa-fail-fli.d: Likewise.
	* testsuite/gas/riscv/zfa-fail-fli.l: Likewise.

include/ChangeLog:

	* opcode/riscv-opc.h (MATCH_FLI_H, MASK_FLI_H, MATCH_FMINI_H,
	MASK_FMINI_H, MATCH_FMAXI_H, MASK_FMAXI_H, MATCH_FROUND_H,
	MASK_FROUND_H, MATCH_FROUNDNX_H, MASK_FROUNDNX_H, MATCH_FLTQ_H,
	MASK_FLTQ_H, MATCH_FLEQ_H, MASK_FLEQ_H, MATCH_FLI_S, MASK_FLI_S,
	MATCH_FMINI_S, MASK_FMINI_S, MATCH_FMAXI_S, MASK_FMAXI_S,
	MATCH_FROUND_S, MASK_FROUND_S, MATCH_FROUNDNX_S, MASK_FROUNDNX_S,
	MATCH_FLTQ_S, MASK_FLTQ_S, MATCH_FLEQ_S, MASK_FLEQ_S, MATCH_FLI_D,
	MASK_FLI_D, MATCH_FMINI_D, MASK_FMINI_D, MATCH_FMAXI_D,
	MASK_FMAXI_D, MATCH_FROUND_D, MASK_FROUND_D, MATCH_FROUNDNX_D,
	MASK_FROUNDNX_D, MATCH_FLTQ_D, MASK_FLTQ_D, MATCH_FLEQ_D,
	MASK_FLEQ_D, MATCH_FLI_Q, MASK_FLI_Q, MATCH_FMINI_Q, MASK_FMINI_Q,
	MATCH_FMAXI_Q, MASK_FMAXI_Q, MATCH_FROUND_Q, MASK_FROUND_Q,
	MATCH_FROUNDNX_Q, MASK_FROUNDNX_Q, MATCH_FLTQ_Q, MASK_FLTQ_Q,
	MATCH_FLEQ_Q, MASK_FLEQ_Q, MATCH_FCVTMOD_W_D, MASK_FCVTMOD_W_D,
	MATCH_FMVH_X_D, MASK_FMVH_X_D, MATCH_FMVH_X_Q, MASK_FMVH_X_Q,
	MATCH_FMVP_D_X, MASK_FMVP_D_X, MATCH_FMVP_Q_X,
	MASK_FMVP_Q_X): New.
	* opcode/riscv.h (enum riscv_insn_class): Add instruction
	classes for 'Zfa' extension.

opcodes/ChangeLog:

	* riscv-opc.c (riscv_opcodes): Add 'Zfa' instructions.
  • Loading branch information
a4lg committed Sep 25, 2022
1 parent 58d6920 commit 0ee3d70
Show file tree
Hide file tree
Showing 18 changed files with 502 additions and 1 deletion.
39 changes: 39 additions & 0 deletions bfd/elfxx-riscv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1073,6 +1073,7 @@ static struct riscv_implicit_subset riscv_implicit_subsets[] =
{"zvl256b", "zvl128b", check_implicit_always},
{"zvl128b", "zvl64b", check_implicit_always},
{"zvl64b", "zvl32b", check_implicit_always},
{"zfa", "f", check_implicit_always},
{"d", "f", check_implicit_always},
{"zfh", "zfhmin", check_implicit_always},
{"zfhmin", "f", check_implicit_always},
Expand Down Expand Up @@ -1163,6 +1164,7 @@ static struct riscv_supported_ext riscv_supported_std_z_ext[] =
{"zihintpause", ISA_SPEC_CLASS_DRAFT, 2, 0, 0 },
{"zmmul", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
{"zawrs", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
{"zfa", ISA_SPEC_CLASS_DRAFT, 0, 1, 0 },
{"zfh", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
{"zfhmin", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
{"zfinx", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
Expand Down Expand Up @@ -2353,6 +2355,17 @@ riscv_multi_subset_supports (riscv_parse_subset_t *rps,
&& riscv_subset_supports (rps, "q"))
|| (riscv_subset_supports (rps, "zhinxmin")
&& riscv_subset_supports (rps, "zqinx")));
case INSN_CLASS_ZFA:
return riscv_subset_supports (rps, "zfa");
case INSN_CLASS_D_AND_ZFA:
return riscv_subset_supports (rps, "d")
&& riscv_subset_supports (rps, "zfa");
case INSN_CLASS_Q_AND_ZFA:
return riscv_subset_supports (rps, "q")
&& riscv_subset_supports (rps, "zfa");
case INSN_CLASS_ZFH_AND_ZFA:
return riscv_subset_supports (rps, "zfh")
&& riscv_subset_supports (rps, "zfa");
case INSN_CLASS_ZBA:
return riscv_subset_supports (rps, "zba");
case INSN_CLASS_ZBB:
Expand Down Expand Up @@ -2510,6 +2523,32 @@ riscv_multi_subset_supports_ext (riscv_parse_subset_t *rps,
return "zhinxmin";
else
return _("zfhmin' and `q', or `zhinxmin' and `zqinx");
case INSN_CLASS_ZFA:
return "zfa";
case INSN_CLASS_D_AND_ZFA:
if (!riscv_subset_supports (rps, "d")
&& !riscv_subset_supports (rps, "zfa"))
return _("d' and `zfa");
else if (!riscv_subset_supports (rps, "d"))
return "d";
else
return "zfa";
case INSN_CLASS_Q_AND_ZFA:
if (!riscv_subset_supports (rps, "q")
&& !riscv_subset_supports (rps, "zfa"))
return _("q' and `zfa");
else if (!riscv_subset_supports (rps, "q"))
return "q";
else
return "zfa";
case INSN_CLASS_ZFH_AND_ZFA:
if (!riscv_subset_supports (rps, "zfh")
&& !riscv_subset_supports (rps, "zfa"))
return _("zfh' and `zfa");
else if (!riscv_subset_supports (rps, "zfh"))
return "zfh";
else
return "zfa";
case INSN_CLASS_ZBA:
return "zba";
case INSN_CLASS_ZBB:
Expand Down
22 changes: 22 additions & 0 deletions gas/config/tc-riscv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1227,6 +1227,7 @@ validate_riscv_insn (const struct riscv_opcode *opc, int length)
case 'd': USE_BITS (OP_MASK_RD, OP_SH_RD); break;
case 'y': USE_BITS (OP_MASK_BS, OP_SH_BS); break;
case 'Y': USE_BITS (OP_MASK_RNUM, OP_SH_RNUM); break;
case 'i': /* RS1, FLI.[HSDQ] value field. */
case 'Z': /* RS1, CSR number. */
case 'S': /* RS1, floating point. */
case 's': USE_BITS (OP_MASK_RS1, OP_SH_RS1); break;
Expand Down Expand Up @@ -3305,6 +3306,26 @@ riscv_ip (char *str, struct riscv_cl_insn *ip, expressionS *imm_expr,
asarg = expr_end;
continue;

case 'i': /* FLI.[HSDQ] constant immediate. */
if (arg_lookup (&asarg, riscv_fli_value,
ARRAY_SIZE (riscv_fli_value), &regno))
INSERT_OPERAND (RS1, *ip, regno);
else
{
if (my_getSmallExpression (imm_expr, imm_reloc, asarg, p)
|| imm_expr->X_op != O_constant)
break;
if (imm_expr->X_add_number < 0
|| imm_expr->X_add_number > 29)
as_bad (_ ("improper fli value field (%ld), "
"value must be 0...29 or min, inf or nan"),
(long) imm_expr->X_add_number);
INSERT_OPERAND (RS1, *ip, imm_expr->X_add_number);
imm_expr->X_op = O_absent;
asarg = expr_end;
}
continue;

case 'X': /* Integer immediate. */
{
size_t n;
Expand Down Expand Up @@ -3356,6 +3377,7 @@ riscv_ip (char *str, struct riscv_cl_insn *ip, expressionS *imm_expr,
}
}
break;

default:
unknown_riscv_ip_operand:
as_fatal (_("internal: unknown argument type `%s'"),
Expand Down
10 changes: 10 additions & 0 deletions gas/testsuite/gas/riscv/zfa-32.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#as: -march=rv32id_zfa
#objdump: -dr

.*:[ ]+file format .*

Disassembly of section .text:

0+000 <target>:
[ ]+[0-9a-f]+:[ ]+e2108553[ ]+fmvh\.x\.d[ ]+a0,ft1
[ ]+[0-9a-f]+:[ ]+b2b500d3[ ]+fmvp\.d\.x[ ]+ft1,a0,a1
3 changes: 3 additions & 0 deletions gas/testsuite/gas/riscv/zfa-32.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
target:
fmvh.x.d a0, ft1
fmvp.d.x ft1, a0, a1
10 changes: 10 additions & 0 deletions gas/testsuite/gas/riscv/zfa-64.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#as: -march=rv64iq_zfa
#objdump: -dr

.*:[ ]+file format .*

Disassembly of section .text:

0+000 <target>:
[ ]+[0-9a-f]+:[ ]+e6108553[ ]+fmvh\.x\.q[ ]+a0,ft1
[ ]+[0-9a-f]+:[ ]+b6b500d3[ ]+fmvp\.q\.x[ ]+ft1,a0,a1
3 changes: 3 additions & 0 deletions gas/testsuite/gas/riscv/zfa-64.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
target:
fmvh.x.q a0, ft1
fmvp.q.x ft1, a0, a1
3 changes: 3 additions & 0 deletions gas/testsuite/gas/riscv/zfa-fail-fcvtmod.w.d.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#as: -march=rv64id_zfa
#objdump: -dr
#error_output: zfa-fail-fcvtmod.w.d.l
8 changes: 8 additions & 0 deletions gas/testsuite/gas/riscv/zfa-fail-fcvtmod.w.d.l
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.*: Assembler messages:
.*: Error: illegal operands `fcvtmod\.w\.d a0,ft1'
.*: Error: illegal operands `fcvtmod\.w\.d a0,ft1,rne'
.*: Error: illegal operands `fcvtmod\.w\.d a0,ft1,rdn'
.*: Error: illegal operands `fcvtmod\.w\.d a0,ft1,rup'
.*: Error: illegal operands `fcvtmod\.w\.d a0,ft1,rmm'
.*: Error: illegal operands `fcvtmod\.w\.d a0,ft1,dyn'
.*: Error: illegal operands `fcvtmod\.w\.d a0,ft1,invalid'
11 changes: 11 additions & 0 deletions gas/testsuite/gas/riscv/zfa-fail-fcvtmod.w.d.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
target:
# fcvtmod.w.d requires explicit rounding mode.
fcvtmod.w.d a0, ft1
# Rounding mode other than rtz are reserved.
fcvtmod.w.d a0, ft1, rne
fcvtmod.w.d a0, ft1, rdn
fcvtmod.w.d a0, ft1, rup
fcvtmod.w.d a0, ft1, rmm
fcvtmod.w.d a0, ft1, dyn
# Invalid rounding mode is invalid.
fcvtmod.w.d a0, ft1, invalid
3 changes: 3 additions & 0 deletions gas/testsuite/gas/riscv/zfa-fail-fli.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#as: -march=rv64iq_zfa_zfh
#objdump: -dr
#error_output: zfa-fail-fli.l
21 changes: 21 additions & 0 deletions gas/testsuite/gas/riscv/zfa-fail-fli.l
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.*: Assembler messages:
.*: Error: improper fli value field \(-1\), value must be 0\.\.\.29 or min, inf or nan
.*: Error: improper fli value field \(-1\), value must be 0\.\.\.29 or min, inf or nan
.*: Error: improper fli value field \(-1\), value must be 0\.\.\.29 or min, inf or nan
.*: Error: improper fli value field \(-1\), value must be 0\.\.\.29 or min, inf or nan
.*: Error: improper fli value field \(-2\), value must be 0\.\.\.29 or min, inf or nan
.*: Error: improper fli value field \(-2\), value must be 0\.\.\.29 or min, inf or nan
.*: Error: improper fli value field \(-2\), value must be 0\.\.\.29 or min, inf or nan
.*: Error: improper fli value field \(-2\), value must be 0\.\.\.29 or min, inf or nan
.*: Error: improper fli value field \(30\), value must be 0\.\.\.29 or min, inf or nan
.*: Error: improper fli value field \(30\), value must be 0\.\.\.29 or min, inf or nan
.*: Error: improper fli value field \(30\), value must be 0\.\.\.29 or min, inf or nan
.*: Error: improper fli value field \(30\), value must be 0\.\.\.29 or min, inf or nan
.*: Error: improper fli value field \(32\), value must be 0\.\.\.29 or min, inf or nan
.*: Error: improper fli value field \(32\), value must be 0\.\.\.29 or min, inf or nan
.*: Error: improper fli value field \(32\), value must be 0\.\.\.29 or min, inf or nan
.*: Error: improper fli value field \(32\), value must be 0\.\.\.29 or min, inf or nan
.*: Error: illegal operands `fli\.h ft1,invalid'
.*: Error: illegal operands `fli\.s ft1,invalid'
.*: Error: illegal operands `fli\.d ft1,invalid'
.*: Error: illegal operands `fli\.q ft1,invalid'
21 changes: 21 additions & 0 deletions gas/testsuite/gas/riscv/zfa-fail-fli.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
target:
fli.h ft1, -1
fli.s ft1, -1
fli.d ft1, -1
fli.q ft1, -1
fli.h ft1, -2
fli.s ft1, -2
fli.d ft1, -2
fli.q ft1, -2
fli.h ft1, 30
fli.s ft1, 30
fli.d ft1, 30
fli.q ft1, 30
fli.h ft1, 32
fli.s ft1, 32
fli.d ft1, 32
fli.q ft1, 32
fli.h ft1, invalid
fli.s ft1, invalid
fli.d ft1, invalid
fli.q ft1, invalid
93 changes: 93 additions & 0 deletions gas/testsuite/gas/riscv/zfa.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
#as: -march=rv64iq_zfa_zfh
#objdump: -dr

.*:[ ]+file format .*

Disassembly of section .text:

0+000 <target>:
[ ]+[0-9a-f]+:[ ]+f41000d3[ ]+fli\.h[ ]+ft1,0
[ ]+[0-9a-f]+:[ ]+f41080d3[ ]+fli\.h[ ]+ft1,min
[ ]+[0-9a-f]+:[ ]+f41100d3[ ]+fli\.h[ ]+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/gas/riscv/zfa.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
target:
# fli: test both decimal and symbol representations
# (0..29, min==1, inf==(30), nan==(31))
fli.h ft1, 0
fli.h ft1, 1
fli.h ft1, 2
fli.h ft1, 27
fli.h ft1, 28
fli.h ft1, 29
fli.h ft1, min
fli.h ft1, inf
fli.h ft1, nan
fli.s ft1, 0
fli.s ft1, 1
fli.s ft1, 2
fli.s ft1, 27
fli.s ft1, 28
fli.s ft1, 29
fli.s ft1, min
fli.s ft1, inf
fli.s ft1, nan
fli.d ft1, 0
fli.d ft1, 1
fli.d ft1, 2
fli.d ft1, 27
fli.d ft1, 28
fli.d ft1, 29
fli.d ft1, min
fli.d ft1, inf
fli.d ft1, nan
fli.q ft1, 0
fli.q ft1, 1
fli.q ft1, 2
fli.q ft1, 27
fli.q ft1, 28
fli.q ft1, 29
fli.q ft1, min
fli.q ft1, inf
fli.q ft1, nan
# fmini/fmaxi (Zfa): same as fmin/fmax (Zfh/F/D/Q) except bit 13 set
fmin.h ft1, ft2, ft3
fmini.h ft1, ft2, ft3
fmin.s ft1, ft2, ft3
fmini.s ft1, ft2, ft3
fmin.d ft1, ft2, ft3
fmini.d ft1, ft2, ft3
fmin.q ft1, ft2, ft3
fmini.q ft1, ft2, ft3
fmax.h ft1, ft2, ft3
fmaxi.h ft1, ft2, ft3
fmax.s ft1, ft2, ft3
fmaxi.s ft1, ft2, ft3
fmax.d ft1, ft2, ft3
fmaxi.d ft1, ft2, ft3
fmax.q ft1, ft2, ft3
fmaxi.q ft1, ft2, ft3
# fround/froundnx
fround.h fa0, fa1
fround.h fa0, fa1, rtz
fround.s fa0, fa1
fround.s fa0, fa1, rtz
fround.d fa0, fa1
fround.d fa0, fa1, rtz
fround.q fa0, fa1
fround.q fa0, fa1, rtz
froundnx.h fa0, fa1
froundnx.h fa0, fa1, rtz
froundnx.s fa0, fa1
froundnx.s fa0, fa1, rtz
froundnx.d fa0, fa1
froundnx.d fa0, fa1, rtz
froundnx.q fa0, fa1
froundnx.q fa0, fa1, rtz
# fcvtmod.w.d
fcvtmod.w.d a0, ft1, rtz
# fltq/fleq (Zfa): same as flt/fle (Zfh/F/D/Q) except bit 14 set
flt.h a0, ft1, ft2
fltq.h a0, ft1, ft2
flt.s a0, ft1, ft2
fltq.s a0, ft1, ft2
flt.d a0, ft1, ft2
fltq.d a0, ft1, ft2
flt.q a0, ft1, ft2
fltq.q a0, ft1, ft2
fle.h a0, ft1, ft2
fleq.h a0, ft1, ft2
fle.s a0, ft1, ft2
fleq.s a0, ft1, ft2
fle.d a0, ft1, ft2
fleq.d a0, ft1, ft2
fle.q a0, ft1, ft2
fleq.q a0, ft1, ft2
Loading

0 comments on commit 0ee3d70

Please sign in to comment.