hotspot/src/os_cpu/solaris_sparc/vm/solaris_sparc.il
author katleman
Wed, 11 Jan 2012 16:13:21 -0800
changeset 11370 0287f9a11368
parent 7911 be4352e4480c
child 18097 acd70736bd60
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
//
7911
be4352e4480c 7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents: 5547
diff changeset
     2
// Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
// This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
// under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
// published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
// This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
// version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
// accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
// You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
// 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
//
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1
diff changeset
    19
// Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1
diff changeset
    20
// or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1
diff changeset
    21
// questions.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
//  
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
489c9b5090e2 Initial load
duke
parents:
diff changeset
    25
  // Get the raw thread ID from %g7
489c9b5090e2 Initial load
duke
parents:
diff changeset
    26
489c9b5090e2 Initial load
duke
parents:
diff changeset
    27
       .inline  _raw_thread_id, 0
489c9b5090e2 Initial load
duke
parents:
diff changeset
    28
       .register %g7,#scratch
489c9b5090e2 Initial load
duke
parents:
diff changeset
    29
       .volatile
489c9b5090e2 Initial load
duke
parents:
diff changeset
    30
       mov     %g7, %o0
489c9b5090e2 Initial load
duke
parents:
diff changeset
    31
       .nonvolatile
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
       .end
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
  // Clear SPARC fprs.FEF DU and DL bits --
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
  // allows the kernel to avoid saving FPU state at context-switch time.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
  // Use for state-transition points (into _thread_blocked) or when
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
  // parking. 
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
      
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
       .inline _mark_fpu_nosave, 0
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
       .volatile
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
       wr   %g0, 0, %fprs       
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
       .nonvolatile
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
       .end
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
  // Support for jint Atomic::xchg(jint exchange_value, volatile jint* dest).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
  //
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
  // Arguments:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
  //      exchange_value: O0
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
  //      dest:           O1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
  //
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
  // Results:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
  //     O0: the value previously stored in dest
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
        .inline _Atomic_swap32, 2
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
        .volatile
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
        swap    [%o1],%o0
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
        .nonvolatile
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
        .end
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
  // Support for intptr_t Atomic::xchg_ptr(intptr_t exchange_value, volatile intptr_t * dest).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
  //
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
  // 64-bit
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
  //
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
  // Arguments:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
  //      exchange_value: O0
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
  //      dest:           O1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
  //
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
  // Results:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
  //     O0: the value previously stored in dest
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
        .inline _Atomic_swap64, 2
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
        .volatile
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
    1:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
        mov     %o0, %o3
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
        ldx     [%o1], %o2
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
        casx    [%o1], %o2, %o3
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
        cmp     %o2, %o3
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
        bne     %xcc, 1b
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
         nop
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
        mov     %o2, %o0
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
        .nonvolatile
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
        .end
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
  // Support for jint Atomic::cmpxchg(jint           exchange_value,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
  //                                  volatile jint* dest, 
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
  //                                  jint           compare_value)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
  //
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
  // Arguments:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
  //      exchange_value: O0
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
  //      dest:           O1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
  //      compare_value:  O2
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
  //
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
  // Results:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
  //     O0: the value previously stored in dest
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
        .inline _Atomic_cas32, 3
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
        .volatile
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
        cas     [%o1], %o2, %o0
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
        .nonvolatile
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
        .end
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
  // Support for intptr_t Atomic::cmpxchg_ptr(intptr_t           exchange_value, 
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
  //                                          volatile intptr_t* dest, 
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
  //                                          intptr_t           compare_value)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
  //
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
  // 64-bit
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
  //
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
  // Arguments:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
  //      exchange_value: O0
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
  //      dest:           O1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
  //      compare_value:  O2
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
  //
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
  // Results:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
  //     O0: the value previously stored in dest
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
        .inline _Atomic_cas64, 3
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
        .volatile
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
        casx    [%o1], %o2, %o0
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
        .nonvolatile
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
        .end
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
  // Support for jlong Atomic::cmpxchg(jlong           exchange_value, 
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
  //                                   volatile jlong* dest, 
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
  //                                   jlong           compare_value)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
  //
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
  // 32-bit calling conventions
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
  //
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
  // Arguments:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
  //      exchange_value: O1:O0
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
  //      dest:           O2
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
  //      compare_value:  O4:O3
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
  //
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
  // Results:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
  //     O1:O0: the value previously stored in dest
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
        .inline _Atomic_casl, 3
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
        .volatile
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
        sllx    %o0, 32, %o0
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
        srl     %o1, 0, %o1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   145
        or      %o0,%o1,%o0
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
        sllx    %o3, 32, %o3
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
        srl     %o4, 0, %o4
