src/os_cpu/solaris_x86/vm/solaris_x86_32.il

Thu, 21 Oct 2010 11:55:10 -0700

author
never
date
Thu, 21 Oct 2010 11:55:10 -0700
changeset 2262
1e9a9d2e6509
parent 1907
c18cbe5936b8
child 2384
0a8e0d4345b3
child 2434
4fc084dac61e
permissions
-rw-r--r--

6970683: improvements to hs_err output
Reviewed-by: kvn, jrose, dholmes, coleenp

duke@435 1 //
trims@1907 2 // Copyright (c) 2003, 2009, Oracle and/or its affiliates. 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 //
trims@1907 19 // Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
trims@1907 20 // or visit www.oracle.com if you need additional information or have any
trims@1907 21 // questions.
duke@435 22 //
duke@435 23 //
duke@435 24
duke@435 25
duke@435 26 // Support for u8 os::setup_fpu()
duke@435 27 .inline _solaris_raw_setup_fpu,1
duke@435 28 movl 0(%esp), %eax
duke@435 29 fldcw (%eax)
duke@435 30 .end
duke@435 31
duke@435 32 // The argument size of each inline directive is ignored by the compiler
duke@435 33 // and is set to 0 for compatibility reason.
duke@435 34
duke@435 35 // Get the raw thread ID from %gs:0
duke@435 36 .inline _raw_thread_id,0
duke@435 37 movl %gs:0, %eax
duke@435 38 .end
duke@435 39
coleenp@907 40 // Get current fp
coleenp@907 41 .inline _get_current_fp,0
coleenp@907 42 .volatile
duke@435 43 movl %ebp, %eax
duke@435 44 .end
duke@435 45
duke@435 46 // Support for jint Atomic::add(jint inc, volatile jint* dest)
duke@435 47 // An additional bool (os::is_MP()) is passed as the last argument.
duke@435 48 .inline _Atomic_add,3
duke@435 49 movl 0(%esp), %eax // inc
duke@435 50 movl 4(%esp), %edx // dest
duke@435 51 movl %eax, %ecx
duke@435 52 cmpl $0, 8(%esp) // MP test
jcoomes@1902 53 jne 1f
jcoomes@1902 54 xaddl %eax, (%edx)
jcoomes@1902 55 jmp 2f
jcoomes@1902 56 1: lock
jcoomes@1902 57 xaddl %eax, (%edx)
jcoomes@1902 58 2: addl %ecx, %eax
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 movl 0(%esp), %eax // exchange_value
duke@435 64 movl 4(%esp), %ecx // dest
duke@435 65 xchgl (%ecx), %eax
duke@435 66 .end
duke@435 67
duke@435 68 // Support for jint Atomic::cmpxchg(jint exchange_value,
duke@435 69 // volatile jint *dest,
duke@435 70 // jint compare_value)
duke@435 71 // An additional bool (os::is_MP()) is passed as the last argument.
duke@435 72 .inline _Atomic_cmpxchg,4
duke@435 73 movl 8(%esp), %eax // compare_value
duke@435 74 movl 0(%esp), %ecx // exchange_value
duke@435 75 movl 4(%esp), %edx // dest
duke@435 76 cmp $0, 12(%esp) // MP test
jcoomes@1902 77 jne 1f
jcoomes@1902 78 cmpxchgl %ecx, (%edx)
jcoomes@1902 79 jmp 2f
jcoomes@1902 80 1: lock
jcoomes@1902 81 cmpxchgl %ecx, (%edx)
jcoomes@1902 82 2:
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 pushl %ebx
duke@435 91 pushl %edi
duke@435 92 movl 20(%esp), %eax // compare_value (low)
duke@435 93 movl 24(%esp), %edx // compare_value (high)
duke@435 94 movl 16(%esp), %edi // dest
duke@435 95 movl 8(%esp), %ebx // exchange_value (low)
duke@435 96 movl 12(%esp), %ecx // exchange_high (high)
duke@435 97 cmp $0, 28(%esp) // MP test
jcoomes@1902 98 jne 1f
jcoomes@1902 99 cmpxchg8b (%edi)
jcoomes@1902 100 jmp 2f
jcoomes@1902 101 1: lock
jcoomes@1902 102 cmpxchg8b (%edi)
jcoomes@1902 103 2: popl %edi
duke@435 104 popl %ebx
duke@435 105 .end
duke@435 106
kvn@1329 107 // Support for void Atomic::load(volatile jlong* src, volatile jlong* dest).
kvn@1329 108 .inline _Atomic_load_long,2
kvn@1329 109 movl 0(%esp), %eax // src
kvn@1329 110 fildll (%eax)
kvn@1329 111 movl 4(%esp), %eax // dest
kvn@1329 112 fistpll (%eax)
kvn@1329 113 .end
kvn@1329 114
kvn@1329 115
duke@435 116 // Support for OrderAccess::acquire()
duke@435 117 .inline _OrderAccess_acquire,0
duke@435 118 movl 0(%esp), %eax
duke@435 119 .end
duke@435 120
duke@435 121 // Support for OrderAccess::fence()
duke@435 122 .inline _OrderAccess_fence,0
duke@435 123 lock
duke@435 124 addl $0, (%esp)
duke@435 125 .end
duke@435 126
duke@435 127 // Support for u2 Bytes::swap_u2(u2 x)
duke@435 128 .inline _raw_swap_u2,1
duke@435 129 movl 0(%esp), %eax
duke@435 130 xchgb %al, %ah
duke@435 131 .end
duke@435 132
duke@435 133 // Support for u4 Bytes::swap_u4(u4 x)
duke@435 134 .inline _raw_swap_u4,1
duke@435 135 movl 0(%esp), %eax
duke@435 136 bswap %eax
duke@435 137 .end
duke@435 138
duke@435 139 // Support for u8 Bytes::swap_u8_base(u4 x, u4 y)
duke@435 140 .inline _raw_swap_u8,2
duke@435 141 movl 4(%esp), %eax // y
duke@435 142 movl 0(%esp), %edx // x
duke@435 143 bswap %eax
duke@435 144 bswap %edx
duke@435 145 .end

mercurial