/*
* 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 2011 Nexenta Systems, Inc. All rights reserved.
*/
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
.file "ieee_funcl.s"
#include "libm.h"
.not_inf:
.align 16
/ & 0 < bexp(x) < 0x7fff)
.L8:
.align 16
jz .may_be_subnorm / jump iff msb(sgnfcnd(x)) = 0
.not_subnorm:
movq $0,%rax
ret
.may_be_subnorm:
testl $0x7fff,16(%rsp) / set ZF iff bexp(x) = 0
jnz .not_subnorm / jump iff bexp(x) /= 0
orl 8(%rsp),%eax / (eax) = 0 iff sgnfcnd(x) = 0
jz .not_subnorm
movq $1,%rax
ret
.align 16
SET_SIZE(issubnormall)
ENTRY(iszerol)
movl 16(%rsp),%eax / ax <-- sign and bexp of x
andl $0x7fff,%eax / eax <-- zero_xtnd(bexp(x))
jz .may_be_zero / jump iff bexp(x) = 0
.not_zero:
movq $0,%rax
ret
.may_be_zero: / here, (eax) = 0
orl 12(%rsp),%eax / is hi_32(sgnfcnd(x)) = 0?
jnz .not_zero / jump iff hi_32(sgnfcnd(x)) /= 0
orl 8(%rsp),%eax / is lo_32(sgnfcnd(x)) = 0?
jnz .not_zero / jump iff lo_32(sgnfcnd(x)) /= 0
movq $1,%rax
ret
.align 16
SET_SIZE(iszerol)
ENTRY(signbitl)
movl 16(%rsp),%eax / eax[15] <-- sign_bit(x)
shrl $15,%eax / eax <-- zero_xtnd(sign_bit(x))
andq $1,%rax
ret
.align 16
SET_SIZE(signbitl)