test/hotspot/jtreg/compiler/unsafe/JdkInternalMiscUnsafeUnalignedAccess.java
author mchung
Mon, 22 Oct 2018 17:00:04 -0700
changeset 52220 9c260a6b6471
parent 47216 71c04702a3d5
permissions -rw-r--r--
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference Reviewed-by: dholmes, thartmann
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
39424
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
     1
/*
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
     2
 * Copyright (c) 2016 SAP SE. All rights reserved.
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
     4
 *
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
     7
 * published by the Free Software Foundation.
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
     8
 *
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    13
 * accompanied this code).
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    14
 *
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    18
 *
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    21
 * questions.
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    22
 */
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    23
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    24
/*
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    25
 * @test
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    26
 * @bug 8158260
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    27
 * @summary Test unaligned Unsafe accesses
42307
cefc81dc1d52 8169069: Module system implementation refresh (11/2016)
alanb
parents: 40059
diff changeset
    28
 * @modules java.base/jdk.internal.misc:+open
40059
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 39424
diff changeset
    29
 *
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 39424
diff changeset
    30
 * @run main/othervm -Diters=20000 -XX:-UseOnStackReplacement -XX:-BackgroundCompilation
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 39424
diff changeset
    31
 *      compiler.unsafe.JdkInternalMiscUnsafeUnalignedAccess
39424
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    32
 * @author volker.simonis@gmail.com
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    33
 */
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    34
40059
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 39424
diff changeset
    35
package compiler.unsafe;
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 39424
diff changeset
    36
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 39424
diff changeset
    37
import jdk.internal.misc.Unsafe;
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 39424
diff changeset
    38
