hotspot/src/os_cpu/linux_sparc/vm/linux_sparc.s
author peytoia
Tue, 18 May 2010 16:40:53 +0900
changeset 5582 8fe2018bcf68
parent 670 ddf3e9583f2f
child 5547 f4b087cbb361
permissions -rw-r--r--
6953294: Fix for 6909002 was incorrectly merged Reviewed-by: okutsu
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
380
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
     1
#
670
ddf3e9583f2f 6719955: Update copyright year
xdono
parents: 380
diff changeset
     2
# Copyright 2005-2008 Sun Microsystems, Inc.  All Rights Reserved.
380
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
     4
#
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
     7
# published by the Free Software Foundation.
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
     8
#
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
     9
# This code is distributed in the hope that it will be useful, but WITHOUT
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    10
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    11
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    12
# version 2 for more details (a copy is included in the LICENSE file that
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    13
# accompanied this code).
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    14
#
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    15
# You should have received a copy of the GNU General Public License version
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    16
# 2 along with this work; if not, write to the Free Software Foundation,
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    17
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    18
#
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    19
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    20
# CA 95054 USA or visit www.sun.com if you need additional information or
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    21
# have any questions.
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    22
#
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    23
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    24
    # Prototype: int SafeFetch32 (int * adr, int ErrValue)
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    25
    # The "ld" at Fetch32 is potentially faulting instruction.
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    26
    # If the instruction traps the trap handler will arrange
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    27
    # for control to resume at Fetch32Resume.  
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    28
    # By convention with the trap handler we ensure there is a non-CTI
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    29
    # instruction in the trap shadow.  
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    30
        
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    31
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    32
    .globl  SafeFetch32, Fetch32PFI, Fetch32Resume
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    33
    .globl  SafeFetchN
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    34
    .align  32
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    35
    .type    SafeFetch32,@function
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    36
SafeFetch32:        
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    37
    mov     %o0, %g1
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    38
    mov     %o1, %o0
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    39
Fetch32PFI:
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    40
    # <-- Potentially faulting instruction
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    41
    ld      [%g1], %o0         
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    42
Fetch32Resume:
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    43
    nop
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    44
    retl
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    45
    nop
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    46
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    47
    .globl  SafeFetchN, FetchNPFI, FetchNResume
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    48
    .type    SafeFetchN,@function
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    49
    .align  32
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    50
SafeFetchN:
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    51
    mov     %o0, %g1
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    52
    mov     %o1, %o0
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    53
FetchNPFI:
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    54
    ldn     [%g1], %o0
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    55
FetchNResume:
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    56
    nop
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    57
    retl
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    58
    nop
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    59
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    60
    # Possibilities:
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    61
    # -- membar
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    62
    # -- CAS (SP + BIAS, G0, G0)
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    63
    # -- wr %g0, %asi
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    64
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    65
    .globl SpinPause
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    66
    .type   SpinPause,@function
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    67
    .align  32
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    68
SpinPause:      
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    69
    retl
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    70
    mov %g0, %o0
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    71
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    72
   .globl _Copy_conjoint_jlongs_atomic
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    73
   .type   _Copy_conjoint_jlongs_atomic,@function
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    74
_Copy_conjoint_jlongs_atomic:
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    75
        cmp     %o0, %o1
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    76
	bleu    4f
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    77
	sll     %o2, 3, %o4
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    78
        ba      2f
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    79
   1:
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    80
	subcc   %o4, 8, %o4
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    81
	std     %o2, [%o1]
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    82
	add     %o0, 8, %o0
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    83
	add     %o1, 8, %o1
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    84
   2:
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    85
	bge,a   1b
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    86
	ldd     [%o0], %o2
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    87
	ba      5f
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    88
        nop
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    89
   3:
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    90
	std     %o2, [%o1+%o4]
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    91
   4:
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    92
	subcc   %o4, 8, %o4
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    93
	bge,a   3b
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    94
	ldd     [%o0+%o4], %o2
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    95
   5:      
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    96
	retl
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    97
	nop
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    98
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
    99
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
   100
    .globl _flush_reg_windows
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
   101
    .align 32
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
   102
 _flush_reg_windows:
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
   103
        ta 0x03
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
   104
        retl
ec5fd25a5edf 6693457: Open-source hotspot linux-sparc support
phh
parents:
diff changeset
   105
        mov     %fp, %o0