/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/asm_linkage.h>
#include <sys/privregs.h>
#if defined(__lint)
#include <sys/archsystm.h>
#else
#include "assym.h"
#endif
/*
* Do block operations using Streaming SIMD extensions
*/
#if defined(DEBUG)
#if defined(__amd64)
jne 5f; \
5:
jne 5f; \
5:
#endif /* __i386 */
#else /* DEBUG */
#endif /* DEBUG */
#error "mucked up constants"
#endif
#if defined(__lint)
/*ARGSUSED*/
void
{}
#else /* __lint */
#if defined(__amd64)
#else
#endif
#define SAVE_XMM0(r) \
SAVE_XMM_PROLOG(r, 1); \
#define RSTOR_XMM0(r) \
RSTOR_XMM_EPILOG(r, 1)
#if defined(__amd64)
/*
* %rdi dst
* %rsi size
* %rax saved %cr0 (#if DEBUG then %eax is t->t_preempt)
* %r8 pointer to %xmm register save area
*/
jnz 1f
jnz 9b
jnz 2f
RSTOR_XMM0(%r8)
.dobzero:
/*
* %eax dst
* %ecx size in bytes, loop count
* %ebx saved %cr0 (#if DEBUG then t->t_preempt)
* %edi pointer to %xmm register save area
*/
jnz 1f
jnz 9b
jnz 2f
.dobzero:
#endif /* __i386 */
#endif /* __lint */
#if defined(__lint)
/*ARGSUSED*/
void
{}
#else /* __lint */
#define SAVE_XMMS(r) \
SAVE_XMM_PROLOG(r, 8); \
#define RSTOR_XMMS(r) \
RSTOR_XMM_EPILOG(r, 8)
#if defined(__amd64)
/*
* %rdi src
* %rsi dst
* %rdx #if DEBUG then curthread
* %ecx loop count
* %rax saved %cr0 (#if DEBUG then %eax is t->t_prempt)
* %r8 pointer to %xmm register save area
*/
/*
* PAGESIZE is 4096, each loop moves 128 bytes, but the initial
* load and final store save us on loop count
*/
jnz 3f
jnz 4b
jnz 5f
RSTOR_XMMS(%r8)
/*
* %eax src
* %edx dst
* %ecx loop count
* %ebx saved %cr0 (#if DEBUG then t->t_prempt)
* %edi pointer to %xmm register save area
* %esi #if DEBUG temporary thread pointer
*/
/*
* PAGESIZE is 4096, each loop moves 128 bytes, but the initial
* load and final store save us one loop count
*/
jnz 3f
jnz 4b
jnz 5f
#endif /* __i386 */
#endif /* __lint */
#if defined(__lint)
/*
* Version of hwblkclr which doesn't use XMM registers.
* Note that it requires aligned dst and len.
*
* XXPV This needs to be performance tuned at some point.
* Is 4 the best number of iterations to unroll?
*/
/*ARGSUSED*/
void
{}
#else /* __lint */
#if defined(__amd64)
1:
jnz 1b
1:
jnz 1b
#endif /* __i386 */
#endif /* __lint */
#if defined(__lint)
/*
* Version of page copy which doesn't use XMM registers.
*
* XXPV This needs to be performance tuned at some point.
* Is 4 the right number of iterations to unroll?
*/
/*ARGSUSED*/
void
{}
#else /* __lint */
#if defined(__amd64)
1:
jnz 1b
1:
jnz 1b
#endif /* __i386 */
#endif /* __lint */
.text
.string "sseblk: preemption not disabled!"
#endif