author | weijun |
Wed, 12 Mar 2014 14:18:01 +0800 | |
changeset 23339 | d66b18f52418 |
parent 22214 | c551021e75b2 |
child 26437 | b6e75523f59b |
permissions | -rw-r--r-- |
22214
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
1 |
/* |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
2 |
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
4 |
* |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
8 |
* |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
13 |
* accompanied this code). |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
14 |
* |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
18 |
* |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
21 |
* questions. |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
22 |
*/ |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
23 |
|
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
24 |
import com.oracle.java.testlibrary.Platform; |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
25 |
|
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
26 |
import java.io.FileOutputStream; |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
27 |
import java.lang.reflect.Executable; |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
28 |
import java.util.Properties; |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
29 |
|
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
30 |
public abstract class IntrinsicBase extends CompilerWhiteBoxTest { |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
31 |
protected String javaVmName; |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
32 |
protected String useMathExactIntrinsics; |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
33 |
|
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
34 |
protected IntrinsicBase(TestCase testCase) { |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
35 |
super(testCase); |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
36 |
javaVmName = System.getProperty("java.vm.name"); |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
37 |
useMathExactIntrinsics = getVMOption("UseMathExactIntrinsics"); |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
38 |
} |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
39 |
|
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
40 |
@Override |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
41 |
protected void test() throws Exception { |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
42 |
//java.lang.Math should be loaded to allow a compilation of the methods that use Math's method |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
43 |
System.out.println("class java.lang.Math should be loaded. Proof: " + Math.class); |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
44 |
printEnvironmentInfo(); |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
45 |
|
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
46 |
int expectedIntrinsicCount = 0; |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
47 |
|
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
48 |
switch (MODE) { |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
49 |
case "compiled mode": |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
50 |
case "mixed mode": |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
51 |
if (isServerVM()) { |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
52 |
if (TIERED_COMPILATION) { |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
53 |
int max_level = TIERED_STOP_AT_LEVEL; |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
54 |
expectedIntrinsicCount = (max_level == COMP_LEVEL_MAX) ? 1 : 0; |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
55 |
for (int i = CompilerWhiteBoxTest.COMP_LEVEL_SIMPLE; i <= max_level; ++i) { |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
56 |
deoptimize(); |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
57 |
compileAtLevel(i); |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
58 |
} |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
59 |
} else { |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
60 |
expectedIntrinsicCount = 1; |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
61 |
deoptimize(); |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
62 |
compileAtLevel(CompilerWhiteBoxTest.COMP_LEVEL_MAX); |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
63 |
} |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
64 |
} else { |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
65 |
deoptimize(); |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
66 |
compileAtLevel(CompilerWhiteBoxTest.COMP_LEVEL_SIMPLE); |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
67 |
} |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
68 |
|
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
69 |
if (!isIntrinsicSupported()) { |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
70 |
expectedIntrinsicCount = 0; |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
71 |
} |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
72 |
break; |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
73 |
case "interpreted mode": //test is not applicable in this mode; |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
74 |
System.err.println("Warning: This test is not applicable in mode: " + MODE); |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
75 |
break; |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
76 |
default: |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
77 |
throw new RuntimeException("Test bug, unknown VM mode: " + MODE); |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
78 |
} |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
79 |
|
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
80 |
System.out.println("Expected intrinsic count is " + expectedIntrinsicCount + " name " + getIntrinsicId()); |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
81 |
|
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
82 |
final FileOutputStream out = new FileOutputStream(getVMOption("LogFile") + ".verify.properties"); |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
83 |
Properties expectedProps = new Properties(); |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
84 |
expectedProps.setProperty("intrinsic.name", getIntrinsicId()); |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
85 |
expectedProps.setProperty("intrinsic.expectedCount", String.valueOf(expectedIntrinsicCount)); |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
86 |
expectedProps.store(out, null); |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
87 |
|
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
88 |
out.close(); |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
89 |
} |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
90 |
|
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
91 |
protected void printEnvironmentInfo() { |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
92 |
System.out.println("java.vm.name=" + javaVmName); |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
93 |
System.out.println("os.arch=" + Platform.getOsArch()); |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
94 |
System.out.println("java.vm.info=" + MODE); |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
95 |
System.out.println("useMathExactIntrinsics=" + useMathExactIntrinsics); |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
96 |
} |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
97 |
|
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
98 |
protected void compileAtLevel(int level) { |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
99 |
WHITE_BOX.enqueueMethodForCompilation(method, level); |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
100 |
waitBackgroundCompilation(); |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
101 |
checkCompilation(method, level); |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
102 |
} |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
103 |
|
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
104 |
protected void checkCompilation(Executable executable, int level) { |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
105 |
if (!WHITE_BOX.isMethodCompiled(executable)) { |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
106 |
throw new RuntimeException("Test bug, expected compilation (level): " + level + ", but not compiled"); |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
107 |
} |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
108 |
final int compilationLevel = WHITE_BOX.getMethodCompilationLevel(executable); |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
109 |
if (compilationLevel != level) { |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
110 |
if (!(TIERED_COMPILATION && level == COMP_LEVEL_FULL_PROFILE && compilationLevel == COMP_LEVEL_LIMITED_PROFILE)) { //possible case |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
111 |
throw new RuntimeException("Test bug, expected compilation (level): " + level + ", but level: " + compilationLevel); |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
112 |
} |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
113 |
} |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
114 |
} |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
115 |
|
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
116 |
protected abstract boolean isIntrinsicSupported(); |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
117 |
|
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
118 |
protected abstract String getIntrinsicId(); |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
119 |
|
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
120 |
protected boolean isServerVM() { |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
121 |
return javaVmName.toLowerCase().contains("server"); |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
122 |
} |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
123 |
|
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
124 |
static class IntTest extends IntrinsicBase { |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
125 |
protected IntTest(MathIntrinsic.IntIntrinsic testCase) { |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
126 |
super(testCase); |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
127 |
} |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
128 |
|
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
129 |
@Override |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
130 |
protected boolean isIntrinsicSupported() { |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
131 |
return isServerVM() && Boolean.valueOf(useMathExactIntrinsics) && (Platform.isX86() || Platform.isX64()); |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
132 |
} |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
133 |
|
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
134 |
@Override |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
135 |
protected String getIntrinsicId() { |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
136 |
return "_" + testCase.name().toLowerCase() + "ExactI"; |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
137 |
} |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
138 |
} |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
139 |
|
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
140 |
static class LongTest extends IntrinsicBase { |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
141 |
protected LongTest(MathIntrinsic.LongIntrinsic testCase) { |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
142 |
super(testCase); |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
143 |
} |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
144 |
|
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
145 |
@Override |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
146 |
protected boolean isIntrinsicSupported() { |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
147 |
return isServerVM() && Boolean.valueOf(useMathExactIntrinsics) && Platform.isX64(); |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
148 |
} |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
149 |
|
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
150 |
@Override |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
151 |
protected String getIntrinsicId() { |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
152 |
return "_" + testCase.name().toLowerCase() + "ExactL"; |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
153 |
} |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
154 |
} |
c551021e75b2
8028587: New tests development for intrisics for basic operators - add, neg, inc, dec, sub, mul
iignatyev
parents:
diff
changeset
|
155 |
} |