Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/hotspot/jtreg/compiler/intrinsics/sha/sanity/TestSHA3MultiBlockIntrinsics.java
41161 views
1
/*
2
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
3
* Copyright (c) 2020, Huawei Technologies Co., Ltd. All rights reserved.
4
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5
*
6
* This code is free software; you can redistribute it and/or modify it
7
* under the terms of the GNU General Public License version 2 only, as
8
* published by the Free Software Foundation.
9
*
10
* This code is distributed in the hope that it will be useful, but WITHOUT
11
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13
* version 2 for more details (a copy is included in the LICENSE file that
14
* accompanied this code).
15
*
16
* You should have received a copy of the GNU General Public License version
17
* 2 along with this work; if not, write to the Free Software Foundation,
18
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19
*
20
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21
* or visit www.oracle.com if you need additional information or have any
22
* questions.
23
*/
24
25
/**
26
* @test
27
* @bug 8252204
28
* @summary Verify that SHA3-224, SHA3-256, SHA3-384, SHA3-512 multi block intrinsic is actually used.
29
*
30
* @library /test/lib /
31
* @modules java.base/jdk.internal.misc
32
* java.management
33
*
34
* @build sun.hotspot.WhiteBox
35
* @run driver jdk.test.lib.helpers.ClassFileInstaller sun.hotspot.WhiteBox
36
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
37
* -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500
38
* -XX:Tier4InvocationThreshold=500
39
* -XX:+LogCompilation -XX:LogFile=positive_224.log
40
* -XX:CompileOnly=sun/security/provider/DigestBase
41
* -XX:CompileOnly=sun/security/provider/SHA3
42
* -XX:+UseSHA3Intrinsics -XX:-UseMD5Intrinsics
43
* -XX:-UseSHA1Intrinsics -XX:-UseSHA256Intrinsics
44
* -XX:-UseSHA512Intrinsics -Dalgorithm=SHA3-224
45
* compiler.intrinsics.sha.sanity.TestSHA3MultiBlockIntrinsics
46
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
47
* -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500
48
* -XX:Tier4InvocationThreshold=500
49
* -XX:+LogCompilation -XX:LogFile=positive_224_def.log
50
* -XX:CompileOnly=sun/security/provider/DigestBase
51
* -XX:CompileOnly=sun/security/provider/SHA3
52
* -XX:+UseSHA3Intrinsics -Dalgorithm=SHA3-224
53
* compiler.intrinsics.sha.sanity.TestSHA3MultiBlockIntrinsics
54
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
55
* -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500
56
* -XX:Tier4InvocationThreshold=500
57
* -XX:+LogCompilation -XX:LogFile=negative_224.log
58
* -XX:CompileOnly=sun/security/provider/DigestBase
59
* -XX:CompileOnly=sun/security/provider/SHA3 -XX:-UseSHA
60
* -Dalgorithm=SHA3-224
61
* compiler.intrinsics.sha.sanity.TestSHA3MultiBlockIntrinsics
62
*
63
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
64
* -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500
65
* -XX:Tier4InvocationThreshold=500
66
* -XX:+LogCompilation -XX:LogFile=positive_256.log
67
* -XX:CompileOnly=sun/security/provider/DigestBase
68
* -XX:CompileOnly=sun/security/provider/SHA3
69
* -XX:+UseSHA3Intrinsics -XX:-UseMD5Intrinsics
70
* -XX:-UseSHA1Intrinsics -XX:-UseSHA256Intrinsics
71
* -XX:-UseSHA512Intrinsics -Dalgorithm=SHA3-256
72
* compiler.intrinsics.sha.sanity.TestSHA3MultiBlockIntrinsics
73
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
74
* -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500
75
* -XX:Tier4InvocationThreshold=500
76
* -XX:+LogCompilation -XX:LogFile=positive_256_def.log
77
* -XX:CompileOnly=sun/security/provider/DigestBase
78
* -XX:CompileOnly=sun/security/provider/SHA3
79
* -XX:+UseSHA3Intrinsics -Dalgorithm=SHA3-256
80
* compiler.intrinsics.sha.sanity.TestSHA3MultiBlockIntrinsics
81
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
82
* -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500
83
* -XX:Tier4InvocationThreshold=500
84
* -XX:+LogCompilation -XX:LogFile=negative_256.log
85
* -XX:CompileOnly=sun/security/provider/DigestBase
86
* -XX:CompileOnly=sun/security/provider/SHA3 -XX:-UseSHA
87
* -Dalgorithm=SHA3-256
88
* compiler.intrinsics.sha.sanity.TestSHA3MultiBlockIntrinsics
89
*
90
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
91
* -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500
92
* -XX:Tier4InvocationThreshold=500
93
* -XX:+LogCompilation -XX:LogFile=positive_384.log
94
* -XX:CompileOnly=sun/security/provider/DigestBase
95
* -XX:CompileOnly=sun/security/provider/SHA3
96
* -XX:+UseSHA3Intrinsics -XX:-UseMD5Intrinsics
97
* -XX:-UseSHA1Intrinsics -XX:-UseSHA256Intrinsics
98
* -XX:-UseSHA512Intrinsics -Dalgorithm=SHA3-384
99
* compiler.intrinsics.sha.sanity.TestSHA3MultiBlockIntrinsics
100
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
101
* -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500
102
* -XX:Tier4InvocationThreshold=500
103
* -XX:+LogCompilation -XX:LogFile=positive_384_def.log
104
* -XX:CompileOnly=sun/security/provider/DigestBase
105
* -XX:CompileOnly=sun/security/provider/SHA3
106
* -XX:+UseSHA3Intrinsics -Dalgorithm=SHA3-384
107
* compiler.intrinsics.sha.sanity.TestSHA3MultiBlockIntrinsics
108
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
109
* -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500
110
* -XX:Tier4InvocationThreshold=500
111
* -XX:+LogCompilation -XX:LogFile=negative_384.log
112
* -XX:CompileOnly=sun/security/provider/DigestBase
113
* -XX:CompileOnly=sun/security/provider/SHA3 -XX:-UseSHA
114
* -Dalgorithm=SHA3-384
115
* compiler.intrinsics.sha.sanity.TestSHA3MultiBlockIntrinsics
116
*
117
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
118
* -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500
119
* -XX:Tier4InvocationThreshold=500
120
* -XX:+LogCompilation -XX:LogFile=positive_512.log
121
* -XX:CompileOnly=sun/security/provider/DigestBase
122
* -XX:CompileOnly=sun/security/provider/SHA3
123
* -XX:+UseSHA3Intrinsics -XX:-UseMD5Intrinsics
124
* -XX:-UseSHA1Intrinsics -XX:-UseSHA256Intrinsics
125
* -XX:-UseSHA512Intrinsics -Dalgorithm=SHA3-512
126
* compiler.intrinsics.sha.sanity.TestSHA3MultiBlockIntrinsics
127
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
128
* -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500
129
* -XX:Tier4InvocationThreshold=500
130
* -XX:+LogCompilation -XX:LogFile=positive_512_def.log
131
* -XX:CompileOnly=sun/security/provider/DigestBase
132
* -XX:CompileOnly=sun/security/provider/SHA3
133
* -XX:+UseSHA3Intrinsics -Dalgorithm=SHA3-512
134
* compiler.intrinsics.sha.sanity.TestSHA3MultiBlockIntrinsics
135
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
136
* -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500
137
* -XX:Tier4InvocationThreshold=500
138
* -XX:+LogCompilation -XX:LogFile=negative_512.log
139
* -XX:CompileOnly=sun/security/provider/DigestBase
140
* -XX:CompileOnly=sun/security/provider/SHA3 -XX:-UseSHA
141
* -Dalgorithm=SHA3-512
142
* compiler.intrinsics.sha.sanity.TestSHA3MultiBlockIntrinsics
143
* @run main/othervm -DverificationStrategy=VERIFY_INTRINSIC_USAGE
144
* compiler.testlibrary.intrinsics.Verifier positive_224.log positive_256.log
145
* positive_384.log positive_512.log positive_224_def.log positive_256_def.log
146
* positive_384_def.log positive_512_def.log negative_224.log negative_256.log
147
* negative_384.log negative_512.log
148
*/
149
150
package compiler.intrinsics.sha.sanity;
151
152
import compiler.testlibrary.sha.predicate.IntrinsicPredicates;
153
154
public class TestSHA3MultiBlockIntrinsics {
155
public static void main(String args[]) throws Exception {
156
new DigestSanityTestBase(IntrinsicPredicates.isSHA3IntrinsicAvailable(),
157
DigestSanityTestBase.MB_INTRINSIC_ID).test();
158
}
159
}
160
161