• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revision40d78c85f6f321c00588230a400477250a85c2e7 (tree)
Zeit2022-01-21 14:52:56
AutorFrank Chang <frank.chang@sifi...>
CommiterAlistair Francis

Log Message

target/riscv: rvv-1.0: Add Zve64f support for scalar fp insns

Zve64f extension requires the scalar processor to implement the F
extension and implement all vector floating-point instructions for
floating-point operands with EEW=32 (i.e., no widening floating-point
operations).

Signed-off-by: Frank Chang <frank.chang@sifive.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-id: 20220118014522.13613-7-frank.chang@sifive.com
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>

Ändern Zusammenfassung

Diff

--- a/target/riscv/insn_trans/trans_rvv.c.inc
+++ b/target/riscv/insn_trans/trans_rvv.c.inc
@@ -66,6 +66,17 @@ static bool require_scale_rvf(DisasContext *s)
6666 }
6767 }
6868
69+static bool require_zve64f(DisasContext *s)
70+{
71+ /* RVV + Zve64f = RVV. */
72+ if (has_ext(s, RVV)) {
73+ return true;
74+ }
75+
76+ /* Zve64f doesn't support FP64. (Section 18.2) */
77+ return s->ext_zve64f ? s->sew <= MO_32 : true;
78+}
79+
6980 /* Destination vector register group cannot overlap source mask register. */
7081 static bool require_vm(int vm, int vd)
7182 {
@@ -2206,7 +2217,8 @@ static bool opfvv_check(DisasContext *s, arg_rmrr *a)
22062217 return require_rvv(s) &&
22072218 require_rvf(s) &&
22082219 vext_check_isa_ill(s) &&
2209- vext_check_sss(s, a->rd, a->rs1, a->rs2, a->vm);
2220+ vext_check_sss(s, a->rd, a->rs1, a->rs2, a->vm) &&
2221+ require_zve64f(s);
22102222 }
22112223
22122224 /* OPFVV without GVEC IR */
@@ -2286,7 +2298,8 @@ static bool opfvf_check(DisasContext *s, arg_rmrr *a)
22862298 return require_rvv(s) &&
22872299 require_rvf(s) &&
22882300 vext_check_isa_ill(s) &&
2289- vext_check_ss(s, a->rd, a->rs2, a->vm);
2301+ vext_check_ss(s, a->rd, a->rs2, a->vm) &&
2302+ require_zve64f(s);
22902303 }
22912304
22922305 /* OPFVF without GVEC IR */
@@ -2503,7 +2516,8 @@ static bool opfv_check(DisasContext *s, arg_rmr *a)
25032516 require_rvf(s) &&
25042517 vext_check_isa_ill(s) &&
25052518 /* OPFV instructions ignore vs1 check */
2506- vext_check_ss(s, a->rd, a->rs2, a->vm);
2519+ vext_check_ss(s, a->rd, a->rs2, a->vm) &&
2520+ require_zve64f(s);
25072521 }
25082522
25092523 static bool do_opfv(DisasContext *s, arg_rmr *a,
@@ -2568,7 +2582,8 @@ static bool opfvv_cmp_check(DisasContext *s, arg_rmrr *a)
25682582 return require_rvv(s) &&
25692583 require_rvf(s) &&
25702584 vext_check_isa_ill(s) &&
2571- vext_check_mss(s, a->rd, a->rs1, a->rs2);
2585+ vext_check_mss(s, a->rd, a->rs1, a->rs2) &&
2586+ require_zve64f(s);
25722587 }
25732588
25742589 GEN_OPFVV_TRANS(vmfeq_vv, opfvv_cmp_check)
@@ -2581,7 +2596,8 @@ static bool opfvf_cmp_check(DisasContext *s, arg_rmrr *a)
25812596 return require_rvv(s) &&
25822597 require_rvf(s) &&
25832598 vext_check_isa_ill(s) &&
2584- vext_check_ms(s, a->rd, a->rs2);
2599+ vext_check_ms(s, a->rd, a->rs2) &&
2600+ require_zve64f(s);
25852601 }
25862602
25872603 GEN_OPFVF_TRANS(vmfeq_vf, opfvf_cmp_check)
@@ -2602,7 +2618,8 @@ static bool trans_vfmv_v_f(DisasContext *s, arg_vfmv_v_f *a)
26022618 if (require_rvv(s) &&
26032619 require_rvf(s) &&
26042620 vext_check_isa_ill(s) &&
2605- require_align(a->rd, s->lmul)) {
2621+ require_align(a->rd, s->lmul) &&
2622+ require_zve64f(s)) {
26062623 gen_set_rm(s, RISCV_FRM_DYN);
26072624
26082625 TCGv_i64 t1;
@@ -3328,7 +3345,8 @@ static bool trans_vfmv_f_s(DisasContext *s, arg_vfmv_f_s *a)
33283345 {
33293346 if (require_rvv(s) &&
33303347 require_rvf(s) &&
3331- vext_check_isa_ill(s)) {
3348+ vext_check_isa_ill(s) &&
3349+ require_zve64f(s)) {
33323350 gen_set_rm(s, RISCV_FRM_DYN);
33333351
33343352 unsigned int ofs = (8 << s->sew);
@@ -3354,7 +3372,8 @@ static bool trans_vfmv_s_f(DisasContext *s, arg_vfmv_s_f *a)
33543372 {
33553373 if (require_rvv(s) &&
33563374 require_rvf(s) &&
3357- vext_check_isa_ill(s)) {
3375+ vext_check_isa_ill(s) &&
3376+ require_zve64f(s)) {
33583377 gen_set_rm(s, RISCV_FRM_DYN);
33593378
33603379 /* The instructions ignore LMUL and vector register group. */
@@ -3405,13 +3424,15 @@ GEN_OPIVI_TRANS(vslidedown_vi, IMM_ZX, vslidedown_vx, slidedown_check)
34053424 static bool fslideup_check(DisasContext *s, arg_rmrr *a)
34063425 {
34073426 return slideup_check(s, a) &&
3408- require_rvf(s);
3427+ require_rvf(s) &&
3428+ require_zve64f(s);
34093429 }
34103430
34113431 static bool fslidedown_check(DisasContext *s, arg_rmrr *a)
34123432 {
34133433 return slidedown_check(s, a) &&
3414- require_rvf(s);
3434+ require_rvf(s) &&
3435+ require_zve64f(s);
34153436 }
34163437
34173438 GEN_OPFVF_TRANS(vfslide1up_vf, fslideup_check)