1 /*
2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
3 * Copyright (c) 2014, Red Hat Inc. 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 *
174 if (auxv & HWCAP_SHA1) {
175 if (FLAG_IS_DEFAULT(UseSHA1Intrinsics)) {
176 FLAG_SET_DEFAULT(UseSHA1Intrinsics, true);
177 }
178 } else if (UseSHA1Intrinsics) {
179 warning("SHA1 instruction is not available on this CPU.");
180 FLAG_SET_DEFAULT(UseSHA1Intrinsics, false);
181 }
182 if (auxv & HWCAP_SHA2) {
183 if (FLAG_IS_DEFAULT(UseSHA256Intrinsics)) {
184 FLAG_SET_DEFAULT(UseSHA256Intrinsics, true);
185 }
186 } else if (UseSHA256Intrinsics) {
187 warning("SHA256 instruction (for SHA-224 and SHA-256) is not available on this CPU.");
188 FLAG_SET_DEFAULT(UseSHA256Intrinsics, false);
189 }
190 if (UseSHA512Intrinsics) {
191 warning("SHA512 instruction (for SHA-384 and SHA-512) is not available on this CPU.");
192 FLAG_SET_DEFAULT(UseSHA512Intrinsics, false);
193 }
194 }
195
196 #ifdef COMPILER2
197 if (FLAG_IS_DEFAULT(OptoScheduling)) {
198 OptoScheduling = true;
199 }
200 #endif
201 }
202
203 void VM_Version::initialize() {
204 ResourceMark rm;
205
206 stub_blob = BufferBlob::create("getPsrInfo_stub", stub_size);
207 if (stub_blob == NULL) {
208 vm_exit_during_initialization("Unable to allocate getPsrInfo_stub");
209 }
210
211 CodeBuffer c(stub_blob);
212 VM_Version_StubGenerator g(&c);
213 getPsrInfo_stub = CAST_TO_FN_PTR(getPsrInfo_stub_t,
|
1 /*
2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
3 * Copyright (c) 2014, 2015, Red Hat Inc. 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 *
174 if (auxv & HWCAP_SHA1) {
175 if (FLAG_IS_DEFAULT(UseSHA1Intrinsics)) {
176 FLAG_SET_DEFAULT(UseSHA1Intrinsics, true);
177 }
178 } else if (UseSHA1Intrinsics) {
179 warning("SHA1 instruction is not available on this CPU.");
180 FLAG_SET_DEFAULT(UseSHA1Intrinsics, false);
181 }
182 if (auxv & HWCAP_SHA2) {
183 if (FLAG_IS_DEFAULT(UseSHA256Intrinsics)) {
184 FLAG_SET_DEFAULT(UseSHA256Intrinsics, true);
185 }
186 } else if (UseSHA256Intrinsics) {
187 warning("SHA256 instruction (for SHA-224 and SHA-256) is not available on this CPU.");
188 FLAG_SET_DEFAULT(UseSHA256Intrinsics, false);
189 }
190 if (UseSHA512Intrinsics) {
191 warning("SHA512 instruction (for SHA-384 and SHA-512) is not available on this CPU.");
192 FLAG_SET_DEFAULT(UseSHA512Intrinsics, false);
193 }
194 }
195
196 if (FLAG_IS_DEFAULT(UseMultiplyToLenIntrinsic)) {
197 UseMultiplyToLenIntrinsic = true;
198 }
199
200 #ifdef COMPILER2
201 if (FLAG_IS_DEFAULT(OptoScheduling)) {
202 OptoScheduling = true;
203 }
204 #endif
205 }
206
207 void VM_Version::initialize() {
208 ResourceMark rm;
209
210 stub_blob = BufferBlob::create("getPsrInfo_stub", stub_size);
211 if (stub_blob == NULL) {
212 vm_exit_during_initialization("Unable to allocate getPsrInfo_stub");
213 }
214
215 CodeBuffer c(stub_blob);
216 VM_Version_StubGenerator g(&c);
217 getPsrInfo_stub = CAST_TO_FN_PTR(getPsrInfo_stub_t,
|