Print this page
5261 libm should stop using synonyms.h
5298 fabs is 0-sized, confuses dis(1) and others
Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Approved by: Gordon Ross <gwr@nexenta.com>


  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
  23  */
  24 /*
  25  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
  26  * Use is subject to license terms.
  27  */
  28 
  29         .file "ilogbl.s"
  30 
  31 #include "libm.h"
  32 LIBM_ANSI_PRAGMA_WEAK(ilogbl,function)
  33 #include "libm_synonyms.h"
  34 #include "xpg6.h"
  35 
  36         .data
  37         .align  8
  38 two63:  .long   0x0,0x43d00000          / 2**63
  39 
  40         ENTRY(ilogbl)
  41         movl    12(%esp),%eax           / eax <-- sign and bexp of x
  42         andl    $0x00007fff,%eax        / eax <-- bexp(x)
  43         jz      .bexp_0                 / jump iff x is 0 or subnormal
  44                                         / here, biased exponent is non-zero
  45         testl   $0x80000000,8(%esp)     / test msb of hi_32(sgnfcnd(x))
  46         jz      .ilogbl_not_finite      / jump if unsupported format
  47         cmpl    $0x00007fff,%eax
  48         je      .ilogbl_not_finite
  49         subl    $16383,%eax             / unbias exponent by 16383 = 0x3fff
  50         ret
  51 
  52 .ilogbl_not_finite:
  53         movl    $0x7fffffff,%eax        / x is NaN/inf/unsup




  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
  23  */
  24 /*
  25  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
  26  * Use is subject to license terms.
  27  */
  28 
  29         .file "ilogbl.s"
  30 
  31 #include "libm.h"
  32 LIBM_ANSI_PRAGMA_WEAK(ilogbl,function)

  33 #include "xpg6.h"
  34 
  35         .data
  36         .align  8
  37 two63:  .long   0x0,0x43d00000          / 2**63
  38 
  39         ENTRY(ilogbl)
  40         movl    12(%esp),%eax           / eax <-- sign and bexp of x
  41         andl    $0x00007fff,%eax        / eax <-- bexp(x)
  42         jz      .bexp_0                 / jump iff x is 0 or subnormal
  43                                         / here, biased exponent is non-zero
  44         testl   $0x80000000,8(%esp)     / test msb of hi_32(sgnfcnd(x))
  45         jz      .ilogbl_not_finite      / jump if unsupported format
  46         cmpl    $0x00007fff,%eax
  47         je      .ilogbl_not_finite
  48         subl    $16383,%eax             / unbias exponent by 16383 = 0x3fff
  49         ret
  50 
  51 .ilogbl_not_finite:
  52         movl    $0x7fffffff,%eax        / x is NaN/inf/unsup