8134579: [TESTBUG] Some bmi tests fail if can_access_local_variables is on.

Mon, 17 Feb 2020 08:53:34 +0000

author
sgehwolf
date
Mon, 17 Feb 2020 08:53:34 +0000
changeset 9830
fc8a3d56cd0c
parent 9828
6021152f9ff3
child 9831
2e9728044507

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.
Reviewed-by: roland, andrew

test/compiler/intrinsics/bmi/TestAndnI.java file | annotate | diff | comparison | revisions
test/compiler/intrinsics/bmi/TestAndnL.java file | annotate | diff | comparison | revisions
test/compiler/intrinsics/bmi/verifycode/AddnTestI.java file | annotate | diff | comparison | revisions
test/compiler/intrinsics/bmi/verifycode/AddnTestL.java file | annotate | diff | comparison | revisions
test/compiler/intrinsics/bmi/verifycode/AndnTestI.java file | annotate | diff | comparison | revisions
test/compiler/intrinsics/bmi/verifycode/AndnTestL.java file | annotate | diff | comparison | revisions
test/compiler/intrinsics/bmi/verifycode/LZcntTestI.java file | annotate | diff | comparison | revisions
test/compiler/intrinsics/bmi/verifycode/LZcntTestL.java file | annotate | diff | comparison | revisions
test/compiler/intrinsics/bmi/verifycode/TZcntTestI.java file | annotate | diff | comparison | revisions
test/compiler/intrinsics/bmi/verifycode/TZcntTestL.java file | annotate | diff | comparison | revisions
     1.1 --- a/test/compiler/intrinsics/bmi/TestAndnI.java	Mon Feb 03 06:40:55 2020 +0000
     1.2 +++ b/test/compiler/intrinsics/bmi/TestAndnI.java	Mon Feb 17 08:53:34 2020 +0000
     1.3 @@ -58,15 +58,27 @@
     1.4          }
     1.5  
     1.6          public int intExpr(int src1, Expr.MemI src2) {
     1.7 -            return ~src1 & src2.value;
     1.8 +            if (src2 != null) {
     1.9 +                return ~src1 & src2.value;
    1.10 +            } else {
    1.11 +                return 0;
    1.12 +            }
    1.13          }
    1.14  
    1.15          public int intExpr(Expr.MemI src1, int src2) {
    1.16 -            return ~src1.value & src2;
    1.17 +            if (src1 != null) {
    1.18 +                return ~src1.value & src2;
    1.19 +            } else {
    1.20 +                return 0;
    1.21 +            }
    1.22          }
    1.23  
    1.24          public int intExpr(Expr.MemI src1, Expr.MemI src2) {
    1.25 -            return ~src1.value & src2.value;
    1.26 +            if (src1 != null && src2 != null) {
    1.27 +                return ~src1.value & src2.value;
    1.28 +            } else {
    1.29 +                return 0;
    1.30 +            }
    1.31          }
    1.32      }
    1.33  
    1.34 @@ -77,15 +89,27 @@
    1.35          }
    1.36  
    1.37          public int intExpr(int src1, Expr.MemI src2) {
    1.38 -            return src1 & ~src2.value;
    1.39 +            if (src2 != null) {
    1.40 +                return src1 & ~src2.value;
    1.41 +            } else {
    1.42 +                return 0;
    1.43 +            }
    1.44          }
    1.45  
    1.46          public int intExpr(Expr.MemI src1, int src2) {
    1.47 -            return src1.value & ~src2;
    1.48 +            if (src1 != null) {
    1.49 +                return src1.value & ~src2;
    1.50 +            } else {
    1.51 +                return 0;
    1.52 +            }
    1.53          }
    1.54  
    1.55          public int intExpr(Expr.MemI src1, Expr.MemI src2) {
    1.56 -            return src1.value & ~src2.value;
    1.57 +            if (src1 != null && src2 != null) {
    1.58 +                return src1.value & ~src2.value;
    1.59 +            } else {
    1.60 +                return 0;
    1.61 +            }
    1.62          }
    1.63      }
    1.64  }
     2.1 --- a/test/compiler/intrinsics/bmi/TestAndnL.java	Mon Feb 03 06:40:55 2020 +0000
     2.2 +++ b/test/compiler/intrinsics/bmi/TestAndnL.java	Mon Feb 17 08:53:34 2020 +0000
     2.3 @@ -58,15 +58,27 @@
     2.4          }
     2.5  
     2.6          public long longExpr(long src1, Expr.MemL src2) {
     2.7 -            return ~src1 & src2.value;
     2.8 +            if (src2 != null) {
     2.9 +                return ~src1 & src2.value;
    2.10 +            } else {
    2.11 +                return 0;
    2.12 +            }
    2.13          }
    2.14  
    2.15          public long longExpr(Expr.MemL src1, long src2) {
    2.16 -            return ~src1.value & src2;
    2.17 +            if (src1 != null) {
    2.18 +                return ~src1.value & src2;
    2.19 +            } else {
    2.20 +                return 0;
    2.21 +            }
    2.22          }
    2.23  
    2.24          public long longExpr(Expr.MemL src1, Expr.MemL src2) {
    2.25 -            return ~src1.value & src2.value;
    2.26 +            if (src1 != null && src2 != null) {
    2.27 +                return ~src1.value & src2.value;
    2.28 +            } else {
    2.29 +                return 0;
    2.30 +            }
    2.31          }
    2.32  
    2.33  
    2.34 @@ -79,15 +91,27 @@
    2.35          }
    2.36  
    2.37          public long longExpr(long src1, Expr.MemL src2) {
    2.38 -            return src1 & ~src2.value;
    2.39 +            if (src2 != null) {
    2.40 +                return src1 & ~src2.value;
    2.41 +            } else {
    2.42 +                return 0;
    2.43 +            }
    2.44          }
    2.45  
    2.46          public long longExpr(Expr.MemL src1, long src2) {
    2.47 -            return src1.value & ~src2;
    2.48 +            if (src1 != null) {
    2.49 +                return src1.value & ~src2;
    2.50 +            } else {
    2.51 +                return 0;
    2.52 +            }
    2.53          }
    2.54  
    2.55          public long longExpr(Expr.MemL src1, Expr.MemL src2) {
    2.56 -            return src1.value & ~src2.value;
    2.57 +            if (src1 != null && src2 != null) {
    2.58 +                return src1.value & ~src2.value;
    2.59 +            } else {
    2.60 +                return 0;
    2.61 +            }
    2.62          }
    2.63  
    2.64      }
     3.1 --- a/test/compiler/intrinsics/bmi/verifycode/AddnTestI.java	Mon Feb 03 06:40:55 2020 +0000
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,57 +0,0 @@
     3.4 -/*
     3.5 - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
     3.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3.7 - *
     3.8 - * This code is free software; you can redistribute it and/or modify it
     3.9 - * under the terms of the GNU General Public License version 2 only, as
    3.10 - * published by the Free Software Foundation.
    3.11 - *
    3.12 - * This code is distributed in the hope that it will be useful, but WITHOUT
    3.13 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    3.14 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    3.15 - * version 2 for more details (a copy is included in the LICENSE file that
    3.16 - * accompanied this code).
    3.17 - *
    3.18 - * You should have received a copy of the GNU General Public License version
    3.19 - * 2 along with this work; if not, write to the Free Software Foundation,
    3.20 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    3.21 - *
    3.22 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    3.23 - * or visit www.oracle.com if you need additional information or have any
    3.24 - * questions.
    3.25 - */
    3.26 -
    3.27 -/*
    3.28 - * @test
    3.29 - * @bug 8031321
    3.30 - * @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
    3.31 - * @build AddnTestI
    3.32 - * @run main ClassFileInstaller sun.hotspot.WhiteBox
    3.33 - * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
    3.34 - *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions AddnTestI
    3.35 - */
    3.36 -
    3.37 -import java.lang.reflect.Method;
    3.38 -
    3.39 -public class AddnTestI extends BmiIntrinsicBase.BmiTestCase {
    3.40 -
    3.41 -    protected AddnTestI(Method method) {
    3.42 -        super(method);
    3.43 -        // from intel manual VEX.NDS.LZ.0F38.W0 F2 /r, example c4e260f2c2
    3.44 -        instrMask = new byte[]{
    3.45 -                (byte) 0xFF,
    3.46 -                (byte) 0x1F,
    3.47 -                (byte) 0x00,
    3.48 -                (byte) 0xFF};
    3.49 -        instrPattern = new byte[]{
    3.50 -                (byte) 0xC4, // prefix for 3-byte VEX instruction
    3.51 -                (byte) 0x02, // 00010 implied 0F 38 leading opcode bytes
    3.52 -                (byte) 0x00,
    3.53 -                (byte) 0xF2};
    3.54 -    }
    3.55 -
    3.56 -    public static void main(String[] args) throws Exception {
    3.57 -        BmiIntrinsicBase.verifyTestCase(AddnTestI::new, TestAndnI.AndnIExpr.class.getDeclaredMethods());
    3.58 -        BmiIntrinsicBase.verifyTestCase(AddnTestI::new, TestAndnI.AndnICommutativeExpr.class.getDeclaredMethods());
    3.59 -    }
    3.60 -}
     4.1 --- a/test/compiler/intrinsics/bmi/verifycode/AddnTestL.java	Mon Feb 03 06:40:55 2020 +0000
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,47 +0,0 @@
     4.4 -/*
     4.5 - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
     4.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4.7 - *
     4.8 - * This code is free software; you can redistribute it and/or modify it
     4.9 - * under the terms of the GNU General Public License version 2 only, as
    4.10 - * published by the Free Software Foundation.
    4.11 - *
    4.12 - * This code is distributed in the hope that it will be useful, but WITHOUT
    4.13 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    4.14 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    4.15 - * version 2 for more details (a copy is included in the LICENSE file that
    4.16 - * accompanied this code).
    4.17 - *
    4.18 - * You should have received a copy of the GNU General Public License version
    4.19 - * 2 along with this work; if not, write to the Free Software Foundation,
    4.20 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    4.21 - *
    4.22 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    4.23 - * or visit www.oracle.com if you need additional information or have any
    4.24 - * questions.
    4.25 - */
    4.26 -
    4.27 -/*
    4.28 - * @test
    4.29 - * @bug 8031321
    4.30 - * @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
    4.31 - * @build AddnTestL
    4.32 - * @run main ClassFileInstaller sun.hotspot.WhiteBox
    4.33 - * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
    4.34 - *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions AddnTestL
    4.35 - */
    4.36 -
    4.37 -import java.lang.reflect.Method;
    4.38 -
    4.39 -public class AddnTestL extends AddnTestI {
    4.40 -
    4.41 -    protected AddnTestL(Method method) {
    4.42 -        super(method);
    4.43 -        isLongOperation = true;
    4.44 -    }
    4.45 -
    4.46 -    public static void main(String[] args) throws Exception {
    4.47 -        BmiIntrinsicBase.verifyTestCase(AddnTestL::new, TestAndnL.AndnLExpr.class.getDeclaredMethods());
    4.48 -        BmiIntrinsicBase.verifyTestCase(AddnTestL::new, TestAndnL.AndnLCommutativeExpr.class.getDeclaredMethods());
    4.49 -    }
    4.50 -}
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/test/compiler/intrinsics/bmi/verifycode/AndnTestI.java	Mon Feb 17 08:53:34 2020 +0000
     5.3 @@ -0,0 +1,57 @@
     5.4 +/*
     5.5 + * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
     5.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     5.7 + *
     5.8 + * This code is free software; you can redistribute it and/or modify it
     5.9 + * under the terms of the GNU General Public License version 2 only, as
    5.10 + * published by the Free Software Foundation.
    5.11 + *
    5.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
    5.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    5.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    5.15 + * version 2 for more details (a copy is included in the LICENSE file that
    5.16 + * accompanied this code).
    5.17 + *
    5.18 + * You should have received a copy of the GNU General Public License version
    5.19 + * 2 along with this work; if not, write to the Free Software Foundation,
    5.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    5.21 + *
    5.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    5.23 + * or visit www.oracle.com if you need additional information or have any
    5.24 + * questions.
    5.25 + */
    5.26 +
    5.27 +/*
    5.28 + * @test
    5.29 + * @bug 8031321
    5.30 + * @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
    5.31 + * @build AndnTestI
    5.32 + * @run main ClassFileInstaller sun.hotspot.WhiteBox
    5.33 + * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
    5.34 + *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions AndnTestI
    5.35 + */
    5.36 +
    5.37 +import java.lang.reflect.Method;
    5.38 +
    5.39 +public class AndnTestI extends BmiIntrinsicBase.BmiTestCase {
    5.40 +
    5.41 +    protected AndnTestI(Method method) {
    5.42 +        super(method);
    5.43 +        // from intel manual VEX.NDS.LZ.0F38.W0 F2 /r, example c4e260f2c2
    5.44 +        instrMask = new byte[]{
    5.45 +                (byte) 0xFF,
    5.46 +                (byte) 0x1F,
    5.47 +                (byte) 0x00,
    5.48 +                (byte) 0xFF};
    5.49 +        instrPattern = new byte[]{
    5.50 +                (byte) 0xC4, // prefix for 3-byte VEX instruction
    5.51 +                (byte) 0x02, // 00010 implied 0F 38 leading opcode bytes
    5.52 +                (byte) 0x00,
    5.53 +                (byte) 0xF2};
    5.54 +    }
    5.55 +
    5.56 +    public static void main(String[] args) throws Exception {
    5.57 +        BmiIntrinsicBase.verifyTestCase(AndnTestI::new, TestAndnI.AndnIExpr.class.getDeclaredMethods());
    5.58 +        BmiIntrinsicBase.verifyTestCase(AndnTestI::new, TestAndnI.AndnICommutativeExpr.class.getDeclaredMethods());
    5.59 +    }
    5.60 +}
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/test/compiler/intrinsics/bmi/verifycode/AndnTestL.java	Mon Feb 17 08:53:34 2020 +0000
     6.3 @@ -0,0 +1,47 @@
     6.4 +/*
     6.5 + * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
     6.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     6.7 + *
     6.8 + * This code is free software; you can redistribute it and/or modify it
     6.9 + * under the terms of the GNU General Public License version 2 only, as
    6.10 + * published by the Free Software Foundation.
    6.11 + *
    6.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
    6.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    6.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    6.15 + * version 2 for more details (a copy is included in the LICENSE file that
    6.16 + * accompanied this code).
    6.17 + *
    6.18 + * You should have received a copy of the GNU General Public License version
    6.19 + * 2 along with this work; if not, write to the Free Software Foundation,
    6.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    6.21 + *
    6.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    6.23 + * or visit www.oracle.com if you need additional information or have any
    6.24 + * questions.
    6.25 + */
    6.26 +
    6.27 +/*
    6.28 + * @test
    6.29 + * @bug 8031321
    6.30 + * @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
    6.31 + * @build AndnTestL
    6.32 + * @run main ClassFileInstaller sun.hotspot.WhiteBox
    6.33 + * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
    6.34 + *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions AndnTestL
    6.35 + */
    6.36 +
    6.37 +import java.lang.reflect.Method;
    6.38 +
    6.39 +public class AndnTestL extends AndnTestI {
    6.40 +
    6.41 +    protected AndnTestL(Method method) {
    6.42 +        super(method);
    6.43 +        isLongOperation = true;
    6.44 +    }
    6.45 +
    6.46 +    public static void main(String[] args) throws Exception {
    6.47 +        BmiIntrinsicBase.verifyTestCase(AndnTestL::new, TestAndnL.AndnLExpr.class.getDeclaredMethods());
    6.48 +        BmiIntrinsicBase.verifyTestCase(AndnTestL::new, TestAndnL.AndnLCommutativeExpr.class.getDeclaredMethods());
    6.49 +    }
    6.50 +}
     7.1 --- a/test/compiler/intrinsics/bmi/verifycode/LZcntTestI.java	Mon Feb 03 06:40:55 2020 +0000
     7.2 +++ b/test/compiler/intrinsics/bmi/verifycode/LZcntTestI.java	Mon Feb 17 08:53:34 2020 +0000
     7.3 @@ -44,6 +44,8 @@
     7.4      public static void main(String[] args) throws Exception {
     7.5          // j.l.Integer and Long should be loaded to allow a compilation of the methods that use their methods
     7.6          System.out.println("class java.lang.Integer should be loaded. Proof: " + Integer.class);
     7.7 +        // Avoid uncommon traps.
     7.8 +        System.out.println("Num leading zeroes: " + new TestLzcntI.LzcntIExpr().intExpr(12341341));
     7.9          BmiIntrinsicBase.verifyTestCase(LZcntTestI::new, TestLzcntI.LzcntIExpr.class.getDeclaredMethods());
    7.10      }
    7.11  
     8.1 --- a/test/compiler/intrinsics/bmi/verifycode/LZcntTestL.java	Mon Feb 03 06:40:55 2020 +0000
     8.2 +++ b/test/compiler/intrinsics/bmi/verifycode/LZcntTestL.java	Mon Feb 17 08:53:34 2020 +0000
     8.3 @@ -49,6 +49,8 @@
     8.4      public static void main(String[] args) throws Exception {
     8.5          // j.l.Integer and Long should be loaded to allow a compilation of the methods that use their methods
     8.6          System.out.println("classes java.lang.Long should be loaded. Proof: " + Long.class);
     8.7 +        // Avoid uncommon traps.
     8.8 +        System.out.println("Num leading zeroes: " + new  TestLzcntL.LzcntLExpr().longExpr(12341341));
     8.9          BmiIntrinsicBase.verifyTestCase(LZcntTestL::new, TestLzcntL.LzcntLExpr.class.getDeclaredMethods());
    8.10      }
    8.11  }
     9.1 --- a/test/compiler/intrinsics/bmi/verifycode/TZcntTestI.java	Mon Feb 03 06:40:55 2020 +0000
     9.2 +++ b/test/compiler/intrinsics/bmi/verifycode/TZcntTestI.java	Mon Feb 17 08:53:34 2020 +0000
     9.3 @@ -44,6 +44,8 @@
     9.4      public static void main(String[] args) throws Exception {
     9.5          // j.l.Integer and Long should be loaded to allow a compilation of the methods that use their methods
     9.6          System.out.println("class java.lang.Integer should be loaded. Proof: " + Integer.class);
     9.7 +        // Avoid uncommon traps.
     9.8 +        System.out.println("Num trailing zeroes: " + new TestTzcntI.TzcntIExpr().intExpr(12341341));
     9.9          BmiIntrinsicBase.verifyTestCase(TZcntTestI::new, TestTzcntI.TzcntIExpr.class.getDeclaredMethods());
    9.10      }
    9.11  
    10.1 --- a/test/compiler/intrinsics/bmi/verifycode/TZcntTestL.java	Mon Feb 03 06:40:55 2020 +0000
    10.2 +++ b/test/compiler/intrinsics/bmi/verifycode/TZcntTestL.java	Mon Feb 17 08:53:34 2020 +0000
    10.3 @@ -50,6 +50,8 @@
    10.4      public static void main(String[] args) throws Exception {
    10.5          // j.l.Integer and Long should be loaded to allow a compilation of the methods that use their methods
    10.6          System.out.println("classes java.lang.Long should be loaded. Proof: " + Long.class);
    10.7 +        // Avoid uncommon traps.
    10.8 +        System.out.println("Num trailing zeroes: " + new TestTzcntL.TzcntLExpr().longExpr(12341341));
    10.9          BmiIntrinsicBase.verifyTestCase(TZcntTestL::new, TestTzcntL.TzcntLExpr.class.getDeclaredMethods());
   10.10      }
   10.11  }

mercurial