hotspot/src/os_cpu/bsd_x86/vm/bsd_x86_64.s
author katleman
Thu, 06 Jun 2013 09:54:40 -0700
changeset 17989 7a038718c2b1
parent 10565 dc90c239f4ec
child 18740 db44b1599483
permissions -rw-r--r--
Added tag jdk8-b93 for changeset 3ea33579af2b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10565
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
     1
# 
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
     2
# Copyright (c) 2004, 2007, Oracle and/or its affiliates. All rights reserved.
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
     4
#
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
     7
# published by the Free Software Foundation.
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
     8
#
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
     9
# This code is distributed in the hope that it will be useful, but WITHOUT
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    10
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    11
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    12
# version 2 for more details (a copy is included in the LICENSE file that
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    13
# accompanied this code).
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    14
#
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    15
# You should have received a copy of the GNU General Public License version
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    16
# 2 along with this work; if not, write to the Free Software Foundation,
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    17
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    18
#
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    19
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    20
# or visit www.oracle.com if you need additional information or have any
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    21
# questions.
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    22
#
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    23
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    24
#ifdef __APPLE__
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    25
# Darwin uses _ prefixed global symbols
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    26
#define SYMBOL(s) _ ## s
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    27
#define ELF_TYPE(name, description)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    28
#else
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    29
#define SYMBOL(s) s
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    30
#define ELF_TYPE(name, description) .type name,description
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    31
#endif
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    32
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    33
        # NOTE WELL!  The _Copy functions are called directly
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    34
	# from server-compiler-generated code via CallLeafNoFP,
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    35
	# which means that they *must* either not use floating
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    36
	# point or use it in the same manner as does the server
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    37
	# compiler.
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    38
	
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    39
        .globl SYMBOL(_Copy_arrayof_conjoint_bytes)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    40
	.globl SYMBOL(_Copy_arrayof_conjoint_jshorts)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    41
        .globl SYMBOL(_Copy_conjoint_jshorts_atomic)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    42
        .globl SYMBOL(_Copy_arrayof_conjoint_jints)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    43
        .globl SYMBOL(_Copy_conjoint_jints_atomic)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    44
        .globl SYMBOL(_Copy_arrayof_conjoint_jlongs)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    45
        .globl SYMBOL(_Copy_conjoint_jlongs_atomic)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    46
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    47
	.text
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    48
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    49
        .globl SYMBOL(SafeFetch32), SYMBOL(Fetch32PFI), SYMBOL(Fetch32Resume)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    50
        .p2align 4,,15
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    51
        ELF_TYPE(SafeFetch32,@function)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    52
        // Prototype: int SafeFetch32 (int * Adr, int ErrValue) 
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    53
SYMBOL(SafeFetch32):
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    54
        movl    %esi, %eax
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    55
SYMBOL(Fetch32PFI):
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    56
        movl    (%rdi), %eax
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    57
SYMBOL(Fetch32Resume):
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    58
        ret
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    59
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    60
        .globl SYMBOL(SafeFetchN), SYMBOL(FetchNPFI), SYMBOL(FetchNResume)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    61
        .p2align 4,,15
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    62
        ELF_TYPE(SafeFetchN,@function)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    63
        // Prototype: intptr_t SafeFetchN (intptr_t * Adr, intptr_t ErrValue) 
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    64
SYMBOL(SafeFetchN):
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    65
        movq    %rsi, %rax
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    66
SYMBOL(FetchNPFI):
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    67
        movq    (%rdi), %rax
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    68
SYMBOL(FetchNResume):
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    69
        ret
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    70
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    71
        .globl SYMBOL(SpinPause)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    72
        .p2align 4,,15
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    73
        ELF_TYPE(SpinPause,@function)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    74
SYMBOL(SpinPause):
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    75
        rep
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    76
        nop
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    77
        movq   $1, %rax
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    78
        ret
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    79
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    80
        # Support for void Copy::arrayof_conjoint_bytes(void* from,
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    81
        #                                               void* to,
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    82
        #                                               size_t count)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    83
        # rdi - from
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    84
        # rsi - to
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    85
        # rdx - count, treated as ssize_t
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    86
        #
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    87
        .p2align 4,,15
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    88
	ELF_TYPE(_Copy_arrayof_conjoint_bytes,@function)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    89
