Skip to content

Commit ca483f5

Browse files
committed
RISC-V: C2: Support Zvbb Vector And-Not instruction
modify some test
1 parent 0a74d86 commit ca483f5

File tree

4 files changed

+3
-86
lines changed

4 files changed

+3
-86
lines changed

src/hotspot/cpu/riscv/assembler_riscv.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -2270,7 +2270,6 @@ enum Nf {
22702270
}
22712271

22722272
// Vector Bit-manipulation used in Cryptography (Zvbb) Extension
2273-
INSN(vandn_vx, 0b1010111, 0b100, 0b000001);
22742273
INSN(vrol_vx, 0b1010111, 0b100, 0b010101);
22752274
INSN(vror_vx, 0b1010111, 0b100, 0b010100);
22762275

src/hotspot/cpu/riscv/riscv_v.ad

-64
Original file line numberDiff line numberDiff line change
@@ -1180,70 +1180,6 @@ instruct vand_notL_masked(vReg dst, vReg src2, vReg src1, immL_M1 m1, vRegMask_V
11801180
ins_pipe(pipe_slow);
11811181
%}
11821182

1183-
instruct vand_not_regI(vReg dst, vReg src2, iRegIorL2I src1, immI_M1 m1) %{
1184-
predicate(UseZvbb);
1185-
predicate(Matcher::vector_element_basic_type(n) == T_INT ||
1186-
Matcher::vector_element_basic_type(n) == T_BYTE ||
1187-
Matcher::vector_element_basic_type(n) == T_SHORT);
1188-
match(Set dst (AndV src2 (Replicate (XorI src1 m1))));
1189-
format %{ "vandn.vx $dst, $src2, $src1" %}
1190-
ins_encode %{
1191-
BasicType bt = Matcher::vector_element_basic_type(this);
1192-
__ vsetvli_helper(bt, Matcher::vector_length(this));
1193-
__ vandn_vx(as_VectorRegister($dst$$reg),
1194-
as_VectorRegister($src2$$reg),
1195-
as_Register($src1$$reg));
1196-
%}
1197-
ins_pipe(pipe_slow);
1198-
%}
1199-
1200-
instruct vand_not_regL(vReg dst, vReg src2, iRegL src1, immL_M1 m1) %{
1201-
predicate(UseZvbb);
1202-
predicate(Matcher::vector_element_basic_type(n) == T_LONG);
1203-
match(Set dst (AndV src2 (Replicate (XorL src1 m1))));
1204-
format %{ "vandn.vx $dst, $src2, $src1" %}
1205-
ins_encode %{
1206-
__ vsetvli_helper(T_LONG, Matcher::vector_length(this));
1207-
__ vandn_vx(as_VectorRegister($dst$$reg),
1208-
as_VectorRegister($src2$$reg),
1209-
as_Register($src1$$reg));
1210-
%}
1211-
ins_pipe(pipe_slow);
1212-
%}
1213-
1214-
instruct vand_not_regI_masked(vReg dst, vReg src2, iRegIorL2I src1, immI_M1 m1, vRegMask_V0 v0) %{
1215-
predicate(UseZvbb);
1216-
predicate(Matcher::vector_element_basic_type(n) == T_INT ||
1217-
Matcher::vector_element_basic_type(n) == T_BYTE ||
1218-
Matcher::vector_element_basic_type(n) == T_SHORT);
1219-
match(Set dst (AndV (Binary src2 (Replicate (XorI src1 m1))) v0));
1220-
format %{ "vandn.vx $dst, $src2, $src1, $v0" %}
1221-
ins_encode %{
1222-
BasicType bt = Matcher::vector_element_basic_type(this);
1223-
__ vsetvli_helper(bt, Matcher::vector_length(this));
1224-
__ vandn_vx(as_VectorRegister($dst$$reg),
1225-
as_VectorRegister($src2$$reg),
1226-
as_Register($src1$$reg),
1227-
Assembler::v0_t);
1228-
%}
1229-
ins_pipe(pipe_slow);
1230-
%}
1231-
1232-
instruct vand_not_regL_masked(vReg dst, vReg src2, iRegL src1, immL_M1 m1, vRegMask_V0 v0) %{
1233-
predicate(UseZvbb);
1234-
predicate(Matcher::vector_element_basic_type(n) == T_LONG);
1235-
match(Set dst (AndV (Binary src2 (Replicate (XorL src1 m1))) v0));
1236-
format %{ "vandn.vx $dst, $src2, $src1, $v0" %}
1237-
ins_encode %{
1238-
__ vsetvli_helper(T_LONG, Matcher::vector_length(this));
1239-
__ vandn_vx(as_VectorRegister($dst$$reg),
1240-
as_VectorRegister($src2$$reg),
1241-
as_Register($src1$$reg),
1242-
Assembler::v0_t);
1243-
%}
1244-
ins_pipe(pipe_slow);
1245-
%}
1246-
12471183
// ------------------------------ Vector not -----------------------------------
12481184

