Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
* @library /test/lib /
* @summary test combining vector not operation with compare
* @modules jdk.incubator.vector
* @requires (os.arch != "riscv64" | (os.arch == "riscv64" & vm.cpu.features ~= ".*rvv.*"))
* @requires vm.opt.final.MaxVectorSize == "null" | vm.opt.final.MaxVectorSize >= 16
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be

Suggested change
* @requires vm.opt.final.MaxVectorSize == "null" | vm.opt.final.MaxVectorSize >= 16
* @requires vm.opt.final.MaxVectorSize == "null" & vm.opt.final.MaxVectorSize >= 16

or

Suggested change
* @requires vm.opt.final.MaxVectorSize == "null" | vm.opt.final.MaxVectorSize >= 16
* @requires vm.compiler2.enabled & vm.opt.final.MaxVectorSize >= 16

?

Assume this test is run with another compiler (like Graal) that doesn't support the option MaxVectorSize, then vm.opt.final.MaxVectorSize == "null" holds. But this can't guarantee that the max vector size >= 16.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forgot to submit this comment. I thought I submitted it two days ago.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought someone may want to run the test in a configuration without C2. So, I didn't want to change the test for such cases. I leave such decisions to others. Maybe @dougxc has an opinion about Graal?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe they just need to put their own guards there if they care? It's hard to guard this very generically.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought someone may want to run the test in a configuration without C2.

Yeah I know your point. But vm.opt.final.MaxVectorSize == "null" doesn't work I think, because this doesn't guarantee the max vector size >= 16. Perhaps as @eme64 pointed out, it is hard for us to ensure that all compilers work. This do no harm to C2 test, just a bit unnecessary.

*
* @run driver compiler.vectorapi.VectorMaskCompareNotTest
*/
Expand Down
21 changes: 21 additions & 0 deletions test/jtreg-ext/requires/VMProps.java
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ public Map<String, String> call() {
vmGC(map); // vm.gc.X = true/false
vmGCforCDS(map); // may set vm.gc
vmOptFinalFlags(map);
vmOptFinalIntxFlags(map);

dump(map.map);
log("Leaving call()");
Expand Down Expand Up @@ -389,6 +390,26 @@ protected void vmOptFinalFlags(SafeMap map) {
vmOptFinalFlag(map, "UseVectorizedMismatchIntrinsic");
}

/**
* Selected final flag of type intx.
*
* @param map - property-value pairs
* @param flagName - flag name
*/
private void vmOptFinalIntxFlag(SafeMap map, String flagName) {
map.put("vm.opt.final." + flagName,
() -> String.valueOf(WB.getIntxVMFlag(flagName)));
}

/**
* Selected sets of final flags of type intx.
*
* @param map - property-value pairs
*/
protected void vmOptFinalIntxFlags(SafeMap map) {
vmOptFinalIntxFlag(map, "MaxVectorSize");
}

/**
* @return "true" if VM has a serviceability agent.
*/
Expand Down