test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesCMS.java
author roland
Mon, 05 Nov 2018 12:53:55 +0100
changeset 52409 87bc444ca642
parent 50874 551c340ca01a
permissions -rw-r--r--
8209835: Aarch64: elide barriers on all volatile operations Reviewed-by: aph, adinn
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
50874
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
     1
/*
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
     2
 * Copyright (c) 2018, Red Hat, Inc. All rights reserved.
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
     4
 *
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
     7
 * published by the Free Software Foundation.
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
     8
 *
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    13
 * accompanied this code).
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    14
 *
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    18
 *
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    21
 * questions.
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    22
 */
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    23
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    24
/*
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    25
 * @test
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    26
 * @summary C2 should use ldar, stlr and ldaxr+stlxr insns for volatile operations
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    27
 * @library /test/lib /
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    28
 *
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    29
 * @modules java.base/jdk.internal.misc
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    30
 *
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    31
 * @requires os.arch=="aarch64" & vm.debug == true &
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    32
 *           vm.flavor == "server" & !vm.graal.enabled &
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    33
 *           vm.gc.ConcMarkSweep
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    34
 *
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    35
 * @build compiler.c2.aarch64.TestVolatiles
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    36
 *        compiler.c2.aarch64.TestVolatileLoad
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    37
 *        compiler.c2.aarch64.TestUnsafeVolatileLoad
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    38
 *        compiler.c2.aarch64.TestVolatileStore
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    39
 *        compiler.c2.aarch64.TestUnsafeVolatileStore
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    40
 *        compiler.c2.aarch64.TestUnsafeVolatileCAS
52409
87bc444ca642 8209835: Aarch64: elide barriers on all volatile operations
roland
parents: 50874
diff changeset
    41
 *        compiler.c2.aarch64.TestUnsafeVolatileWeakCAS
87bc444ca642 8209835: Aarch64: elide barriers on all volatile operations
roland
parents: 50874
diff changeset
    42
 *        compiler.c2.aarch64.TestUnsafeVolatileCAE
87bc444ca642 8209835: Aarch64: elide barriers on all volatile operations
roland
parents: 50874
diff changeset
    43
 *        compiler.c2.aarch64.TestUnsafeVolatileGAS
50874
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    44
 *
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    45
 * @run driver compiler.c2.aarch64.TestVolatilesCMS
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    46
 *      TestVolatileLoad CMS
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    47
 *
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    48
 * @run driver compiler.c2.aarch64.TestVolatilesCMS
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    49
 *      TestVolatileStore CMS
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    50
 *
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    51
 * @run driver compiler.c2.aarch64.TestVolatilesCMS
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    52
 *      TestUnsafeVolatileLoad CMS
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    53
 *
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    54
 * @run driver compiler.c2.aarch64.TestVolatilesCMS
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    55
 *      TestUnsafeVolatileStore CMS
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    56
 *
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    57
 * @run driver compiler.c2.aarch64.TestVolatilesCMS
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    58
 *      TestUnsafeVolatileCAS CMS
52409
87bc444ca642 8209835: Aarch64: elide barriers on all volatile operations
roland
parents: 50874
diff changeset
    59
 *
87bc444ca642 8209835: Aarch64: elide barriers on all volatile operations
roland
parents: 50874
diff changeset
    60
 * @run driver compiler.c2.aarch64.TestVolatilesCMS
87bc444ca642 8209835: Aarch64: elide barriers on all volatile operations
roland
parents: 50874
diff changeset
    61
 *      TestUnsafeVolatileWeakCAS CMS
87bc444ca642 8209835: Aarch64: elide barriers on all volatile operations
roland
parents: 50874
diff changeset
    62
 *
87bc444ca642 8209835: Aarch64: elide barriers on all volatile operations
roland
parents: 50874
diff changeset
    63
 * @run driver compiler.c2.aarch64.TestVolatilesCMS
87bc444ca642 8209835: Aarch64: elide barriers on all volatile operations
roland
parents: 50874
diff changeset
    64
 *      TestUnsafeVolatileCAE CMS
87bc444ca642 8209835: Aarch64: elide barriers on all volatile operations
roland
parents: 50874
diff changeset
    65
 *
87bc444ca642 8209835: Aarch64: elide barriers on all volatile operations
roland
parents: 50874
diff changeset
    66
 * @run driver compiler.c2.aarch64.TestVolatilesCMS
87bc444ca642 8209835: Aarch64: elide barriers on all volatile operations
roland
parents: 50874
diff changeset
    67
 *      TestUnsafeVolatileGAS CMS
50874
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    68
 */
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    69
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    70
package compiler.c2.aarch64;
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    71
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    72
public class TestVolatilesCMS {
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    73
    public static void main(String args[]) throws Throwable
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    74
    {
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    75
        // delegate work to shared code
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    76
        new TestVolatiles().runtest(args[0], args[1]);
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    77
    }
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    78
}