usr/src/lib/libc/sparcv9/crt/__align_cpy_4.s
author Mark J. Nelson <Mark.J.Nelson@Sun.COM>
Wed, 06 Aug 2008 16:29:39 -0600
changeset 7298 b69e27387f74
parent 6812 febeba71273d
permissions -rw-r--r--
6733918 Teamware has retired, please welcome your new manager, Mercurial 4758439 some files use "current date" sccs keywords 6560843 asm sources should not rely on .file "%M%" for naming STT_FILE symbols 6560958 Solaris:: perl modules should not use SCCS keywords in version information 6729074 webrev doesn't deal well with remote ssh hg parents
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
     1
/*
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
     2
 * CDDL HEADER START
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
     3
 *
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
     4
 * The contents of this file are subject to the terms of the
6812
febeba71273d PSARC 2008/309 expunge synonyms.h
raf
parents: 0
diff changeset
     5
 * Common Development and Distribution License (the "License").
febeba71273d PSARC 2008/309 expunge synonyms.h
raf
parents: 0
diff changeset
     6
 * You may not use this file except in compliance with the License.
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
     7
 *
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
     8
 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
     9
 * or http://www.opensolaris.org/os/licensing.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    10
 * See the License for the specific language governing permissions
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    11
 * and limitations under the License.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    12
 *
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    13
 * When distributing Covered Code, include this CDDL HEADER in each
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    14
 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    15
 * If applicable, add the following below this CDDL HEADER, with the
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    16
 * fields enclosed by brackets "[]" replaced with your own identifying
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    17
 * information: Portions Copyright [yyyy] [name of copyright owner]
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    18
 *
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    19
 * CDDL HEADER END
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    20
 */
6812
febeba71273d PSARC 2008/309 expunge synonyms.h
raf
parents: 0
diff changeset
    21
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    22
/*
6812
febeba71273d PSARC 2008/309 expunge synonyms.h
raf
parents: 0
diff changeset
    23
 * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
febeba71273d PSARC 2008/309 expunge synonyms.h
raf
parents: 0
diff changeset
    24
 * Use is subject to license terms.
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    25
 */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    26
7298
b69e27387f74 6733918 Teamware has retired, please welcome your new manager, Mercurial
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 6812
diff changeset
    27
	.file	"__align_cpy_4.s"
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    28
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    29
/* __align_cpy_4(s1, s2, n)
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    30
 *
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    31
 * Copy 4-byte aligned source to 4-byte aligned target in multiples of 4 bytes.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    32
 *
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    33
 * Input:
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    34
 *	o0	address of target
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    35
 *	o1	address of source
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    36
 *	o2	number of bytes to copy (must be a multiple of 4)
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    37
 * Output:
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    38
 *	o0	address of target
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    39
 * Caller's registers that have been changed by this function:
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    40
 *	o1-o5, g1, g5
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    41
 *
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    42
 * Note:
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    43
 *	This helper routine will not be used by any 32-bit compilations.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    44
 *	To do so would break binary compatibility with previous versions of
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    45
 *	Solaris.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    46
 *
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    47
 * Assumptions:
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    48
 *	Source and target addresses are 4-byte aligned.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    49
 *	Bytes to be copied are non-overlapping or _exactly_ overlapping.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    50
 *	The number of bytes to be copied is a multiple of 4.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    51
 *	Call will usually be made with a byte count of more than 4*4 and
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    52
 *	less than a few hundred bytes.  Legal values are 0 to MAX_SIZE_T.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    53
 *
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    54
 * Optimization attempt:
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    55
 *	Reasonable speed for a generic v9.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    56
 */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    57
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    58
#include <sys/asm_linkage.h>
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    59
 
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    60
	ENTRY(__align_cpy_4)
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    61
	brz,pn %o2, .done		! Skip out if no bytes to copy.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    62
	cmp	%o0, %o1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    63
	be,pn	%xcc, .done		! Addresses are identical--done.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    64
	and	%o0, 7, %o3		! Is target 8-byte aligned?
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    65
	and	%o1, 7, %o4		! Is source 8-byte aligned?
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    66
	cmp	%o3, %o4
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    67
	bne,pt	%icc, .noton8		! Exactly one of source and target is
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    68
	mov	%o0, %g1		!     8-byte aligned.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    69
	brz,pt	%o3, .both8		! Both are 8-byte aligned.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    70
	nop
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    71
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    72
	ld	[%o1], %o3		! Neither is aligned, so do 4 bytes;
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    73
	subcc	%o2, 4, %o2		! then both will be aligned.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    74
	st	%o3, [%g1]
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    75
	bz,pn	%xcc, .done
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    76
	add	%g1, 4, %g1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    77
	b	.both8
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    78
	add	%o1, 4, %o1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    79
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    80
! Section of code dealing with case where source and target are both 8-byte
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    81
! aligned.  Get and store 16 bytes at a time using ldx and stx.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    82
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    83
	.align	32
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    84
.both8:					! Both source and target are aligned.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    85
	cmp	%o2, 16
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    86
	bl,a,pn %xcc, .chkwd
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    87
	cmp	%o2, 8
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    88
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    89
	sub	%o2, 12, %o2
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    90
.loop16a:				! Load and store 16 bytes at a time.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    91
	ldx	[%o1], %o3
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    92
	ldx	[%o1+8], %o4
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    93
	subcc	%o2, 16, %o2
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    94
	stx	%o3, [%g1]
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    95
	stx	%o4, [%g1+8]
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    96
	add	%o1, 16, %o1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    97
	bg,pt	%xcc, .loop16a		! Have at least 16 bytes left.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    98
	add	%g1, 16, %g1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    99
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   100
	addcc	%o2, 12, %o2
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   101
	bg,a,pt	%xcc, .chkwd		! Have some remaining bytes.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   102
	cmp	%o2, 8
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   103
	retl
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   104
	nop
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   105
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   106
.chkwd:
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   107
	bl,a,pn	%xcc, .wrword		! Only 4 bytes left.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   108
	ld	[%o1], %o3
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   109
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   110
	ldx	[%o1], %o3		! Have 8 or 12, so do 8.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   111
	stx	%o3, [%g1]
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   112
	add	%o1, 8, %o1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   113
	add	%g1, 8, %g1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   114
	subcc	%o2, 8, %o2
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   115
	bg,a,pn %xcc, .wrword		! Still have four to do.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   116
	ld	[%o1], %o3
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   117
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   118
	retl
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   119
	nop
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   120
	
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   121
.wrword:				! Copy final word.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   122
	st	%o3, [%g1]
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   123
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   124
.done:
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   125
	retl
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   126
	nop
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   127
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   128
! Section of code where either source or target, but not both, are 8-byte
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   129
! aligned.  So, use ld and st instructions rather than trying to copy stuff
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   130
! around in registers.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   131
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   132
	.align	32			! Ultra cache line boundary.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   133
