Skip to content

Commit f3bea96

Browse files
rnaxMichael Tokarev
authored andcommitted
target/riscv: rvv: Fix Zvfhmin checking for vfwcvt.f.f.v and vfncvt.f.f.w instructions
According v spec 18.4, only the vfwcvt.f.f.v and vfncvt.f.f.w instructions will be affected by Zvfhmin extension. And the vfwcvt.f.f.v and vfncvt.f.f.w instructions only support the conversions of * From 1*SEW(16/32) to 2*SEW(32/64) * From 2*SEW(32/64) to 1*SEW(16/32) Signed-off-by: Max Chou <[email protected]> Reviewed-by: Daniel Henrique Barboza <[email protected]> Cc: qemu-stable <[email protected]> Message-ID: <[email protected]> Signed-off-by: Alistair Francis <[email protected]> (cherry picked from commit 17b713c) Signed-off-by: Michael Tokarev <[email protected]>
1 parent 3f4ab4b commit f3bea96

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

target/riscv/insn_trans/trans_rvv.c.inc

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,22 @@ static bool require_rvf(DisasContext *s)
5050
}
5151
}
5252

53+
static bool require_rvfmin(DisasContext *s)
54+
{
55+
if (s->mstatus_fs == EXT_STATUS_DISABLED) {
56+
return false;
57+
}
58+
59+
switch (s->sew) {
60+
case MO_16:
61+
return s->cfg_ptr->ext_zvfhmin;
62+
case MO_32:
63+
return s->cfg_ptr->ext_zve32f;
64+
default:
65+
return false;
66+
}
67+
}
68+
5369
static bool require_scale_rvf(DisasContext *s)
5470
{
5571
if (s->mstatus_fs == EXT_STATUS_DISABLED) {
@@ -75,8 +91,6 @@ static bool require_scale_rvfmin(DisasContext *s)
7591
}
7692

7793
switch (s->sew) {
78-
case MO_8:
79-
return s->cfg_ptr->ext_zvfhmin;
8094
case MO_16:
8195
return s->cfg_ptr->ext_zve32f;
8296
case MO_32:
@@ -2685,6 +2699,7 @@ static bool opxfv_widen_check(DisasContext *s, arg_rmr *a)
26852699
static bool opffv_widen_check(DisasContext *s, arg_rmr *a)
26862700
{
26872701
return opfv_widen_check(s, a) &&
2702+
require_rvfmin(s) &&
26882703
require_scale_rvfmin(s) &&
26892704
(s->sew != MO_8);
26902705
}
@@ -2790,6 +2805,7 @@ static bool opfxv_narrow_check(DisasContext *s, arg_rmr *a)
27902805
static bool opffv_narrow_check(DisasContext *s, arg_rmr *a)
27912806
{
27922807
return opfv_narrow_check(s, a) &&
2808+
require_rvfmin(s) &&
27932809
require_scale_rvfmin(s) &&
27942810
(s->sew != MO_8);
27952811
}

0 commit comments

Comments
 (0)