SYMBOL(_Copy_arrayof_conjoint_bytes):
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    90
        movq     %rdx,%r8             # byte count
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    91
        shrq     $3,%rdx              # qword count
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    92
        cmpq     %rdi,%rsi
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    93
        leaq     -1(%rdi,%r8,1),%rax  # from + bcount*1 - 1
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    94
        jbe      acb_CopyRight
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    95
        cmpq     %rax,%rsi
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    96
        jbe      acb_CopyLeft 
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    97
acb_CopyRight:
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    98
        leaq     -8(%rdi,%rdx,8),%rax # from + qcount*8 - 8
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    99
        leaq     -8(%rsi,%rdx,8),%rcx # to + qcount*8 - 8
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   100
        negq     %rdx
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   101
        jmp      7f
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   102
        .p2align 4,,15
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   103
1:      movq     8(%rax,%rdx,8),%rsi
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   104
        movq     %rsi,8(%rcx,%rdx,8)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   105
        addq     $1,%rdx
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   106
        jnz      1b
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   107
2:      testq    $4,%r8               # check for trailing dword
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   108
        jz       3f
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   109
        movl     8(%rax),%esi         # copy trailing dword
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   110
        movl     %esi,8(%rcx)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   111
        addq     $4,%rax
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   112
        addq     $4,%rcx              # original %rsi is trashed, so we
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   113
                                      #  can't use it as a base register
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   114
3:      testq    $2,%r8               # check for trailing word
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   115
        jz       4f
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   116
        movw     8(%rax),%si          # copy trailing word
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   117
        movw     %si,8(%rcx)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   118
        addq     $2,%rcx
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   119
4:      testq    $1,%r8               # check for trailing byte
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   120
        jz       5f
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   121
        movb     -1(%rdi,%r8,1),%al   # copy trailing byte
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   122
        movb     %al,8(%rcx)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   123
5:      ret
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   124
        .p2align 4,,15
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   125
6:      movq     -24(%rax,%rdx,8),%rsi
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   126
        movq     %rsi,-24(%rcx,%rdx,8)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   127
        movq     -16(%rax,%rdx,8),%rsi
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   128
        movq     %rsi,-16(%rcx,%rdx,8)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   129
        movq     -8(%rax,%rdx,8),%rsi
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   130
        movq     %rsi,-8(%rcx,%rdx,8)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   131
        movq     (%rax,%rdx,8),%rsi
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   132
        movq     %rsi,(%rcx,%rdx,8)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   133
7:      addq     $4,%rdx
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   134
        jle      6b
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   135
        subq     $4,%rdx
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   136
        jl       1b
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   137
        jmp      2b
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   138
acb_CopyLeft:
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   139
        testq    $1,%r8               # check for trailing byte
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   140
        jz       1f
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   141
        movb     -1(%rdi,%r8,1),%cl   # copy trailing byte
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   142
        movb     %cl,-1(%rsi,%r8,1)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   143
        subq     $1,%r8               # adjust for possible trailing word
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   144
1:      testq    $2,%r8               # check for trailing word
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   145
        jz       2f
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   146
        movw     -2(%rdi,%r8,1),%cx   # copy trailing word
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   147
        movw     %cx,-2(%rsi,%r8,1)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   148
2:      testq    $4,%r8               # check for trailing dword
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   149
        jz       5f
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   150
        movl     (%rdi,%rdx,8),%ecx   # copy trailing dword
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   151
        movl     %ecx,(%rsi,%rdx,8)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   152
        jmp      5f
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   153
        .p2align 4,,15
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   154
3:      movq     -8(%rdi,%rdx,8),%rcx
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   155
        movq     %rcx,-8(%rsi,%rdx,8)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   156
        subq     $1,%rdx
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   157
        jnz      3b
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   158
        ret
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   159
        .p2align 4,,15
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   160
4:      movq     24(%rdi,%rdx,8),%rcx
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   161
        movq     %rcx,24(%rsi,%rdx,8)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   162
        movq     16(%rdi,%rdx,8),%rcx
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   163
        movq     %rcx,16(%rsi,%rdx,8)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   164
        movq     8(%rdi,%rdx,8),%rcx
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   165
        movq     %rcx,8(%rsi,%rdx,8)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   166
        movq     (%rdi,%rdx,8),%rcx
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   167
        movq     %rcx,(%rsi,%rdx,8)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   168
