Mon, 09 Mar 2009 13:28:46 -0700
6814575: Update copyright year
Summary: Update copyright for files that have been modified in 2009, up to 03/09
Reviewed-by: katleman, tbell, ohair
duke@435 | 1 | // |
xdono@1014 | 2 | // Copyright 2004-2009 Sun Microsystems, Inc. All Rights Reserved. |
duke@435 | 3 | // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
duke@435 | 4 | // |
duke@435 | 5 | // This code is free software; you can redistribute it and/or modify it |
duke@435 | 6 | // under the terms of the GNU General Public License version 2 only, as |
duke@435 | 7 | // published by the Free Software Foundation. |
duke@435 | 8 | // |
duke@435 | 9 | // This code is distributed in the hope that it will be useful, but WITHOUT |
duke@435 | 10 | // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
duke@435 | 11 | // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
duke@435 | 12 | // version 2 for more details (a copy is included in the LICENSE file that |
duke@435 | 13 | // accompanied this code). |
duke@435 | 14 | // |
duke@435 | 15 | // You should have received a copy of the GNU General Public License version |
duke@435 | 16 | // 2 along with this work; if not, write to the Free Software Foundation, |
duke@435 | 17 | // Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
duke@435 | 18 | // |
duke@435 | 19 | // Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
duke@435 | 20 | // CA 95054 USA or visit www.sun.com if you need additional information or |
duke@435 | 21 | // have any questions. |
duke@435 | 22 | // |
duke@435 | 23 | // |
duke@435 | 24 | |
duke@435 | 25 | // The argument size of each inline directive is ignored by the compiler |
duke@435 | 26 | // and is set to the number of arguments as documentation. |
duke@435 | 27 | |
duke@435 | 28 | // Get the raw thread ID from %gs:0 |
duke@435 | 29 | .inline _raw_thread_id,0 |
duke@435 | 30 | movq %fs:0, %rax |
duke@435 | 31 | .end |
duke@435 | 32 | |
coleenp@907 | 33 | // Get the frame pointer from current frame. |
coleenp@907 | 34 | .inline _get_current_fp,0 |
coleenp@907 | 35 | .volatile |
duke@435 | 36 | movq %rbp, %rax |
duke@435 | 37 | .end |
duke@435 | 38 | |
duke@435 | 39 | // Support for jint Atomic::add(jint add_value, volatile jint* dest) |
duke@435 | 40 | // An additional bool (os::is_MP()) is passed as the last argument. |
duke@435 | 41 | .inline _Atomic_add,3 |
duke@435 | 42 | movl %edi, %eax // save add_value for return |
duke@435 | 43 | testl %edx, %edx // MP test |
duke@435 | 44 | je 1f |
duke@435 | 45 | lock |
duke@435 | 46 | 1: xaddl %edi, (%rsi) |
duke@435 | 47 | addl %edi, %eax |
duke@435 | 48 | .end |
duke@435 | 49 | |
duke@435 | 50 | // Support for jlong Atomic::add(jlong add_value, volatile jlong* dest) |
duke@435 | 51 | // An additional bool (os::is_MP()) is passed as the last argument. |
duke@435 | 52 | .inline _Atomic_add_long,3 |
duke@435 | 53 | movq %rdi, %rax // save add_value for return |
duke@435 | 54 | testq %rdx, %rdx // MP test |
duke@435 | 55 | je 1f |
duke@435 | 56 | lock |
duke@435 | 57 | 1: xaddq %rdi, (%rsi) |
duke@435 | 58 | addq %rdi, %rax |
duke@435 | 59 | .end |
duke@435 | 60 | |
duke@435 | 61 | // Support for jint Atomic::xchg(jint exchange_value, volatile jint* dest). |
duke@435 | 62 | .inline _Atomic_xchg,2 |
duke@435 | 63 | xchgl (%rsi), %edi |
duke@435 | 64 | movl %edi, %eax |
duke@435 | 65 | .end |
duke@435 | 66 | |
duke@435 | 67 | // Support for jlong Atomic::xchg(jlong exchange_value, volatile jlong* dest). |
duke@435 | 68 | .inline _Atomic_xchg_long,2 |
duke@435 | 69 | xchgq (%rsi), %rdi |
duke@435 | 70 | movq %rdi, %rax |
duke@435 | 71 | .end |
duke@435 | 72 | |
duke@435 | 73 | // Support for jint Atomic::cmpxchg(jint exchange_value, |
duke@435 | 74 | // volatile jint *dest, |
duke@435 | 75 | // jint compare_value) |
duke@435 | 76 | // An additional bool (os::is_MP()) is passed as the last argument. |
duke@435 | 77 | .inline _Atomic_cmpxchg,4 |
duke@435 | 78 | movl %edx, %eax // compare_value |
duke@435 | 79 | testl %ecx, %ecx // MP test |
duke@435 | 80 | je 1f |
duke@435 | 81 | lock |
duke@435 | 82 | 1: cmpxchgl %edi, (%rsi) |
duke@435 | 83 | .end |
duke@435 | 84 | |
duke@435 | 85 | // Support for jlong Atomic::cmpxchg(jlong exchange_value, |
duke@435 | 86 | // volatile jlong* dest, |
duke@435 | 87 | // jlong compare_value) |
duke@435 | 88 | // An additional bool (os::is_MP()) is passed as the last argument. |
duke@435 | 89 | .inline _Atomic_cmpxchg_long,6 |
duke@435 | 90 | movq %rdx, %rax // compare_value |
duke@435 | 91 | testq %rcx, %rcx // MP test |
duke@435 | 92 | je 1f |
duke@435 | 93 | lock |
duke@435 | 94 | 1: cmpxchgq %rdi, (%rsi) |
duke@435 | 95 | .end |
duke@435 | 96 | |
duke@435 | 97 | // Support for OrderAccess::acquire() |
duke@435 | 98 | .inline _OrderAccess_acquire,0 |
duke@435 | 99 | movl 0(%rsp), %eax |
duke@435 | 100 | .end |
duke@435 | 101 | |
duke@435 | 102 | // Support for OrderAccess::fence() |
duke@435 | 103 | .inline _OrderAccess_fence,0 |
duke@435 | 104 | lock |
duke@435 | 105 | addl $0, (%rsp) |
duke@435 | 106 | .end |
duke@435 | 107 | |
duke@435 | 108 | // Support for u2 Bytes::swap_u2(u2 x) |
duke@435 | 109 | .inline _raw_swap_u2,1 |
duke@435 | 110 | movw %di, %ax |
duke@435 | 111 | rorw $8, %ax |
duke@435 | 112 | .end |
duke@435 | 113 | |
duke@435 | 114 | // Support for u4 Bytes::swap_u4(u4 x) |
duke@435 | 115 | .inline _raw_swap_u4,1 |
duke@435 | 116 | movl %edi, %eax |
duke@435 | 117 | bswapl %eax |
duke@435 | 118 | .end |
duke@435 | 119 | |
duke@435 | 120 | // Support for u8 Bytes::swap_u8(u8 x) |
duke@435 | 121 | .inline _raw_swap_u8,1 |
duke@435 | 122 | movq %rdi, %rax |
duke@435 | 123 | bswapq %rax |
duke@435 | 124 | .end |
duke@435 | 125 | |
duke@435 | 126 | // Support for void Prefetch::read |
duke@435 | 127 | .inline _Prefetch_read,2 |
duke@435 | 128 | prefetcht0 (%rdi, %rsi, 1) |
duke@435 | 129 | .end |
duke@435 | 130 | |
duke@435 | 131 | // Support for void Prefetch::write |
duke@435 | 132 | // We use prefetcht0 because em64t doesn't support prefetchw. |
duke@435 | 133 | // prefetchw is a 3dnow instruction. |
duke@435 | 134 | .inline _Prefetch_write,2 |
duke@435 | 135 | prefetcht0 (%rdi, %rsi, 1) |
duke@435 | 136 | .end |