< prev index next >

test/compiler/intrinsics/bmi/verifycode/LZcntTestI.java

Print this page
rev 8994 : 8134579: [TESTBUG] Some bmi tests fail if can_access_local_variables is on.
Summary: Others fail because of uncommon trap. Also fix test file names.


  33  * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  34  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCountLeadingZerosInstruction LZcntTestI
  35  */
  36 
  37 import java.lang.reflect.Method;
  38 
  39 public class LZcntTestI extends BmiIntrinsicBase.BmiTestCase_x64 {
  40 
  41     protected LZcntTestI(Method method) {
  42         super(method);
  43         instrMask = new byte[]{(byte) 0xFF, (byte) 0xFF, (byte) 0xFF};
  44         instrPattern = new byte[]{(byte) 0xF3, (byte) 0x0F, (byte) 0xBD};
  45 
  46         instrMask_x64 = new byte[]{(byte) 0xFF, (byte) 0x00, (byte) 0xFF, (byte) 0xFF};
  47         instrPattern_x64 = new byte[]{(byte) 0xF3, (byte) 0x00, (byte) 0x0F, (byte) 0xBD};
  48     }
  49 
  50     public static void main(String[] args) throws Exception {
  51         // j.l.Integer and Long should be loaded to allow a compilation of the methods that use their methods
  52         System.out.println("class java.lang.Integer should be loaded. Proof: " + Integer.class);


  53         BmiIntrinsicBase.verifyTestCase(LZcntTestI::new, TestLzcntI.LzcntIExpr.class.getDeclaredMethods());
  54     }
  55 
  56     @Override
  57     protected String getVMFlag() {
  58         return "UseCountLeadingZerosInstruction";
  59     }
  60 
  61     @Override
  62     protected String getCpuFlag() {
  63         return "lzcnt";
  64     }
  65 }


  33  * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  34  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCountLeadingZerosInstruction LZcntTestI
  35  */
  36 
  37 import java.lang.reflect.Method;
  38 
  39 public class LZcntTestI extends BmiIntrinsicBase.BmiTestCase_x64 {
  40 
  41     protected LZcntTestI(Method method) {
  42         super(method);
  43         instrMask = new byte[]{(byte) 0xFF, (byte) 0xFF, (byte) 0xFF};
  44         instrPattern = new byte[]{(byte) 0xF3, (byte) 0x0F, (byte) 0xBD};
  45 
  46         instrMask_x64 = new byte[]{(byte) 0xFF, (byte) 0x00, (byte) 0xFF, (byte) 0xFF};
  47         instrPattern_x64 = new byte[]{(byte) 0xF3, (byte) 0x00, (byte) 0x0F, (byte) 0xBD};
  48     }
  49 
  50     public static void main(String[] args) throws Exception {
  51         // j.l.Integer and Long should be loaded to allow a compilation of the methods that use their methods
  52         System.out.println("class java.lang.Integer should be loaded. Proof: " + Integer.class);
  53         // Avoid uncommon traps.
  54         System.out.println("Num leading zeroes: " + new TestLzcntI.LzcntIExpr().intExpr(12341341));
  55         BmiIntrinsicBase.verifyTestCase(LZcntTestI::new, TestLzcntI.LzcntIExpr.class.getDeclaredMethods());
  56     }
  57 
  58     @Override
  59     protected String getVMFlag() {
  60         return "UseCountLeadingZerosInstruction";
  61     }
  62 
  63     @Override
  64     protected String getCpuFlag() {
  65         return "lzcnt";
  66     }
  67 }
< prev index next >