5:      subq     $4,%rdx
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   169
        jge      4b
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   170
        addq     $4,%rdx
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   171
        jg       3b
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   172
        ret
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   173
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   174
        # Support for void Copy::arrayof_conjoint_jshorts(void* from,
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   175
        #                                                 void* to,
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   176
        #                                                 size_t count)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   177
        # Equivalent to
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   178
        #   conjoint_jshorts_atomic
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   179
        #
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   180
        # If 'from' and/or 'to' are aligned on 4- or 2-byte boundaries, we
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   181
        # let the hardware handle it.  The tow or four words within dwords
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   182
        # or qwords that span cache line boundaries will still be loaded
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   183
        # and stored atomically.
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   184
        #
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   185
        # rdi - from
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   186
        # rsi - to
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   187
        # rdx - count, treated as ssize_t
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   188
        #
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   189
        .p2align 4,,15
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   190
	ELF_TYPE(_Copy_arrayof_conjoint_jshorts,@function)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   191
	ELF_TYPE(_Copy_conjoint_jshorts_atomic,@function)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   192
SYMBOL(_Copy_arrayof_conjoint_jshorts):
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   193
SYMBOL(_Copy_conjoint_jshorts_atomic):
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   194
        movq     %rdx,%r8             # word count
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   195
        shrq     $2,%rdx              # qword count
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   196
        cmpq     %rdi,%rsi
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   197
        leaq     -2(%rdi,%r8,2),%rax  # from + wcount*2 - 2
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   198
        jbe      acs_CopyRight
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   199
        cmpq     %rax,%rsi
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   200
        jbe      acs_CopyLeft 
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   201
acs_CopyRight:
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   202
        leaq     -8(%rdi,%rdx,8),%rax # from + qcount*8 - 8
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   203
        leaq     -8(%rsi,%rdx,8),%rcx # to + qcount*8 - 8
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   204
        negq     %rdx
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   205
        jmp      6f
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   206
1:      movq     8(%rax,%rdx,8),%rsi
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   207
        movq     %rsi,8(%rcx,%rdx,8)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   208
        addq     $1,%rdx
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   209
        jnz      1b
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   210
2:      testq    $2,%r8               # check for trailing dword
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   211
        jz       3f
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   212
        movl     8(%rax),%esi         # copy trailing dword
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   213
        movl     %esi,8(%rcx)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   214
        addq     $4,%rcx              # original %rsi is trashed, so we
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   215
                                      #  can't use it as a base register
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   216
3:      testq    $1,%r8               # check for trailing word
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   217
        jz       4f
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   218
        movw     -2(%rdi,%r8,2),%si   # copy trailing word
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   219
        movw     %si,8(%rcx)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   220
4:      ret
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   221
        .p2align 4,,15
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   222
5:      movq     -24(%rax,%rdx,8),%rsi
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   223
        movq     %rsi,-24(%rcx,%rdx,8)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   224
        movq     -16(%rax,%rdx,8),%rsi
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   225
        movq     %rsi,-16(%rcx,%rdx,8)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   226
        movq     -8(%rax,%rdx,8),%rsi
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   227
        movq     %rsi,-8(%rcx,%rdx,8)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   228
        movq     (%rax,%rdx,8),%rsi
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   229
        movq     %rsi,(%rcx,%rdx,8)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   230
6:      addq     $4,%rdx
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   231
        jle      5b
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   232
        subq     $4,%rdx
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   233
        jl       1b
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   234
        jmp      2b
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   235
acs_CopyLeft:
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   236
        testq    $1,%r8               # check for trailing word
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   237
        jz       1f
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   238
        movw     -2(%rdi,%r8,2),%cx   # copy trailing word
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   239
        movw     %cx,-2(%rsi,%r8,2)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   240
