Mercurial > hg > truffle
annotate test/compiler/intrinsics/bmi/BMITestRunner.java @ 17911:f48e481abef0
8042281: compiler/7184394/TestAESMain.java fails with: javax.crypto.IllegalBlockSizeException: Input length not multiple of 16 bytes
Summary: Added missing -DmsgSize=640 to test's run commands.
Reviewed-by: kvn
Contributed-by: shrinivas.joshi@oracle.com
author | kvn |
---|---|
date | Thu, 01 May 2014 17:57:29 -0700 |
parents | a48e16541e6b |
children |
rev | line source |
---|---|
17778
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
1 /* |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
2 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
4 * |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
8 * |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
13 * accompanied this code). |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
14 * |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
18 * |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
21 * questions. |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
22 * |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
23 */ |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
24 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
25 import java.util.*; |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
26 import java.io.IOException; |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
27 import java.nio.file.Files; |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
28 import java.nio.file.Paths; |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
29 import java.nio.charset.StandardCharsets; |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
30 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
31 import com.oracle.java.testlibrary.*; |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
32 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
33 /** |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
34 * Test runner that invokes all methods implemented by particular Expr |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
35 * with random arguments in two different JVM processes and compares output. |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
36 * JVMs being started in different modes - one in int and other in comp |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
37 * with C2 and disabled tiered compilation. |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
38 */ |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
39 public class BMITestRunner { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
40 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
41 enum VMMode { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
42 COMP, INT; |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
43 }; |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
44 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
45 public static int DEFAULT_ITERATIONS_COUNT = 4000; |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
46 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
47 /** |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
48 * Execute all methods implemented by <b>expr</b> in int and comp modes |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
49 * and compare output. |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
50 * Test pass only of output obtained with different VM modes is equal. |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
51 * To control behaviour of test following options could be passed: |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
52 * <ul> |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
53 * <li>-iterations=<N> each operation implemented by |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
54 * <b>expr</b> will be executed <i>N</i> times. Default value |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
55 * is 4000.</li> |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
56 * <li>-seed=<SEED> arguments for <b>expr</b>'s methods |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
57 * obtained via RNG initiated with seed <i>SEED</i>. By default |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
58 * some random seed will be used.</li> |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
59 * </ul> |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
60 * |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
61 * @param expr operation that should be tested |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
62 * @param testOpts options to control test behaviour |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
63 * @param additionalVMOpts additional options for VM |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
64 * |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
65 * @throws Throwable if test failed. |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
66 */ |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
67 public static void runTests(Class<? extends Expr> expr, |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
68 String testOpts[], |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
69 String... additionalVMOpts) |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
70 throws Throwable { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
71 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
72 int seed = new Random().nextInt(); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
73 int iterations = DEFAULT_ITERATIONS_COUNT; |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
74 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
75 for (String testOption : testOpts) { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
76 if (testOption.startsWith("-iterations=")) { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
77 iterations = Integer.valueOf(testOption. |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
78 replace("-iterations=", "")); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
79 } else if (testOption.startsWith("-seed=")) { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
80 seed = Integer.valueOf(testOption.replace("-seed=", "")); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
81 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
82 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
83 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
84 System.out.println("Running test with seed: " + seed); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
85 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
86 OutputAnalyzer intOutput = runTest(expr, VMMode.INT, |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
87 additionalVMOpts, |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
88 seed, iterations); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
89 OutputAnalyzer compOutput = runTest(expr, VMMode.COMP, |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
90 additionalVMOpts, |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
91 seed, iterations); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
92 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
93 dumpOutput(intOutput, "int"); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
94 dumpOutput(compOutput, "comp"); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
95 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
96 Asserts.assertStringsEqual(intOutput.getStdout(), |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
97 compOutput.getStdout(), |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
98 "Results obtained in -Xint and " + |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
99 "-Xcomp should be the same."); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
100 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
101 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
102 /** |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
103 * Execute tests on methods implemented by <b>expr</b> in new VM |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
104 * started in <b>testVMMode</b> mode. |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
105 * |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
106 * @param expr operation that should be tested |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
107 * @param testVMMode VM mode for test |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
108 * @param additionalVMOpts additional options for VM |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
109 * @param seed for RNG used it tests |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
110 * @param iterations that will be used to invoke <b>expr</b>'s methods. |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
111 * |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
112 * @return OutputAnalyzer for executed test. |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
113 * @throws Throwable when something goes wrong. |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
114 */ |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
115 public static OutputAnalyzer runTest(Class<? extends Expr> expr, |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
116 VMMode testVMMode, |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
117 String additionalVMOpts[], |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
118 int seed, int iterations) |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
119 throws Throwable { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
120 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
121 List<String> vmOpts = new LinkedList<String>(); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
122 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
123 Collections.addAll(vmOpts, additionalVMOpts); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
124 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
125 //setup mode-specific options |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
126 switch (testVMMode) { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
127 case INT: |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
128 Collections.addAll(vmOpts, new String[] { "-Xint" }); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
129 break; |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
130 case COMP: |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
131 Collections.addAll(vmOpts, new String[] { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
132 "-Xcomp", |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
133 "-XX:-TieredCompilation", |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
134 String.format("-XX:CompileCommand=compileonly,%s::*", |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
135 expr.getName()) |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
136 }); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
137 break; |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
138 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
139 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
140 Collections.addAll(vmOpts, new String[] { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
141 "-XX:+DisplayVMOutputToStderr", |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
142 Executor.class.getName(), |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
143 expr.getName(), |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
144 new Integer(seed).toString(), |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
145 new Integer(iterations).toString() |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
146 }); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
147 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
148 OutputAnalyzer outputAnalyzer = ProcessTools. |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
149 executeTestJvm(vmOpts.toArray(new String[vmOpts.size()])); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
150 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
151 outputAnalyzer.shouldHaveExitValue(0); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
152 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
153 return outputAnalyzer; |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
154 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
155 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
156 /** |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
157 * Dump stdout and stderr of test process to <i>prefix</i>.test.out |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
158 * and <i>prefix</i>.test.err respectively. |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
159 * |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
160 * @param outputAnalyzer OutputAnalyzer whom output should be dumped |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
161 * @param prefix Prefix that will be used in file names. |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
162 * @throws IOException if unable to dump output to file. |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
163 */ |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
164 protected static void dumpOutput(OutputAnalyzer outputAnalyzer, |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
165 String prefix) |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
166 throws IOException { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
167 Files.write(Paths.get(prefix + ".test.out"), |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
168 outputAnalyzer.getStdout().getBytes()); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
169 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
170 Files.write(Paths.get(prefix + ".test.err"), |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
171 outputAnalyzer.getStderr().getBytes()); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
172 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
173 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
174 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
175 /** |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
176 * Executor that invoke all methods implemented by particular |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
177 * Expr instance. |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
178 */ |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
179 public static class Executor { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
180 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
181 /** |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
182 * Usage: BMITestRunner$Executor <ExprClassName> <seed> <iterations> |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
183 */ |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
184 public static void main(String args[]) throws Exception { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
185 @SuppressWarnings("unchecked") |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
186 Class<? extends Expr> exprClass = |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
187 (Class<? extends Expr>)Class.forName(args[0]); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
188 Expr expr = exprClass.getConstructor().newInstance(); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
189 Random rng = new Random(Integer.valueOf(args[1])); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
190 int iterations = Integer.valueOf(args[2]); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
191 runTests(expr, iterations, rng); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
192 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
193 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
194 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
195 public static int[] getIntBitShifts() { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
196 //SIZE+1 shift is for zero. |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
197 int data[] = new int[Integer.SIZE+1]; |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
198 for (int s = 0; s < data.length; s++) { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
199 data[s] = 1<<s; |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
200 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
201 return data; |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
202 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
203 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
204 public static long[] getLongBitShifts() { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
205 //SIZE+1 shift is for zero. |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
206 long data[] = new long[Long.SIZE+1]; |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
207 for (int s = 0; s < data.length; s++) { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
208 data[s] = 1L<<s; |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
209 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
210 return data; |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
211 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
212 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
213 public static void log(String format, Object... args) { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
214 System.out.println(String.format(format, args)); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
215 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
216 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
217 public static void runTests(Expr expr, int iterations, Random rng) { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
218 runUnaryIntRegTest(expr, iterations, rng); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
219 runUnaryIntMemTest(expr, iterations, rng); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
220 runUnaryLongRegTest(expr, iterations, rng); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
221 runUnaryLongMemTest(expr, iterations, rng); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
222 runBinaryRegRegIntTest(expr, iterations, rng); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
223 runBinaryRegMemIntTest(expr, iterations, rng); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
224 runBinaryMemRegIntTest(expr, iterations, rng); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
225 runBinaryMemMemIntTest(expr, iterations, rng); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
226 runBinaryRegRegLongTest(expr, iterations, rng); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
227 runBinaryRegMemLongTest(expr, iterations, rng); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
228 runBinaryMemRegLongTest(expr, iterations, rng); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
229 runBinaryMemMemLongTest(expr, iterations, rng); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
230 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
231 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
232 public static void runUnaryIntRegTest(Expr expr, int iterations, |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
233 Random rng) { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
234 if (!(expr.isUnaryArgumentSupported() |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
235 && expr.isIntExprSupported())) { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
236 return; |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
237 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
238 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
239 for (int value : getIntBitShifts()) { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
240 log("UnaryIntReg(0X%x) -> 0X%x", |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
241 value, expr.intExpr(value)); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
242 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
243 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
244 for (int i = 0; i < iterations; i++) { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
245 int value = rng.nextInt(); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
246 log("UnaryIntReg(0X%x) -> 0X%x", |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
247 value, expr.intExpr(value)); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
248 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
249 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
250 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
251 public static void runUnaryIntMemTest(Expr expr, int iterations, |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
252 Random rng) { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
253 if (!(expr.isUnaryArgumentSupported() |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
254 && expr.isIntExprSupported() |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
255 && expr.isMemExprSupported())) { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
256 return; |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
257 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
258 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
259 for (int value : getIntBitShifts()) { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
260 log("UnaryIntMem(0X%x) -> 0X%x", |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
261 value, expr.intExpr(new Expr.MemI(value))); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
262 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
263 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
264 for (int i = 0; i < iterations; i++) { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
265 int value = rng.nextInt(); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
266 log("UnaryIntMem(0X%x) -> 0X%x", |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
267 value, expr.intExpr(new Expr.MemI(value))); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
268 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
269 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
270 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
271 public static void runUnaryLongRegTest(Expr expr, int iterations, |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
272 Random rng) { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
273 if (!(expr.isUnaryArgumentSupported() |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
274 && expr.isLongExprSupported())) { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
275 return; |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
276 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
277 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
278 for (long value : getLongBitShifts()) { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
279 log("UnaryLongReg(0X%x) -> 0X%x", |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
280 value, expr.longExpr(value)); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
281 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
282 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
283 for (int i = 0; i < iterations; i++) { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
284 long value = rng.nextLong(); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
285 log("UnaryLongReg(0X%x) -> 0X%x", |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
286 value, expr.longExpr(value)); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
287 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
288 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
289 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
290 public static void runUnaryLongMemTest(Expr expr, int iterations, |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
291 Random rng) { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
292 if (!(expr.isUnaryArgumentSupported() |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
293 && expr.isLongExprSupported() |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
294 && expr.isMemExprSupported())) { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
295 return; |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
296 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
297 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
298 for (long value : getLongBitShifts()) { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
299 log("UnaryLongMem(0X%x) -> 0X%x", |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
300 value, expr.longExpr(new Expr.MemL(value))); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
301 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
302 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
303 for (int i = 0; i < iterations; i++) { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
304 long value = rng.nextLong(); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
305 log("UnaryLongMem(0X%x) -> 0X%x", |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
306 value, expr.longExpr(new Expr.MemL(value))); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
307 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
308 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
309 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
310 public static void runBinaryRegRegIntTest(Expr expr, int iterations, |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
311 Random rng) { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
312 if (!(expr.isIntExprSupported() |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
313 && expr.isBinaryArgumentSupported())) { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
314 return; |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
315 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
316 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
317 for (int i = 0; i < iterations; i++) { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
318 int aValue = rng.nextInt(); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
319 int bValue = rng.nextInt(); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
320 log("BinaryIntRegReg(0X%x, 0X%x) -> 0X%x", |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
321 aValue, bValue, expr.intExpr(aValue, bValue)); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
322 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
323 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
324 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
325 public static void runBinaryRegMemIntTest(Expr expr, int iterations, |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
326 Random rng) { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
327 if (!(expr.isIntExprSupported() |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
328 && expr.isBinaryArgumentSupported() |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
329 && expr.isMemExprSupported())) { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
330 return; |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
331 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
332 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
333 for (int i = 0; i < iterations; i++) { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
334 int aValue = rng.nextInt(); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
335 int bValue = rng.nextInt(); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
336 log("BinaryIntRegMem(0X%x, 0X%x) -> 0X%x", aValue, bValue, |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
337 expr.intExpr(aValue, new Expr.MemI(bValue))); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
338 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
339 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
340 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
341 public static void runBinaryMemRegIntTest(Expr expr, int iterations, |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
342 Random rng) { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
343 if (!(expr.isIntExprSupported() |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
344 && expr.isBinaryArgumentSupported() |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
345 && expr.isMemExprSupported())) { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
346 return; |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
347 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
348 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
349 for (int i = 0; i < iterations; i++) { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
350 int aValue = rng.nextInt(); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
351 int bValue = rng.nextInt(); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
352 log("BinaryIntMemReg(0X%x, 0X%x) -> 0X%x", aValue, bValue, |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
353 expr.intExpr(new Expr.MemI(aValue), bValue)); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
354 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
355 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
356 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
357 public static void runBinaryMemMemIntTest(Expr expr, int iterations, |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
358 Random rng) { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
359 if (!(expr.isIntExprSupported() |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
360 && expr.isBinaryArgumentSupported() |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
361 && expr.isMemExprSupported())) { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
362 return; |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
363 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
364 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
365 for (int i = 0; i < iterations; i++) { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
366 int aValue = rng.nextInt(); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
367 int bValue = rng.nextInt(); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
368 log("BinaryIntMemMem(0X%x, 0X%x) -> 0X%x", aValue, bValue, |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
369 expr.intExpr(new Expr.MemI(aValue), |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
370 new Expr.MemI(bValue))); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
371 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
372 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
373 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
374 public static void runBinaryRegRegLongTest(Expr expr, |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
375 int iterations, |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
376 Random rng) { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
377 if (!(expr.isLongExprSupported() |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
378 && expr.isBinaryArgumentSupported())) { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
379 return; |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
380 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
381 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
382 for (int i = 0; i < iterations; i++) { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
383 long aValue = rng.nextLong(); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
384 long bValue = rng.nextLong(); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
385 log("BinaryLongRegReg(0X%x, 0X%x) -> 0X%x", aValue, bValue, |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
386 expr.longExpr(aValue, bValue)); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
387 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
388 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
389 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
390 public static void runBinaryRegMemLongTest(Expr expr, |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
391 int iterations, |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
392 Random rng) { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
393 if (!(expr.isLongExprSupported() |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
394 && expr.isBinaryArgumentSupported() |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
395 && expr.isMemExprSupported())) { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
396 return; |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
397 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
398 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
399 for (int i = 0; i < iterations; i++) { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
400 long aValue = rng.nextLong(); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
401 long bValue = rng.nextLong(); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
402 log("BinaryLongRegMem(0X%x, 0X%x) -> 0X%x", aValue, bValue, |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
403 expr.longExpr(aValue, new Expr.MemL(bValue))); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
404 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
405 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
406 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
407 public static void runBinaryMemRegLongTest(Expr expr, |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
408 int iterations, |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
409 Random rng) { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
410 if (!(expr.isLongExprSupported() |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
411 && expr.isBinaryArgumentSupported() |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
412 && expr.isMemExprSupported())) { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
413 return; |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
414 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
415 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
416 for (int i = 0; i < iterations; i++) { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
417 long aValue = rng.nextLong(); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
418 long bValue = rng.nextLong(); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
419 log("BinaryLongMemReg(0X%x, 0X%x) -> 0X%x", aValue, bValue, |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
420 expr.longExpr(new Expr.MemL(aValue), bValue)); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
421 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
422 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
423 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
424 public static void runBinaryMemMemLongTest(Expr expr, |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
425 int iterations, |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
426 Random rng) { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
427 if (!(expr.isLongExprSupported() |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
428 && expr.isBinaryArgumentSupported() |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
429 && expr.isMemExprSupported())) { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
430 return; |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
431 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
432 |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
433 for (int i = 0; i < iterations; i++) { |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
434 long aValue = rng.nextLong(); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
435 long bValue = rng.nextLong(); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
436 log("BinaryLongMemMem(0X%x, 0X%x) -> 0X%x", aValue, bValue, |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
437 expr.longExpr(new Expr.MemL(aValue), |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
438 new Expr.MemL(bValue))); |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
439 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
440 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
441 } |
a48e16541e6b
8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
iignatyev
parents:
diff
changeset
|
442 } |