489c9b5090e2 Initial load
duke
parents:
diff changeset
   148
        or      %o3,%o4,%o3
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
        casx    [%o2], %o3, %o0
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
        srl     %o0, 0, %o1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
        srlx    %o0, 32, %o0
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
        .nonvolatile
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
        .end
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
7911
be4352e4480c 7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents: 5547
diff changeset
   155
  // Support for jlong Atomic::load and Atomic::store on v8.
be4352e4480c 7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents: 5547
diff changeset
   156
  //
be4352e4480c 7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents: 5547
diff changeset
   157
  // void _Atomic_move_long_v8(volatile jlong* src, volatile jlong* dst)
be4352e4480c 7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents: 5547
diff changeset
   158
  //
be4352e4480c 7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents: 5547
diff changeset
   159
  // Arguments:
be4352e4480c 7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents: 5547
diff changeset
   160
  //      src:  O0
be4352e4480c 7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents: 5547
diff changeset
   161
  //      dest: O1
be4352e4480c 7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents: 5547
diff changeset
   162
  //
be4352e4480c 7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents: 5547
diff changeset
   163
  // Overwrites O2 and O3
be4352e4480c 7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents: 5547
diff changeset
   164
be4352e4480c 7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents: 5547
diff changeset
   165
        .inline _Atomic_move_long_v8,2
be4352e4480c 7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents: 5547
diff changeset
   166
        .volatile
be4352e4480c 7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents: 5547
diff changeset
   167
        ldd     [%o0], %o2
be4352e4480c 7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents: 5547
diff changeset
   168
        std     %o2, [%o1]
be4352e4480c 7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents: 5547
diff changeset
   169
        .nonvolatile
be4352e4480c 7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents: 5547
diff changeset
   170
        .end
be4352e4480c 7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents: 5547
diff changeset
   171
be4352e4480c 7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents: 5547
diff changeset
   172
  // Support for jlong Atomic::load and Atomic::store on v9.
be4352e4480c 7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents: 5547
diff changeset
   173
  //
be4352e4480c 7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents: 5547
diff changeset
   174
  // void _Atomic_move_long_v9(volatile jlong* src, volatile jlong* dst)
be4352e4480c 7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents: 5547
diff changeset
   175
  //
be4352e4480c 7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents: 5547
diff changeset
   176
  // Arguments:
be4352e4480c 7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents: 5547
diff changeset
   177
  //      src:  O0
be4352e4480c 7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents: 5547
diff changeset
   178
  //      dest: O1
be4352e4480c 7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents: 5547
diff changeset
   179
  //
be4352e4480c 7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents: 5547
diff changeset
   180
  // Overwrites O2
be4352e4480c 7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents: 5547
diff changeset
   181
be4352e4480c 7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents: 5547
diff changeset
   182
        .inline _Atomic_move_long_v9,2
be4352e4480c 7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents: 5547
diff changeset
   183
        .volatile
be4352e4480c 7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents: 5547
diff changeset
   184
        ldx     [%o0], %o2
be4352e4480c 7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents: 5547
diff changeset
   185
        stx     %o2, [%o1]
be4352e4480c 7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents: 5547
diff changeset
   186
        .nonvolatile
be4352e4480c 7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents: 5547
diff changeset
   187
        .end
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
  // Support for jint Atomic::add(jint add_value, volatile jint* dest).
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
  //
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
  // Arguments:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
  //      add_value: O0   (e.g., +1 or -1)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
  //      dest:      O1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
  //
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
  // Results:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
  //     O0: the new value stored in dest
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
  //
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
  // Overwrites O3
489c9b5090e2 Initial load
duke
parents:
diff changeset
   199
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
        .inline _Atomic_add32, 2
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
        .volatile
489c9b5090e2 Initial load
duke
parents:
diff changeset
   202
    2:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
        ld      [%o1], %o2
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
        add     %o0, %o2, %o3
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
        cas     [%o1], %o2, %o3
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
        cmp     %o2, %o3
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
        bne     2b
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
         nop
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
        add     %o0, %o2, %o0
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
        .nonvolatile
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
        .end
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
  // Support for intptr_t Atomic::add_ptr(intptr_t add_value, volatile intptr_t* dest)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
  //
489c9b5090e2 Initial load
duke
parents:
diff changeset
   216
  // 64-bit
489c9b5090e2 Initial load
duke
parents:
diff changeset
   217
  //