1:      testq    $2,%r8               # check for trailing dword
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   241
        jz       4f
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   242
        movl     (%rdi,%rdx,8),%ecx   # copy trailing dword
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   243
        movl     %ecx,(%rsi,%rdx,8)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   244
        jmp      4f
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   245
2:      movq     -8(%rdi,%rdx,8),%rcx
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   246
        movq     %rcx,-8(%rsi,%rdx,8)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   247
        subq     $1,%rdx
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   248
        jnz      2b
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   249
        ret
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   250
        .p2align 4,,15
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   251
3:      movq     24(%rdi,%rdx,8),%rcx
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   252
        movq     %rcx,24(%rsi,%rdx,8)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   253
        movq     16(%rdi,%rdx,8),%rcx
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   254
        movq     %rcx,16(%rsi,%rdx,8)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   255
        movq     8(%rdi,%rdx,8),%rcx
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   256
        movq     %rcx,8(%rsi,%rdx,8)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   257
        movq     (%rdi,%rdx,8),%rcx
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   258
        movq     %rcx,(%rsi,%rdx,8)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   259
4:      subq     $4,%rdx
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   260
        jge      3b
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   261
        addq     $4,%rdx
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   262
        jg       2b
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   263
        ret
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   264
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   265
        # Support for void Copy::arrayof_conjoint_jints(jint* from,
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   266
        #                                               jint* to,
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   267
        #                                               size_t count)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   268
        # Equivalent to
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   269
        #   conjoint_jints_atomic
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   270
        #
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   271
        # If 'from' and/or 'to' are aligned on 4-byte boundaries, we let
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   272
        # the hardware handle it.  The two dwords within qwords that span
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   273
        # cache line boundaries will still be loaded and stored atomically.
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   274
        #
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   275
        # rdi - from
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   276
        # rsi - to
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   277
        # rdx - count, treated as ssize_t
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   278
        #
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   279
        .p2align 4,,15
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   280
	ELF_TYPE(_Copy_arrayof_conjoint_jints,@function)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   281
	ELF_TYPE(_Copy_conjoint_jints_atomic,@function)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   282
SYMBOL(_Copy_arrayof_conjoint_jints):
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   283
SYMBOL(_Copy_conjoint_jints_atomic):
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   284
        movq     %rdx,%r8             # dword count
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   285
        shrq     %rdx                 # qword count
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   286
        cmpq     %rdi,%rsi
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   287
        leaq     -4(%rdi,%r8,4),%rax  # from + dcount*4 - 4
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   288
        jbe      aci_CopyRight
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   289
        cmpq     %rax,%rsi
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   290
        jbe      aci_CopyLeft 
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   291
aci_CopyRight:
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   292
        leaq     -8(%rdi,%rdx,8),%rax # from + qcount*8 - 8
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   293
        leaq     -8(%rsi,%rdx,8),%rcx # to + qcount*8 - 8
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   294
        negq     %rdx
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   295
        jmp      5f
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   296
        .p2align 4,,15
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   297
1:      movq     8(%rax,%rdx,8),%rsi
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   298
        movq     %rsi,8(%rcx,%rdx,8)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   299
        addq     $1,%rdx
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   300
        jnz       1b
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   301
2:      testq    $1,%r8               # check for trailing dword
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   302
        jz       3f
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   303
        movl     8(%rax),%esi         # copy trailing dword
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   304
        movl     %esi,8(%rcx)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   305
3:      ret
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   306
        .p2align 4,,15
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   307
4:      movq     -24(%rax,%rdx,8),%rsi
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   308
        movq     %rsi,-24(%rcx,%rdx,8)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   309
        movq     -16(%rax,%rdx,8),%rsi
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   310
        movq     %rsi,-16(%rcx,%rdx,8)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   311
        movq     -8(%rax,%rdx,8),%rsi
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   312
        movq     %rsi,-8(%rcx,%rdx,8)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   313
        movq     (%rax,%rdx,8),%rsi
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   314
        movq     %rsi,(%rcx,%rdx,8)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   315
