5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 /*
26 * @test
27 * @bug 8304042
28 * @summary Test some examples with independent packs with cyclic dependency
29 * between the packs.
30 * @requires vm.bits == 64
31 * @requires vm.compiler2.enabled
32 * @modules java.base/jdk.internal.misc
33 * @library /test/lib /
34 * @run driver compiler.loopopts.superword.TestIndependentPacksWithCyclicDependency
35 */
36
37 package compiler.loopopts.superword;
38
39 import jdk.internal.misc.Unsafe;
40 import jdk.test.lib.Asserts;
41 import compiler.lib.ir_framework.*;
42
43 public class TestIndependentPacksWithCyclicDependency {
44 static final int RANGE = 1024;
61 float[] goldF6 = new float[RANGE];
62 long[] goldL6 = new long[RANGE];
63 int[] goldI7 = new int[RANGE];
64 float[] goldF7 = new float[RANGE];
65 long[] goldL7 = new long[RANGE];
66 int[] goldI8 = new int[RANGE];
67 float[] goldF8 = new float[RANGE];
68 long[] goldL8 = new long[RANGE];
69 int[] goldI9 = new int[RANGE];
70 float[] goldF9 = new float[RANGE];
71 long[] goldL9 = new long[RANGE];
72 int[] goldI10 = new int[RANGE];
73 float[] goldF10 = new float[RANGE];
74 long[] goldL10 = new long[RANGE];
75
76 public static void main(String args[]) {
77 TestFramework.runWithFlags("--add-modules", "java.base", "--add-exports", "java.base/jdk.internal.misc=ALL-UNNAMED",
78 "-XX:CompileCommand=compileonly,compiler.loopopts.superword.TestIndependentPacksWithCyclicDependency::test*",
79 "-XX:CompileCommand=compileonly,compiler.loopopts.superword.TestIndependentPacksWithCyclicDependency::verify",
80 "-XX:CompileCommand=compileonly,compiler.loopopts.superword.TestIndependentPacksWithCyclicDependency::init",
81 "-XX:LoopUnrollLimit=1000");
82 }
83
84 TestIndependentPacksWithCyclicDependency() {
85 // compute the gold standard in interpreter mode
86 init(goldI0, goldF0);
87 test0(goldI0, goldI0, goldF0, goldF0);
88 init(goldI1, goldF1);
89 test1(goldI1, goldI1, goldF1, goldF1);
90 init(goldI2, goldF2);
91 test2(goldI2, goldI2, goldF2, goldF2);
92 init(goldI3, goldF3);
93 test3(goldI3, goldI3, goldF3, goldF3);
94 init(goldI4, goldF4);
95 test4(goldI4, goldI4, goldF4, goldF4);
96 init(goldI5, goldF5);
97 test5(goldI5, goldI5, goldF5, goldF5);
98 init(goldI6, goldF6, goldL6);
99 test6(goldI6, goldI6, goldF6, goldF6, goldL6, goldL6);
100 init(goldI7, goldF7, goldL7);
101 test7(goldI7, goldI7, goldF7, goldF7, goldL7, goldL7);
|
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 // Note Lilliput:
26 // Tests rely on array members starting at the same offset, otherwise vectorization does not kick in. Not true
27 // for Lilliput.
28 // For now I just enforce -CompactObjectHeaders.
29
30 /*
31 * @test
32 * @bug 8304042
33 * @summary Test some examples with independent packs with cyclic dependency
34 * between the packs.
35 * @requires vm.bits == 64
36 * @requires vm.compiler2.enabled
37 * @modules java.base/jdk.internal.misc
38 * @library /test/lib /
39 * @run driver compiler.loopopts.superword.TestIndependentPacksWithCyclicDependency
40 */
41
42 package compiler.loopopts.superword;
43
44 import jdk.internal.misc.Unsafe;
45 import jdk.test.lib.Asserts;
46 import compiler.lib.ir_framework.*;
47
48 public class TestIndependentPacksWithCyclicDependency {
49 static final int RANGE = 1024;
66 float[] goldF6 = new float[RANGE];
67 long[] goldL6 = new long[RANGE];
68 int[] goldI7 = new int[RANGE];
69 float[] goldF7 = new float[RANGE];
70 long[] goldL7 = new long[RANGE];
71 int[] goldI8 = new int[RANGE];
72 float[] goldF8 = new float[RANGE];
73 long[] goldL8 = new long[RANGE];
74 int[] goldI9 = new int[RANGE];
75 float[] goldF9 = new float[RANGE];
76 long[] goldL9 = new long[RANGE];
77 int[] goldI10 = new int[RANGE];
78 float[] goldF10 = new float[RANGE];
79 long[] goldL10 = new long[RANGE];
80
81 public static void main(String args[]) {
82 TestFramework.runWithFlags("--add-modules", "java.base", "--add-exports", "java.base/jdk.internal.misc=ALL-UNNAMED",
83 "-XX:CompileCommand=compileonly,compiler.loopopts.superword.TestIndependentPacksWithCyclicDependency::test*",
84 "-XX:CompileCommand=compileonly,compiler.loopopts.superword.TestIndependentPacksWithCyclicDependency::verify",
85 "-XX:CompileCommand=compileonly,compiler.loopopts.superword.TestIndependentPacksWithCyclicDependency::init",
86 "-XX:LoopUnrollLimit=1000", "-XX:+UnlockExperimentalVMOptions", "-XX:-UseCompactObjectHeaders");
87 }
88
89 TestIndependentPacksWithCyclicDependency() {
90 // compute the gold standard in interpreter mode
91 init(goldI0, goldF0);
92 test0(goldI0, goldI0, goldF0, goldF0);
93 init(goldI1, goldF1);
94 test1(goldI1, goldI1, goldF1, goldF1);
95 init(goldI2, goldF2);
96 test2(goldI2, goldI2, goldF2, goldF2);
97 init(goldI3, goldF3);
98 test3(goldI3, goldI3, goldF3, goldF3);
99 init(goldI4, goldF4);
100 test4(goldI4, goldI4, goldF4, goldF4);
101 init(goldI5, goldF5);
102 test5(goldI5, goldI5, goldF5, goldF5);
103 init(goldI6, goldF6, goldL6);
104 test6(goldI6, goldI6, goldF6, goldF6, goldL6, goldL6);
105 init(goldI7, goldF7, goldL7);
106 test7(goldI7, goldI7, goldF7, goldF7, goldL7, goldL7);
|