Path: blob/master/test/hotspot/jtreg/compiler/cpuflags/AESIntrinsicsBase.java
41152 views
/*1* Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/2223package compiler.cpuflags;2425import compiler.codegen.aes.TestAESMain;26import java.util.Arrays;2728public abstract class AESIntrinsicsBase {29public static final String CIPHER_INTRINSIC = "com\\.sun\\.crypto\\"30+ ".provider\\.CipherBlockChaining::"31+ "(implEncrypt|implDecrypt) \\([0-9]+ bytes\\)\\s+\\(intrinsic[,\\)]";32public static final String AES_INTRINSIC = "com\\.sun\\.crypto\\"33+ ".provider\\.AESCrypt::(implEncryptBlock|implDecryptBlock) \\([0-9]+ "34+ "bytes\\)\\s+\\(intrinsic[,\\)]";35public static final String USE_AES = "UseAES";36public static final String USE_AES_INTRINSICS = "UseAESIntrinsics";37public static final String USE_SSE = "UseSSE";38public static final String[] USE_DIAGNOSTIC_CMD39= {"-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintIntrinsics"};40public static final String[] TEST_AES_CMD41= {"-XX:+IgnoreUnrecognizedVMOptions", "-XX:+PrintFlagsFinal",42"-Xbatch", "-XX:CompileThresholdScaling=0.01", "-DcheckOutput=true", "-Dmode=CBC",43TestAESMain.class.getName(), "100", "1000"};4445/**46* Prepares command for TestAESMain execution.47* Intrinsics flags are of diagnostic type48* and must be preceded by UnlockDiagnosticVMOptions.49* @param args flags that must be added to command50* @return command for TestAESMain execution51*/52public static String[] prepareArguments(String... args) {53String[] command = Arrays.copyOf(USE_DIAGNOSTIC_CMD, args.length54+ USE_DIAGNOSTIC_CMD.length + TEST_AES_CMD.length);55System.arraycopy(args, 0, command, USE_DIAGNOSTIC_CMD.length,56args.length);57System.arraycopy(TEST_AES_CMD, 0, command, args.length58+ USE_DIAGNOSTIC_CMD.length, TEST_AES_CMD.length);59return command;60}61}626364