Path: blob/master/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/BzhiTestI2L.java
41161 views
/*1* Copyright (c) 2021, 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*/2223/*24* @test25* @requires vm.simpleArch == "x64" & vm.flavor == "server" & !vm.emulatedClient & !vm.graal.enabled26* @library /test/lib /27* @modules java.base/jdk.internal.misc28* java.management29*30* @build sun.hotspot.WhiteBox31* @run driver jdk.test.lib.helpers.ClassFileInstaller sun.hotspot.WhiteBox32* @run main/bootclasspath/othervm -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:+AbortVMOnCompilationFailure33* -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI2Instructions34* compiler.intrinsics.bmi.verifycode.BzhiTestI2L35*/3637package compiler.intrinsics.bmi.verifycode;3839import compiler.intrinsics.bmi.TestBzhiI2L;4041import java.lang.reflect.Method;4243public class BzhiTestI2L extends BmiIntrinsicBase.BmiTestCase_x64 {4445protected BzhiTestI2L(Method method) {46super(method);4748cpuFlag = "bmi2";49vmFlag = "UseBMI2Instructions";50isLongOperation = true;5152// from intel manual VEX.LZ.0F38.W1 F5 /r53instrMask = new byte[]{54(byte) 0xFF,55(byte) 0x1F,56(byte) 0x80,57(byte) 0xFF};58instrPattern = new byte[]{59(byte) 0xC4, // prefix for 3-byte VEX instruction60(byte) 0x02, // 00010 implied 0F 38 leading opcode bytes61(byte) 0x80,62(byte) 0xF5};6364instrMask_x64 = new byte[]{65(byte) 0xFF,66(byte) 0x7F,67(byte) 0xFF,68(byte) 0xFF};69instrPattern_x64 = new byte[]{70(byte) 0xC4, // prefix for 3-byte VEX instruction71(byte) 0x62, // 00010 implied 0F 38 leading opcode bytes72(byte) 0xA8,73(byte) 0xF5};74}7576public static void main(String[] args) throws Exception {77BmiIntrinsicBase.verifyTestCase(BzhiTestI2L::new, TestBzhiI2L.BzhiI2LExpr.class.getDeclaredMethods());78BmiIntrinsicBase.verifyTestCase(BzhiTestI2L::new, TestBzhiI2L.BzhiI2LCommutativeExpr.class.getDeclaredMethods());79}80}818283