Skip to content

Commit

Permalink
Add IR rule for VNNI instruction
Browse files Browse the repository at this point in the history
  • Loading branch information
chhagedorn committed Sep 21, 2023
1 parent 21e95b2 commit 52d6b2d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/hotspot/jtreg/compiler/lib/ir_framework/IRNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -917,6 +917,12 @@ public class IRNode {
superWordNodes(MUL_ADD_VS2VI, "MulAddVS2VI");
}

// Can only be used if avx512_vnni is available.
public static final String MUL_ADD_VS2VI_VNNI = PREFIX + "MUL_ADD_VS2VI_VNNI" + POSTFIX;
static {
machOnly(MUL_ADD_VS2VI_VNNI, "vmuladdaddS2I_reg");
}

public static final String MUL_D = PREFIX + "MUL_D" + POSTFIX;
static {
beforeMatchingNameRegex(MUL_D, "MulD");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public class IREncodingPrinter {
"avx512dq",
"avx512vl",
"avx512f",
"avx512_vnni",
// AArch64
"sha3",
"asimd",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ public static void compare(int[] out) {
counts = {IRNode.MUL_ADD_S2I, "> 0"})
@IR(applyIfCPUFeature = {"asimd", "true"}, applyIf = {"MaxVectorSize", "16"},
counts = {IRNode.MUL_ADD_S2I, "> 0", IRNode.MUL_ADD_VS2VI, "> 0"})
@IR(applyIfCPUFeature = {"avx512_vnni", "true"}, applyIf = {"UseUnalignedLoadStores", "true"},
counts = {IRNode.MUL_ADD_S2I, "> 0", IRNode.MUL_ADD_VS2VI_VNNI, "> 0"})
public static int[] test() {
int[] out = new int[ITER];
int[] out2 = new int[ITER];
Expand Down

0 comments on commit 52d6b2d

Please sign in to comment.