39424
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    39
import java.lang.reflect.Field;
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    40
import java.nio.ByteOrder;
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    41
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    42
public class JdkInternalMiscUnsafeUnalignedAccess {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    43
    static final int ITERS = Integer.getInteger("iters", 20_000);
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    44
    private static final boolean BIG_ENDIAN = ByteOrder.nativeOrder().equals(ByteOrder.BIG_ENDIAN);
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    45
    private static final Unsafe UNSAFE;
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    46
    private static final int SIZE = 1024;
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    47
    private static long memory;
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    48
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    49
    static {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    50
        try {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    51
            Field unsafeField = Unsafe.class.getDeclaredField("theUnsafe");
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    52
            unsafeField.setAccessible(true);
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    53
            UNSAFE = (Unsafe) unsafeField.get(null);
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    54
        }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    55
        catch (Exception e) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    56
            throw new RuntimeException("Unable to get Unsafe instance.", e);
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    57
        }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    58
    }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    59
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    60
    static int getInt_0() {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    61
        return UNSAFE.getInt(memory + 0);
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    62
    }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    63
    static int getInt_1() {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    64
        return UNSAFE.getInt(memory + 1);
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    65
    }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    66
    static int getInt_4() {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    67
        return UNSAFE.getInt(memory + 4);
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    68
    }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    69
    static int getInt_17() {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    70
        return UNSAFE.getInt(memory + 17);
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    71
    }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    72
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    73
    static long getIntAsLong_0() {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    74
        return UNSAFE.getInt(memory + 0);
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    75
    }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    76
    static long getIntAsLong_1() {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    77
        return UNSAFE.getInt(memory + 1);
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    78
    }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    79
    static long getIntAsLong_4() {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    80
        return UNSAFE.getInt(memory + 4);
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    81
    }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    82
    static long getIntAsLong_17() {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    83
        return UNSAFE.getInt(memory + 17);
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    84
    }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    85
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    86
    static long getLong_0() {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    87
        return UNSAFE.getLong(memory + 0);
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    88
    }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    89
    static long getLong_1() {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    90
        return UNSAFE.getLong(memory + 1);
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    91
    }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    92
    static long getLong_4() {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    93
        return UNSAFE.getLong(memory + 4);
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    94
    }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    95
    static long getLong_8() {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    96
        return UNSAFE.getLong(memory + 8);
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    97
    }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    98
    static long getLong_17() {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
    99
        return UNSAFE.getLong(memory + 17);
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   100
    }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   101
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   102
    static void putInt_0(int i) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   103
        UNSAFE.putInt(memory + 0, i);
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   104
    }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   105
    static void putInt_1(int i) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   106
        UNSAFE.putInt(memory + 1, i);
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   107
    }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   108
    static void putInt_4(int i) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   109
        UNSAFE.putInt(memory + 4, i);
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   110
    }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   111
    static void putInt_17(int i) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   112
        UNSAFE.putInt(memory + 17, i);
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   113
    }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   114
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   115
    static void putLong_0(long l) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   116
        UNSAFE.putLong(memory + 0, l);
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   117
    }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   118
    static void putLong_1(long l) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   119
        UNSAFE.putLong(memory + 1, l);
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   120
    }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   121
    static void putLong_4(long l) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   122
        UNSAFE.putLong(memory + 4, l);
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   123
    }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   124
    static void putLong_8(long l) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   125
        UNSAFE.putLong(memory + 8, l);
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   126
    }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   127
    static void putLong_17(long l) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   128
        UNSAFE.putLong(memory + 17, l);
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   129
    }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   130
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   131
    public static void main(String[] args) throws Exception {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   132
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   133
        if (!UNSAFE.unalignedAccess()) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   134
            System.out.println("Platform is not supporting unaligned access - nothing to test.");
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   135
            return;
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   136
        }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   137
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   138
        memory = UNSAFE.allocateMemory(SIZE);
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   139
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   140
        UNSAFE.putInt(memory +  0, 0x00112233);
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   141
        UNSAFE.putInt(memory +  4, 0x44556677);
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   142
        UNSAFE.putInt(memory +  8, 0x8899aabb);
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   143
        UNSAFE.putInt(memory + 12, 0xccddeeff);
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   144
        UNSAFE.putInt(memory + 16, 0x01234567);
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   145
        UNSAFE.putInt(memory + 20, 0x89abcdef);
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   146
        UNSAFE.putInt(memory + 24, 0x01234567);
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   147
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   148
        // Unsafe.getInt()
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   149
        int res;
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   150
        for (int i = 0; i < ITERS; i++) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   151
            res = getInt_0();
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   152
            if (res != 0x00112233) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   153
                throw new Exception(res + " != 0x00112233");
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   154
            }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   155
        }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   156
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   157
        for (int i = 0; i < ITERS; i++) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   158
            res = getInt_1();
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   159
            if (res != (BIG_ENDIAN ? 0x11223344 : 0x77001122)) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   160
                throw new Exception(res + " != " + (BIG_ENDIAN ? 0x11223344 : 0x77001122));
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   161
            }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   162
        }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   163
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   164
        for (int i = 0; i < ITERS; i++) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   165
            res = getInt_4();
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   166
            if (res != 0x44556677) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   167
                throw new Exception(res + " != 0x44556677");
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   168
            }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   169
        }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   170
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   171
        for (int i = 0; i < ITERS; i++) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   172
            res = getInt_17();
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   173
            if (res != (BIG_ENDIAN ? 0x23456789 : 0xef012345)) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   174
                throw new Exception(res + " != " + (BIG_ENDIAN ? 0x23456789 : 0xef012345));
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   175
            }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   176
        }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   177
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   178
        // (long)Unsafe.getInt()
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   179
        long lres;
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   180
        for (int i = 0; i < ITERS; i++) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   181
            lres = getIntAsLong_0();
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   182
            if (lres != (long)0x00112233) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   183
                throw new Exception(lres + " != 0x00112233");
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   184
            }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   185
        }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   186
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   187
        for (int i = 0; i < ITERS; i++) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   188
            lres = getIntAsLong_1();
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   189
            if (lres != (BIG_ENDIAN ? (long)0x11223344 : (long)0x77001122)) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   190
                throw new Exception(lres + " != " + (BIG_ENDIAN ? (long)0x11223344 : (long)0x77001122));
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   191
            }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   192
        }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   193
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   194
        for (int i = 0; i < ITERS; i++) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   195
            lres = getIntAsLong_4();
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   196
            if (lres != (long)0x44556677) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   197
                throw new Exception(lres + " != 0x44556677");
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   198
            }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   199
        }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   200
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   201
        for (int i = 0; i < ITERS; i++) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   202
            lres = getIntAsLong_17();
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   203
            if (lres != (BIG_ENDIAN ? (long)0x23456789 : (long)0xef012345)) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   204
                throw new Exception(lres + " != " + (BIG_ENDIAN ? (long)0x23456789 : (long)0xef012345));
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   205
            }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   206
        }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   207
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   208
        // Unsafe.getLong()
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   209
        for (int i = 0; i < ITERS; i++) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   210
            lres = getLong_0();
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   211
            if (lres != (BIG_ENDIAN ? 0x0011223344556677L : 0x4455667700112233L)) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   212
                throw new Exception(lres + " != " + (BIG_ENDIAN ? 0x0011223344556677L : 0x4455667700112233L));
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   213
            }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   214
        }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   215
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   216
        for (int i = 0; i < ITERS; i++) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   217
            lres = getLong_1();
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   218
            if (lres != (BIG_ENDIAN ? 0x1122334455667788L : 0xbb44556677001122L)) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   219
                throw new Exception(lres + " != " + (BIG_ENDIAN ? 0x1122334455667788L : 0xbb44556677001122L));
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   220
            }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   221
        }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   222
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   223
        for (int i = 0; i < ITERS; i++) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   224
            lres = getLong_4();
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   225
            if (lres != (BIG_ENDIAN ? 0x445566778899aabbL : 0x8899aabb44556677L)) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   226
                throw new Exception(lres + " != " + (BIG_ENDIAN ? 0x445566778899aabbL : 0x8899aabb44556677L));
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   227
            }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   228
        }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   229
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   230
        for (int i = 0; i < ITERS; i++) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   231
            lres = getLong_8();
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   232
            if (lres != (BIG_ENDIAN ? 0x8899aabbccddeeffL : 0xccddeeff8899aabbL)) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   233
                throw new Exception(lres + " != " + (BIG_ENDIAN ? 0x8899aabbccddeeffL : 0xccddeeff8899aabbL));
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   234
            }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   235
        }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   236
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   237
        for (int i = 0; i < ITERS; i++) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   238
            lres = getLong_17();
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   239
            if (lres != (BIG_ENDIAN ? 0x23456789abcdef01L : 0x6789abcdef012345L)) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   240
                throw new Exception(lres + " != " + (BIG_ENDIAN ? 0x23456789abcdef01L : 0x6789abcdef012345L));
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   241
            }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   242
        }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   243
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   244
        // Unsafe.putInt()
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   245
        for (int i = 0; i < ITERS; i++) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   246
            putInt_0(0x00112233);
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   247
            res = getInt_0();
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   248
            if (res != 0x00112233) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   249
                throw new Exception(res + " != 0x00112233");
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   250
            }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   251
        }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   252
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   253
        for (int i = 0; i < ITERS; i++) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   254
            putInt_1(BIG_ENDIAN ? 0x11223344 : 0x77001122);
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   255
            res = getInt_1();
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   256
            if (res != (BIG_ENDIAN ? 0x11223344 : 0x77001122)) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   257
                throw new Exception(res + " != " + (BIG_ENDIAN ? 0x11223344 : 0x77001122));
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   258
            }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   259
        }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   260
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   261
        for (int i = 0; i < ITERS; i++) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   262
            putInt_4(0x44556677);
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   263
            res = getInt_4();
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   264
            if (res != 0x44556677) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   265
                throw new Exception(res + " != 0x44556677");
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   266
            }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   267
        }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   268
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   269
        for (int i = 0; i < ITERS; i++) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   270
            putInt_17(BIG_ENDIAN ? 0x23456789 : 0xef012345);
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   271
            res = getInt_17();
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   272
            if (res != (BIG_ENDIAN ? 0x23456789 : 0xef012345)) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   273
                throw new Exception(res + " != " + (BIG_ENDIAN ? 0x23456789 : 0xef012345));
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   274
            }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   275
        }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   276
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   277
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   278
        // Unsafe.putLong()
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   279
        for (int i = 0; i < ITERS; i++) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   280
            putLong_0(BIG_ENDIAN ? 0x0011223344556677L : 0x4455667700112233L);
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   281
            lres = getLong_0();
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   282
            if (lres != (BIG_ENDIAN ? 0x0011223344556677L : 0x4455667700112233L)) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   283
                throw new Exception(lres + " != " + (BIG_ENDIAN ? 0x0011223344556677L : 0x4455667700112233L));
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   284
            }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   285
        }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   286
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   287
        for (int i = 0; i < ITERS; i++) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   288
            putLong_1(BIG_ENDIAN ? 0x1122334455667788L : 0xbb44556677001122L);
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   289
            lres = getLong_1();
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   290
            if (lres != (BIG_ENDIAN ? 0x1122334455667788L : 0xbb44556677001122L)) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   291
                throw new Exception(lres + " != " + (BIG_ENDIAN ? 0x1122334455667788L : 0xbb44556677001122L));
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   292
            }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   293
        }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   294
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   295
        for (int i = 0; i < ITERS; i++) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   296
            putLong_4(BIG_ENDIAN ? 0x445566778899aabbL : 0x8899aabb44556677L);
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   297
            lres = getLong_4();
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   298
            if (lres != (BIG_ENDIAN ? 0x445566778899aabbL : 0x8899aabb44556677L)) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   299
                throw new Exception(lres + " != " + (BIG_ENDIAN ? 0x445566778899aabbL : 0x8899aabb44556677L));
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   300
            }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   301
        }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   302
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   303
        for (int i = 0; i < ITERS; i++) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   304
            putLong_8(BIG_ENDIAN ? 0x8899aabbccddeeffL : 0xccddeeff8899aabbL);
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   305
            lres = getLong_8();
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   306
            if (lres != (BIG_ENDIAN ? 0x8899aabbccddeeffL : 0xccddeeff8899aabbL)) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   307
                throw new Exception(lres + " != " + (BIG_ENDIAN ? 0x8899aabbccddeeffL : 0xccddeeff8899aabbL));
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   308
            }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   309
        }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   310
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   311
        for (int i = 0; i < ITERS; i++) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   312
            putLong_17(BIG_ENDIAN ? 0x23456789abcdef01L : 0x6789abcdef012345L);
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   313
            lres = getLong_17();
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   314
            if (lres != (BIG_ENDIAN ? 0x23456789abcdef01L : 0x6789abcdef012345L)) {
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   315
                throw new Exception(lres + " != " + (BIG_ENDIAN ? 0x23456789abcdef01L : 0x6789abcdef012345L));
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   316
            }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   317
        }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   318
    }
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   319
1045973b8c6a 8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
simonis
parents:
diff changeset
   320
}