12491185
// vector not

test/hotspot/jtreg/compiler/lib/ir_framework/IRNode.java

-5
Original file line numberDiff line numberDiff line change
@@ -1992,11 +1992,6 @@ public class IRNode {
19921992
machOnlyNameRegex(VAND_NOT_L, "vand_notL");
19931993
}
19941994

1995-
public static final String VAND_NOT_REGI = PREFIX + "VAND_NOT_REGI" + POSTFIX;
1996-
static {
1997-
machOnlyNameRegex(VAND_NOT_REGI, "vand_not_regI");
1998-
}
1999-
20001995
public static final String VECTOR_BLEND_B = VECTOR_PREFIX + "VECTOR_BLEND_B" + POSTFIX;
20011996
static {
20021997
vectorNode(VECTOR_BLEND_B, "VectorBlend", TYPE_BYTE);

test/hotspot/jtreg/compiler/vectorapi/AllBitsSetVectorMatchRuleTest.java

+3-16
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,9 @@ public static void testAllBitsSetVector() {
9898

9999
@Test
100100
@Warmup(10000)
101-
@IR(counts = { IRNode.VAND_NOT_L, " >= 1" }, applyIf = {"UseSVE", "0"})
102-
@IR(counts = { IRNode.VMASK_AND_NOT_L, " >= 1" }, applyIf = {"UseSVE", "> 0"})
101+
@IR(counts = { IRNode.VAND_NOT_L, " >= 1" }, applyIfPlatform = {"aarch64", "true"}, applyIf = {"UseSVE", "0"})
102+
@IR(counts = { IRNode.VMASK_AND_NOT_L, " >= 1" }, applyIfPlatform = {"aarch64", "true"}, applyIf = {"UseSVE", "> 0"})
103+
@IR(counts = { IRNode.VAND_NOT_L, " >= 1" }, applyIfPlatform = {"riscv64", "true"}, applyIfCPUFeatureOr = {"zvbb", "true"})
103104
public static void testAllBitsSetMask() {
104105
VectorMask<Long> avm = VectorMask.fromArray(L_SPECIES, ma, 0);
105106
VectorMask<Long> bvm = VectorMask.fromArray(L_SPECIES, mb, 0);
@@ -112,20 +113,6 @@ public static void testAllBitsSetMask() {
112113
}
113114
}
114115

115-
@Test
116-
@Warmup(10000)
117-
@IR(counts = { IRNode.VAND_NOT_REGI, " >= 1" }, applyIfCPUFeatureOr = {"zvbb", "true"})
118-
public static void testAllBitsSetVectorRegI() {
119-
IntVector av = IntVector.fromArray(I_SPECIES, ia, 0);
120-
int bs = ib[0];
121-
av.not().lanewise(VectorOperators.AND_NOT, bs).intoArray(ir, 0);
122-
123-
// Verify results
124-
for (int i = 0; i < I_SPECIES.length(); i++) {
125-
Asserts.assertEquals((~ia[i]) & (~bs), ir[i]);
126-
}
127-
}
128-
129116
public static void main(String[] args) {
130117
TestFramework.runWithFlags("--add-modules=jdk.incubator.vector");
131118
}

0 commit comments

Comments
 (0)