489c9b5090e2 Initial load
duke
parents:
diff changeset
   218
  // Arguments:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   219
  //      add_value: O0   (e.g., +1 or -1)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   220
  //      dest:      O1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   221
  //
489c9b5090e2 Initial load
duke
parents:
diff changeset
   222
  // Results:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   223
  //     O0: the new value stored in dest
489c9b5090e2 Initial load
duke
parents:
diff changeset
   224
  //
489c9b5090e2 Initial load
duke
parents:
diff changeset
   225
  // Overwrites O3
489c9b5090e2 Initial load
duke
parents:
diff changeset
   226
489c9b5090e2 Initial load
duke
parents:
diff changeset
   227
        .inline _Atomic_add64, 2
489c9b5090e2 Initial load
duke
parents:
diff changeset
   228
        .volatile
489c9b5090e2 Initial load
duke
parents:
diff changeset
   229
    3:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   230
        ldx     [%o1], %o2
489c9b5090e2 Initial load
duke
parents:
diff changeset
   231
        add     %o0, %o2, %o3
489c9b5090e2 Initial load
duke
parents:
diff changeset
   232
        casx    [%o1], %o2, %o3
489c9b5090e2 Initial load
duke
parents:
diff changeset
   233
        cmp     %o2, %o3
489c9b5090e2 Initial load
duke
parents:
diff changeset
   234
        bne     %xcc, 3b
489c9b5090e2 Initial load
duke
parents:
diff changeset
   235
         nop
489c9b5090e2 Initial load
duke
parents:
diff changeset
   236
        add     %o0, %o2, %o0
489c9b5090e2 Initial load
duke
parents:
diff changeset
   237
        .nonvolatile
489c9b5090e2 Initial load
duke
parents:
diff changeset
   238
        .end
489c9b5090e2 Initial load
duke
parents:
diff changeset
   239
489c9b5090e2 Initial load
duke
parents:
diff changeset
   240
489c9b5090e2 Initial load
duke
parents:
diff changeset
   241
  // Support for void OrderAccess::acquire()
489c9b5090e2 Initial load
duke
parents:
diff changeset
   242
  // The method is intentionally empty.  
489c9b5090e2 Initial load
duke
parents:
diff changeset
   243
  // It exists for the sole purpose of generating
489c9b5090e2 Initial load
duke
parents:
diff changeset
   244
  // a C/C++ sequence point over which the compiler won't 
489c9b5090e2 Initial load
duke
parents:
diff changeset
   245
  // reorder code.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   246
489c9b5090e2 Initial load
duke
parents:
diff changeset
   247
        .inline _OrderAccess_acquire,0
489c9b5090e2 Initial load
duke
parents:
diff changeset
   248
        .volatile
489c9b5090e2 Initial load
duke
parents:
diff changeset
   249
        .nonvolatile
489c9b5090e2 Initial load
duke
parents:
diff changeset
   250
        .end
489c9b5090e2 Initial load
duke
parents:
diff changeset
   251
489c9b5090e2 Initial load
duke
parents:
diff changeset
   252
489c9b5090e2 Initial load
duke
parents:
diff changeset
   253
  // Support for void OrderAccess::fence()
489c9b5090e2 Initial load
duke
parents:
diff changeset
   254
489c9b5090e2 Initial load
duke
parents:
diff changeset
   255
        .inline _OrderAccess_fence,0
489c9b5090e2 Initial load
duke
parents:
diff changeset
   256
        .volatile
489c9b5090e2 Initial load
duke
parents:
diff changeset
   257
        membar  #StoreLoad
489c9b5090e2 Initial load
duke
parents:
diff changeset
   258
        .nonvolatile
489c9b5090e2 Initial load
duke
parents:
diff changeset
   259
        .end
489c9b5090e2 Initial load
duke
parents:
diff changeset
   260
489c9b5090e2 Initial load
duke
parents:
diff changeset
   261
489c9b5090e2 Initial load
duke
parents:
diff changeset
   262
  // Support for void Prefetch::read(void *loc, intx interval)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   263
  //
489c9b5090e2 Initial load
duke
parents:
diff changeset
   264
  // Prefetch for several reads.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   265
489c9b5090e2 Initial load
duke
parents:
diff changeset
   266
        .inline _Prefetch_read, 2
489c9b5090e2 Initial load
duke
parents:
diff changeset
   267
        .volatile
489c9b5090e2 Initial load
duke
parents:
diff changeset
   268
        prefetch [%o0+%o1], 0
489c9b5090e2 Initial load
duke
parents:
diff changeset
   269
        .nonvolatile
