Skip to content

Commit df5b49e

Browse files
committed
8374525: RISC-V: Several masked float16 vector operations are not supported
Reviewed-by: fjiang, fyang
1 parent 532a0a6 commit df5b49e

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

src/hotspot/cpu/riscv/riscv_v.ad

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,12 @@ source %{
114114
case Op_VectorCastHF2F:
115115
case Op_VectorCastF2HF:
116116
case Op_AddVHF:
117+
case Op_SubVHF:
118+
case Op_MulVHF:
117119
case Op_DivVHF:
118120
case Op_MaxVHF:
119121
case Op_MinVHF:
120-
case Op_MulVHF:
121122
case Op_SqrtVHF:
122-
case Op_SubVHF:
123123
return UseZvfh;
124124
case Op_FmaVHF:
125125
return UseZvfh && UseFMA;
@@ -147,13 +147,28 @@ source %{
147147
if (!UseRVV) {
148148
return false;
149149
}
150+
150151
switch (opcode) {
151152
case Op_SelectFromTwoVector:
152153
// There is no masked version of selectFrom two vector, i.e. selectFrom(av, bv, mask) in vector API.
153154
return false;
155+
// Currently, the masked versions of the following 8 Float16 operations are disabled.
156+
// When the support for Float16 vector classes is added in VectorAPI and the masked
157+
// Float16 IR can be generated, these masked operations will be enabled and relevant
158+
// backend support added.
159+
case Op_AddVHF:
160+
case Op_SubVHF:
161+
case Op_MulVHF:
162+
case Op_DivVHF:
163+
case Op_MaxVHF:
164+
case Op_MinVHF:
165+
case Op_SqrtVHF:
166+
case Op_FmaVHF:
167+
return false;
154168
default:
155169
break;
156170
}
171+
157172
return match_rule_supported_vector(opcode, vlen, bt);
158173
}
159174

0 commit comments

Comments
 (0)