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>


  12  *
  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 "exp10l.s"
  30 
  31 #include "libm.h"
  32 LIBM_ANSI_PRAGMA_WEAK(exp10l,function)
  33 #include "libm_synonyms.h"
  34 
  35         .data
  36         .align  4
  37 lt2_hi: .long   0xfbd00000, 0x9a209a84, 0x00003ffd
  38 lt2_lo: .long   0x653f4837, 0x8677076a, 0x0000bfc9
  39 
  40         ENTRY(exp10l)
  41         movl    12(%esp),%ecx           / cx <--sign&bexp(x)
  42         andl    $0x00007fff,%ecx        / ecx <-- zero_xtnd(bexp(x))
  43         cmpl    $0x00003ffd,%ecx        / Is |x| < log10(2)?
  44         jb      .shortcut               / If so, take a shortcut.
  45         je      .check_tail             / maybe |x| only slightly < log10(2)
  46         cmpl    $0x00007fff,%ecx        / bexp(|x|) = bexp(INF)?
  47         je      .not_finite             / if so, x is not finite
  48         cmpl    $0x0000400e,%ecx        / |x| < 32768 = 2^15?
  49         jb      .finite_non_special     / if so, proceed with argument reduction
  50         fldt    4(%esp)                 / x
  51         fld1                            / 1, x
  52         jmp     1f
  53 .finite_non_special:                    / Here, log10(2) < |x| < 2^15




  12  *
  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 "exp10l.s"
  30 
  31 #include "libm.h"


  32 
  33         .data
  34         .align  4
  35 lt2_hi: .long   0xfbd00000, 0x9a209a84, 0x00003ffd
  36 lt2_lo: .long   0x653f4837, 0x8677076a, 0x0000bfc9
  37 
  38         ENTRY(exp10l)
  39         movl    12(%esp),%ecx           / cx <--sign&bexp(x)
  40         andl    $0x00007fff,%ecx        / ecx <-- zero_xtnd(bexp(x))
  41         cmpl    $0x00003ffd,%ecx        / Is |x| < log10(2)?
  42         jb      .shortcut               / If so, take a shortcut.
  43         je      .check_tail             / maybe |x| only slightly < log10(2)
  44         cmpl    $0x00007fff,%ecx        / bexp(|x|) = bexp(INF)?
  45         je      .not_finite             / if so, x is not finite
  46         cmpl    $0x0000400e,%ecx        / |x| < 32768 = 2^15?
  47         jb      .finite_non_special     / if so, proceed with argument reduction
  48         fldt    4(%esp)                 / x
  49         fld1                            / 1, x
  50         jmp     1f
  51 .finite_non_special:                    / Here, log10(2) < |x| < 2^15