489c9b5090e2 Initial load
duke
parents:
diff changeset
   270
        .end
489c9b5090e2 Initial load
duke
parents:
diff changeset
   271
489c9b5090e2 Initial load
duke
parents:
diff changeset
   272
489c9b5090e2 Initial load
duke
parents:
diff changeset
   273
  // Support for void Prefetch::write(void *loc, intx interval)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   274
  //
489c9b5090e2 Initial load
duke
parents:
diff changeset
   275
  // Prefetch for several writes.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   276
489c9b5090e2 Initial load
duke
parents:
diff changeset
   277
        .inline _Prefetch_write, 2
489c9b5090e2 Initial load
duke
parents:
diff changeset
   278
        .volatile
489c9b5090e2 Initial load
duke
parents:
diff changeset
   279
        prefetch [%o0+%o1], 2
489c9b5090e2 Initial load
duke
parents:
diff changeset
   280
        .nonvolatile
489c9b5090e2 Initial load
duke
parents:
diff changeset
   281
        .end
489c9b5090e2 Initial load
duke
parents:
diff changeset
   282
489c9b5090e2 Initial load
duke
parents:
diff changeset
   283
489c9b5090e2 Initial load
duke
parents:
diff changeset
   284
  // Support for void Copy::conjoint_jlongs_atomic(jlong* from, jlong* to, size_t count)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   285
  //
489c9b5090e2 Initial load
duke
parents:
diff changeset
   286
  // 32-bit
489c9b5090e2 Initial load
duke
parents:
diff changeset
   287
  //
489c9b5090e2 Initial load
duke
parents:
diff changeset
   288
  // Arguments:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   289
  //      from:  O0
489c9b5090e2 Initial load
duke
parents:
diff changeset
   290
  //      to:    O1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   291
  //      count: O2 treated as signed
489c9b5090e2 Initial load
duke
parents:
diff changeset
   292
  //
489c9b5090e2 Initial load
duke
parents:
diff changeset
   293
  // Clobbers:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   294
  //      long_value: O2, O3
489c9b5090e2 Initial load
duke
parents:
diff changeset
   295
  //      count:      O4
489c9b5090e2 Initial load
duke
parents:
diff changeset
   296
  //
489c9b5090e2 Initial load
duke
parents:
diff changeset
   297
  // if (from > to) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   298
  //   while (--count >= 0) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   299
  //     *to++ = *from++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   300
  //   }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   301
  // } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   302
  //   while (--count >= 0) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   303
  //     to[count] = from[count];
489c9b5090e2 Initial load
duke
parents:
diff changeset
   304
  //   }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   305
  // }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   306
        .inline _Copy_conjoint_jlongs_atomic, 3
489c9b5090e2 Initial load
duke
parents:
diff changeset
   307
        .volatile
489c9b5090e2 Initial load
duke
parents:
diff changeset
   308
        cmp     %o0, %o1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   309
        bleu    4f
489c9b5090e2 Initial load
duke
parents:
diff changeset
   310
        sll     %o2, 3, %o4
489c9b5090e2 Initial load
duke
parents:
diff changeset
   311
        ba      2f
489c9b5090e2 Initial load
duke
parents:
diff changeset
   312
    1:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   313
        subcc   %o4, 8, %o4
489c9b5090e2 Initial load
duke
parents:
diff changeset
   314
        std     %o2, [%o1]
489c9b5090e2 Initial load
duke
parents:
diff changeset
   315
        add     %o0, 8, %o0
489c9b5090e2 Initial load
duke
parents:
diff changeset
   316
        add     %o1, 8, %o1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   317
    2:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   318
        bge,a   1b
489c9b5090e2 Initial load
duke
parents:
diff changeset
   319
        ldd     [%o0], %o2
489c9b5090e2 Initial load
duke
parents:
diff changeset
   320
        ba      5f
489c9b5090e2 Initial load
duke
parents:
diff changeset
   321
        nop
489c9b5090e2 Initial load
duke
parents:
diff changeset
   322
    3:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   323
        std     %o2, [%o1+%o4]
489c9b5090e2 Initial load
duke
parents:
diff changeset
   324
    4:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   325
        subcc   %o4, 8, %o4
489c9b5090e2 Initial load
duke
parents:
diff changeset
   326
        bge,a   3b
489c9b5090e2 Initial load
duke
parents:
diff changeset
   327
        ldd     [%o0+%o4], %o2
489c9b5090e2 Initial load
duke
parents:
diff changeset
   328
    5:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   329
        .nonvolatile
489c9b5090e2 Initial load
duke
parents:
diff changeset
   330
        .end