.noton8:
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   134
	add	%o1, %o2, %g5	! Ending address of source.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   135
	andcc	%o2, 15, %o3	! Mod 16 of number of bytes to copy.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   136
	bz,pn	%xcc, .loop16	! Copy odd amounts first, then multiples of 16.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   137
	cmp	%o3, 4
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   138
	bz,pn	%xcc, .mod4
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   139
	cmp	%o3, 8
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   140
	bz,pn	%xcc, .mod8
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   141
	cmp	%o3, 12
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   142
	bz,pt	%xcc, .mod12
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   143
	nop
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   144
	illtrap	0		! Size not valid.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   145
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   146
.mod4:				! Do first 4 bytes, then do multiples of 16.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   147
	lduw	[%o1], %o2
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   148
	add	%o1, 4, %o1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   149
	st	%o2, [%g1]
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   150
	cmp	%o1, %g5
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   151
	bl,a,pt %xcc, .loop16
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   152
	add	%g1, 4, %g1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   153
	retl
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   154
	nop
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   155
.mod8:				! Do first 8 bytes, then do multiples of 16.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   156
	lduw	[%o1], %o2
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   157
	lduw	[%o1+4], %o3
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   158
	add	%o1, 8, %o1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   159
	st	%o2, [%g1]
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   160
	st	%o3, [%g1+4]
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   161
	cmp	%o1, %g5
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   162
	bl,a,pt	%xcc, .loop16
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   163
	add	%g1, 8, %g1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   164
	retl
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   165
	nop
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   166
.mod12:				! Do first 12 bytes, then do multiples of 16.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   167
	lduw	[%o1], %o2
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   168
	lduw	[%o1+4], %o3
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   169
	lduw	[%o1+8], %o4
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   170
	add	%o1, 12, %o1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   171
	st	%o2, [%g1]
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   172
	st	%o3, [%g1+4]
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   173
	st	%o4, [%g1+8]
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   174
	cmp	%o1, %g5
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   175
	bl,a,pt	%xcc, .loop16
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   176
	add	%g1, 12, %g1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   177
	retl
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   178
	nop
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   179
	.align	32			! Ultra cache line boundary.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   180
.loop16:				! Do multiples of 16 bytes.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   181
	lduw	[%o1], %o2
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   182
	lduw	[%o1+4], %o3
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   183
	lduw	[%o1+8], %o4
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   184
	lduw	[%o1+12], %o5
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   185
	add	%o1, 16, %o1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   186
	st	%o2, [%g1]
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   187
	st	%o3, [%g1+4]
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   188
	cmp	%o1, %g5
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   189
	st	%o4, [%g1+8]
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   190
	st	%o5, [%g1+12]
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   191
	bl,a,pt	%xcc, .loop16
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   192
	add	%g1, 16,%g1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   193
	retl			! Target address is already in o0.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   194
	nop
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   195
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   196
	SET_SIZE(__align_cpy_4)