• 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

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

Log Message

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

Zve32f 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-14-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_zve32f(DisasContext *s)
70+{
71+ /* RVV + Zve32f = RVV. */
72+ if (has_ext(s, RVV)) {
73+ return true;
74+ }
75+
76+ /* Zve32f doesn't support FP64. (Section 18.2) */
77+ return s->ext_zve32f ? s->sew <= MO_32 : true;
78+}
79+
6980 static bool require_zve64f(DisasContext *s)
7081 {
7182 /* RVV + Zve64f = RVV. */
@@ -2229,6 +2240,7 @@ static bool opfvv_check(DisasContext *s, arg_rmrr *a)
22292240 require_rvf(s) &&
22302241 vext_check_isa_ill(s) &&
22312242 vext_check_sss(s, a->rd, a->rs1, a->rs2, a->vm) &&
2243+ require_zve32f(s) &&
22322244 require_zve64f(s);
22332245 }
22342246
@@ -2310,6 +2322,7 @@ static bool opfvf_check(DisasContext *s, arg_rmrr *a)
23102322 require_rvf(s) &&
23112323 vext_check_isa_ill(s) &&
23122324 vext_check_ss(s, a->rd, a->rs2, a->vm) &&
2325+ require_zve32f(s) &&
23132326 require_zve64f(s);
23142327 }
23152328
@@ -2532,6 +2545,7 @@ static bool opfv_check(DisasContext *s, arg_rmr *a)
25322545 vext_check_isa_ill(s) &&
25332546 /* OPFV instructions ignore vs1 check */
25342547 vext_check_ss(s, a->rd, a->rs2, a->vm) &&
2548+ require_zve32f(s) &&
25352549 require_zve64f(s);
25362550 }
25372551
@@ -2598,6 +2612,7 @@ static bool opfvv_cmp_check(DisasContext *s, arg_rmrr *a)
25982612 require_rvf(s) &&
25992613 vext_check_isa_ill(s) &&
26002614 vext_check_mss(s, a->rd, a->rs1, a->rs2) &&
2615+ require_zve32f(s) &&
26012616 require_zve64f(s);
26022617 }
26032618
@@ -2612,6 +2627,7 @@ static bool opfvf_cmp_check(DisasContext *s, arg_rmrr *a)
26122627 require_rvf(s) &&
26132628 vext_check_isa_ill(s) &&
26142629 vext_check_ms(s, a->rd, a->rs2) &&
2630+ require_zve32f(s) &&
26152631 require_zve64f(s);
26162632 }
26172633
@@ -2634,6 +2650,7 @@ static bool trans_vfmv_v_f(DisasContext *s, arg_vfmv_v_f *a)
26342650 require_rvf(s) &&
26352651 vext_check_isa_ill(s) &&
26362652 require_align(a->rd, s->lmul) &&
2653+ require_zve32f(s) &&
26372654 require_zve64f(s)) {
26382655 gen_set_rm(s, RISCV_FRM_DYN);
26392656
@@ -3368,6 +3385,7 @@ static bool trans_vfmv_f_s(DisasContext *s, arg_vfmv_f_s *a)
33683385 if (require_rvv(s) &&
33693386 require_rvf(s) &&
33703387 vext_check_isa_ill(s) &&
3388+ require_zve32f(s) &&
33713389 require_zve64f(s)) {
33723390 gen_set_rm(s, RISCV_FRM_DYN);
33733391
@@ -3395,6 +3413,7 @@ static bool trans_vfmv_s_f(DisasContext *s, arg_vfmv_s_f *a)
33953413 if (require_rvv(s) &&
33963414 require_rvf(s) &&
33973415 vext_check_isa_ill(s) &&
3416+ require_zve32f(s) &&
33983417 require_zve64f(s)) {
33993418 gen_set_rm(s, RISCV_FRM_DYN);
34003419
@@ -3447,6 +3466,7 @@ static bool fslideup_check(DisasContext *s, arg_rmrr *a)
34473466 {
34483467 return slideup_check(s, a) &&
34493468 require_rvf(s) &&
3469+ require_zve32f(s) &&
34503470 require_zve64f(s);
34513471 }
34523472
@@ -3454,6 +3474,7 @@ static bool fslidedown_check(DisasContext *s, arg_rmrr *a)
34543474 {
34553475 return slidedown_check(s, a) &&
34563476 require_rvf(s) &&
3477+ require_zve32f(s) &&
34573478 require_zve64f(s);
34583479 }
34593480