/*
* 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 (c) 2009, Intel Corporation
* All rights reserved.
*/
/*
* strlen - calculate the length of string
*/
#include "SYS.h"
#include "proc64_id.h"
/*
* This implementation uses SSE instructions to compare up to 16 bytes
* at a time looking for the end of string (null char).
*/
/*
* Unaligned case. Round down to 16-byte boundary before comparing
* 16 bytes for a null char. The code then compensates for any extra chars
* preceding the start of the string.
*/
.p2align 4
.p2align 4
/*
* Check to see if BSF is fast on this processor. If not, use a different
* exit tail to find first bit set indicating null byte match.
*/
/*
* This exit tail does not use the bsf instruction.
*/
.p2align 4
.p2align 4
.p2align 4
.p2align 4
.p2align 4
.p2align 4
.p2align 4
.p2align 4
.p2align 4
.p2align 4