5:      addq     $4,%rdx
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   316
        jle      4b
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   317
        subq     $4,%rdx
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   318
        jl       1b
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   319
        jmp      2b
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   320
aci_CopyLeft:
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   321
        testq    $1,%r8               # check for trailing dword
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   322
        jz       3f
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   323
        movl     -4(%rdi,%r8,4),%ecx  # copy trailing dword
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   324
        movl     %ecx,-4(%rsi,%r8,4)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   325
        jmp      3f
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   326
1:      movq     -8(%rdi,%rdx,8),%rcx
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   327
        movq     %rcx,-8(%rsi,%rdx,8)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   328
        subq     $1,%rdx
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   329
        jnz      1b
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   330
        ret
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   331
        .p2align 4,,15
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   332
2:      movq     24(%rdi,%rdx,8),%rcx
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   333
        movq     %rcx,24(%rsi,%rdx,8)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   334
        movq     16(%rdi,%rdx,8),%rcx
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   335
        movq     %rcx,16(%rsi,%rdx,8)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   336
        movq     8(%rdi,%rdx,8),%rcx
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   337
        movq     %rcx,8(%rsi,%rdx,8)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   338
        movq     (%rdi,%rdx,8),%rcx
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   339
        movq     %rcx,(%rsi,%rdx,8)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   340
3:      subq     $4,%rdx
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   341
        jge      2b
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   342
        addq     $4,%rdx
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   343
        jg       1b
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   344
        ret
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   345
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   346
        # Support for void Copy::arrayof_conjoint_jlongs(jlong* from,
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   347
        #                                                jlong* to,
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   348
        #                                                size_t count)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   349
        # Equivalent to
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   350
        #   conjoint_jlongs_atomic
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   351
        #   arrayof_conjoint_oops
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   352
        #   conjoint_oops_atomic
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   353
        #
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   354
        # rdi - from
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   355
        # rsi - to
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   356
        # rdx - count, treated as ssize_t
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   357
        #
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   358
        .p2align 4,,15
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   359
	ELF_TYPE(_Copy_arrayof_conjoint_jlongs,@function)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   360
	ELF_TYPE(_Copy_conjoint_jlongs_atomic,@function)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   361
SYMBOL(_Copy_arrayof_conjoint_jlongs):
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   362
SYMBOL(_Copy_conjoint_jlongs_atomic):
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   363
        cmpq     %rdi,%rsi
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   364
        leaq     -8(%rdi,%rdx,8),%rax # from + count*8 - 8
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   365
        jbe      acl_CopyRight
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   366
        cmpq     %rax,%rsi
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   367
        jbe      acl_CopyLeft 
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   368
acl_CopyRight:
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   369
        leaq     -8(%rsi,%rdx,8),%rcx # to + count*8 - 8
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   370
        negq     %rdx
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   371
        jmp      3f
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   372
1:      movq     8(%rax,%rdx,8),%rsi
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   373
        movq     %rsi,8(%rcx,%rdx,8)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   374
        addq     $1,%rdx
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   375
        jnz      1b
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   376
        ret
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   377
        .p2align 4,,15
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   378
2:      movq     -24(%rax,%rdx,8),%rsi
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   379
        movq     %rsi,-24(%rcx,%rdx,8)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   380
        movq     -16(%rax,%rdx,8),%rsi
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   381
        movq     %rsi,-16(%rcx,%rdx,8)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   382
        movq     -8(%rax,%rdx,8),%rsi
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   383
        movq     %rsi,-8(%rcx,%rdx,8)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   384
        movq     (%rax,%rdx,8),%rsi
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   385
        movq     %rsi,(%rcx,%rdx,8)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   386
3:      addq     $4,%rdx
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   387
        jle      2b
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   388
        subq     $4,%rdx
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   389
        jl       1b
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   390
        ret
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   391
4:      movq     -8(%rdi,%rdx,8),%rcx
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   392
        movq     %rcx,-8(%rsi,%rdx,8)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   393
        subq     $1,%rdx
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   394
        jnz      4b
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   395
        ret
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   396
        .p2align 4,,15
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   397
5:      movq     24(%rdi,%rdx,8),%rcx
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   398
        movq     %rcx,24(%rsi,%rdx,8)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   399
        movq     16(%rdi,%rdx,8),%rcx
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   400
        movq     %rcx,16(%rsi,%rdx,8)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   401
        movq     8(%rdi,%rdx,8),%rcx
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   402
        movq     %rcx,8(%rsi,%rdx,8)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   403
        movq     (%rdi,%rdx,8),%rcx
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   404
        movq     %rcx,(%rsi,%rdx,8)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   405
acl_CopyLeft:
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   406
        subq     $4,%rdx
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   407
        jge      5b
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   408
        addq     $4,%rdx
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   409
        jg       4b
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   410
        ret